Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Mon, Sep 29, 1:48 AM

in-portal

Index: branches/unlabeled/unlabeled-1.12.2/kernel/units/admin/admin_config.php
===================================================================
--- branches/unlabeled/unlabeled-1.12.2/kernel/units/admin/admin_config.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.12.2/kernel/units/admin/admin_config.php (revision 4941)
@@ -0,0 +1,199 @@
+<?php
+
+ $config = Array(
+ 'Prefix' => 'adm',
+ 'EventHandlerClass' => Array('class' => 'kEventHandler', 'file' => '', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array('class' => 'AdminTagProcessor', 'file' => 'admin_tag_processor.php', 'build_event' => 'OnBuild'),
+
+
+ 'TitlePresets' => Array(
+ 'tree_root' => Array('format' => '!la_section_overview!'),
+
+ 'tree_reports' => Array('format' => '!la_section_overview!'),
+
+ 'tree_system' => Array('format' => '!la_section_overview!'),
+
+ 'tree_tools' => Array('format' => '!la_section_overview!'),
+
+ 'no_permissions' => Array('format' => '!la_title_NoPermissions!'),
+ ),
+
+ 'Sections' => Array(
+ 'in-portal:root' => Array(
+ 'parent' => null,
+ 'icon' => 'site',
+ 'label' => $this->Application->ConfigValue('Site_Name'),
+ 'url' => Array('t' => 'sections_list', 'pass' => 'm', 'pass_section' => true, 'no_amp' => 1),
+ 'permissions' => Array('view', 'advanced:admin_login', 'advanced:front_login'),
+ 'priority' => 0,
+ 'type' => stTREE,
+ ),
+
+ // "Summary & Logs" section
+ 'in-portal:reports' => Array(
+ 'parent' => 'in-portal:root',
+ 'icon' => 'summary_logs',
+ 'label' => 'la_tab_Reports',
+ 'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 4,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:log_summary' => Array(
+ 'parent' => 'in-portal:reports',
+ 'icon' => 'summary',
+ 'label' => 'la_tab_Summary',
+ 'url' => Array('index_file' => 'logs/summary.php', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:searchlog' => Array(
+ 'parent' => 'in-portal:reports',
+ 'icon' => 'search_log',
+ 'label' => 'la_tab_SearchLog',
+ 'url' => Array('index_file' => 'logs/searchlog.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'delete'),
+ 'priority' => 2,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:sessionlog' => Array(
+ 'parent' => 'in-portal:reports',
+ 'icon' => 'sessions_log',
+ 'label' => 'la_tab_SessionLog',
+ 'url' => Array('index_file' => 'logs/session_list.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'delete'),
+ 'priority' => 3,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:emaillog' => Array(
+ 'parent' => 'in-portal:reports',
+ 'icon' => 'email_log',
+ 'label' => 'la_tab_EmailLog',
+ 'url' => Array('index_file' => 'logs/email_log.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'delete'),
+ 'priority' => 4,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:visits' => Array(
+ 'parent' => 'in-portal:reports',
+ 'icon' => 'visits',
+ 'label' => 'la_tab_Visits',
+ 'url' => Array('t' => 'visits/visits_list', 'pass' => 'm'),
+ 'permissions' => Array('view', 'delete'),
+ 'priority' => 5,
+ 'type' => stTREE,
+ ),
+
+ // "Configuration" section
+ 'in-portal:system' => Array(
+ 'parent' => 'in-portal:root',
+ 'icon' => 'conf',
+ 'label' => 'la_tab_Sys_Config',
+ 'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 5,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:configure_general' => Array(
+ 'parent' => 'in-portal:system',
+ 'icon' => 'conf_general',
+ 'label' => 'la_tab_General',
+ 'url' => Array('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+
+ // "Tools" section
+ 'in-portal:tools' => Array(
+ 'parent' => 'in-portal:root',
+ 'icon' => 'tools',
+ 'label' => 'la_tab_Tools',
+ 'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 6,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:backup' => Array(
+ 'parent' => 'in-portal:tools',
+ 'icon' => 'tool_backup',
+ 'label' => 'la_tab_Backup',
+ 'url' => Array('index_file' => 'backup/backup1.php', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:restore' => Array(
+ 'parent' => 'in-portal:tools',
+ 'icon' => 'tool_restore',
+ 'label' => 'la_tab_Restore',
+ 'url' => Array('index_file' => 'backup/restore1.php', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 2,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:export' => Array(
+ 'parent' => 'in-portal:tools',
+ 'icon' => 'tool_export',
+ 'label' => 'la_tab_ExportData',
+ 'url' => Array('index_file' => 'backup/export1.php', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 3,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:main_import' => Array(
+ 'parent' => 'in-portal:tools',
+ 'icon' => 'tool_import',
+ 'label' => 'la_tab_ImportData',
+ 'url' => Array('index_file' => 'import/step1.php', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 4,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:sql_query' => Array(
+ 'parent' => 'in-portal:tools',
+ 'icon' => 'tool_import',
+ 'label' => 'la_tab_QueryDB',
+ 'url' => Array('index_file' => 'tools/sql_query.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 5,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:server_info' => Array(
+ 'parent' => 'in-portal:tools',
+ 'icon' => 'server_info',
+ 'label' => 'la_tab_ServerInfo',
+ 'url' => Array('index_file' => 'tools/server_info.php', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 6,
+ 'type' => stTREE,
+ ),
+
+ // "Help" section
+ 'in-portal:help' => Array(
+ 'parent' => 'in-portal:root',
+ 'icon' => 'help',
+ 'label' => 'la_tab_Help',
+ 'url' => Array('index_file' => 'help/manual.pdf', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 7,
+ 'type' => stTREE,
+ ),
+ ),
+
+ );
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.12.2/kernel/units/admin/admin_config.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.12
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.12.2/kernel/units/general/main_event_handler.php
===================================================================
--- branches/unlabeled/unlabeled-1.12.2/kernel/units/general/main_event_handler.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.12.2/kernel/units/general/main_event_handler.php (revision 4941)
@@ -0,0 +1,124 @@
+<?php
+
+ class MainEventHandler extends kEventHandler {
+
+
+ /**
+ * Description
+ *
+ * @var kDBConnection
+ * @access public
+ */
+ var $Conn;
+
+ /**
+ * Adds ability to address db connection
+ *
+ * @return kDBEventHandler
+ * @access public
+ */
+ function MainEventHandler()
+ {
+ parent::kBase();
+ $this->Conn =& $this->Application->GetADODBConnection();
+ }
+
+ /**
+ * Created url part for this module
+ *
+ * @param kEvent $event
+ */
+ function BuildEnv(&$event)
+ {
+ $prefix_special = $event->getPrefixSpecial();
+ $url_params = $event->getEventParam('url_params');
+
+ $query_vars = $this->Application->getUnitOption($event->Prefix, 'QueryString');
+
+ //if pass events is off and event is not implicity passed
+ if ( !$event->getEventParam('pass_events') && !isset($url_params[$prefix_special.'_event']) )
+ {
+ $url_params[$prefix_special.'_event'] = ''; // remove event from url if requested
+ //otherwise it will use value from get_var
+ }
+
+ if(!$query_vars) return true;
+
+ $processed_params = Array();
+ foreach($query_vars as $index => $var_name)
+ {
+ //if value passed in params use it, otherwise use current from application
+ $var_name = $prefix_special.'_'.$var_name;
+ $processed_params[$var_name] = isset( $url_params[$var_name] ) ? $url_params[$var_name] : $this->Application->GetVar($var_name);
+ if ( isset($url_params[$var_name]) ) unset( $url_params[$var_name] );
+ }
+
+ $ret = '';
+ $default_language_id = $this->Application->GetDefaultLanguageId();
+ if( $processed_params['m_lang'] != $default_language_id )
+ {
+ $language_name = $this->Application->getCache('language_names', $processed_params['m_lang']);
+ if ($language_name === false) {
+ $sql = 'SELECT PackName
+ FROM '.TABLE_PREFIX.'Language
+ WHERE LanguageId = '.$processed_params['m_lang'];
+ $language_name = $this->Conn->GetOne($sql);
+ $this->Application->setCache('language_names', $processed_params['m_lang'], $language_name);
+ }
+ $ret .= $language_name.'/';
+ }
+
+ $default_theme_id = $this->Application->GetDefaultThemeId();
+ if( $processed_params['m_theme'] != $default_theme_id )
+ {
+ $theme_name = $this->Application->getCache('theme_names', $processed_params['m_theme']);
+ if ($theme_name === false) {
+ $sql = 'SELECT Name
+ FROM '.TABLE_PREFIX.'Theme
+ WHERE ThemeId = '.$processed_params['m_theme'];
+ $theme_name = $this->Conn->GetOne($sql);
+ $this->Application->setCache('theme_names', $processed_params['m_theme'], $theme_name);
+
+ }
+ $ret .= $theme_name.'/';
+ }
+
+ if ($processed_params['m_cat_id'] > 0) {
+ $ret .= $this->Application->getFilename('c', $processed_params['m_cat_id']).'/';
+ }
+
+ $force_page_adding = false;
+ if (getArrayValue($url_params, 'reset'))
+ {
+ unset($url_params['reset']);
+ if ($processed_params['m_cat_id'])
+ {
+ $processed_params['m_cat_page'] = 1;
+ $force_page_adding = true;
+ }
+ }
+
+ if( $processed_params['m_cat_page'] > 1 || $force_page_adding )
+ {
+ $ret = preg_replace('/(.*)\//', '\\1', $ret).'_'.$processed_params['m_cat_page'].'/';
+ }
+
+ $template = getArrayValue($url_params, 't');
+ $category_template = $processed_params['m_cat_id'] ? $this->Application->getCache('category_templates', $processed_params['m_cat_id']) : '';
+
+ // remove template from url if it is category index cached template
+ if ($template == $category_template || strtolower($template) == '__default__') {
+ $template = '';
+ }
+
+ if ($template) {
+ $ret .= $template.'/';
+ }
+ unset($url_params['t']);
+
+ $event->setEventParam('url_params', $url_params);
+ $event->setEventParam('env_string', strtolower($ret) );
+ }
+ }
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.12.2/kernel/units/general/main_event_handler.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.12
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.12.2/kernel/include/advsearch.php
===================================================================
--- branches/unlabeled/unlabeled-1.12.2/kernel/include/advsearch.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.12.2/kernel/include/advsearch.php (revision 4941)
@@ -0,0 +1,355 @@
+<?php
+class clsAdvancedSearchResults extends clsItemCollection
+{
+ var $ResultTable;
+ var $FieldList;
+ var $FieldWeight;
+ var $WhereClauses;
+ var $SourceTable;
+ var $Relationships;
+ var $Ignored_Words;
+ var $CatClause;
+ var $Keywords;
+ var $Phrase = "";
+ var $SearchType;
+ var $RequiredRelevance;
+ var $PctRelevance;
+ var $PctPop;
+ var $PctRating;
+
+ var $SearchLogRecord = Array();
+
+ function clsAdvancedSearchResults($SearchSource,$DataClass, $ItemType = 0)
+ {
+ global $objConfig, $objSearchConfig;
+
+ $this->clsItemCollection();
+ $this->SourceTable = $SearchSource;
+ $this->SetResultTable($SearchSource,$DataClass);
+ $this->FieldList = array();
+ $this->Relationships = array();
+ $this->Ignored_Words = array();
+ $this->WhereClauses = array();
+ $this->FieldWeight = array();
+ $this->Keywords = GetKeywords("");
+ $this->SearchType = 0; //simple
+ $this->RequiredRelevance=0;
+ $this->PctRelevance = $objConfig->Get("SearchRel_DefaultKeyword")/100;
+ $this->PctPop = $objConfig->Get("SearchRel_DefaultPop")/100;
+ $this->PctRating = $objConfig->Get("SearchRel_DefaultRating")/100;
+ if(!is_object($objSearchConfig))
+ $objSearchConfig = new clsSearchConfigList();
+ $objSearchConfig->Clear();
+
+ if ($ItemType == 0) {
+ $objSearchConfig->Query_Item("SELECT * FROM ".$objSearchConfig->SourceTable." WHERE TableName='$SearchSource' AND AdvancedSearch=1 ORDER BY DisplayOrder");
+ }
+ else {
+ $tables = Array(1 => 'Category', 2 => 'News',
+ 3 => 'Topic', 4 => 'Link',
+ 11 => 'Products');
+ $table = $tables[$ItemType];
+ $sql = "SELECT sc.* FROM ".$objSearchConfig->SourceTable." AS sc LEFT JOIN ".GetTablePrefix()."CustomField AS cf ON sc.CustomFieldId = cf.CustomFieldId WHERE TableName='$table' OR ((TableName='".GetTablePrefix()."CustomField' OR TableName='CustomField') AND cf.Type = $ItemType) AND AdvancedSearch=1 ORDER BY sc.DisplayOrder";
+ $objSearchConfig->Query_Item($sql);
+ }
+ }
+
+ function SetResultTable($SearchSource,$DataClass)
+ {
+ global $objSession;
+
+ //$this->ResultTable = $objSession->GetSessionKey()."_Search";
+ $this->ResultTable = $objSession->GetSessionTable('Search', '');
+ $this->classname= $DataClass;
+ }
+
+ function LoadSearchResults($Start=0,$PerPage=NULL)
+ {
+ if($PerPage)
+ {
+ $limit = "LIMIT $Start,$PerPage";
+ }
+ $sql = "SELECT * FROM ".$this->ResultTable." ".$limit;
+ $this->Clear();
+ $rs = $this->adodbConnection->Execute($sql);
+ return $this->Query_Item($sql);
+ }
+
+ function SetCategoryClause($whereclause)
+ {
+ $this->CatClause=$whereclause;
+ }
+
+ function AddRelationship($JoinTable,$JoinExpression=NULL)
+ {
+ $this->Relationships[$JoinTable]=$JoinExpression;
+ }
+
+ function SetKeywords($keywords)
+ {
+ $this->Phrase=$keywords;
+ $this->keywords = GetKeywords($keywords);
+ }
+
+ function AddAdvancedField($TableName,$FieldName,$Verb,$Value,$conj, $main_prefix)
+ {
+ global $objSearchConfig, $objConfig;
+
+ static $x = 0, $customs_joined = Array();
+
+// echo 'Adding ADVANCED SearchField: ['.$TableName.']; ['.$FieldName.']; ['.$Verb.']; ['.$Value.']; ['.$conj.']<br />';
+
+ if(!is_object($objSearchConfig))
+ $objSearchConfig = new clsSeachConfigList();
+
+ if ($TableName == GetTablePrefix().'CustomField') {
+ // stupid custom fields already have prefix in SearchConfig table (not for in-commerce module :D)
+ $prefix = '';
+ }
+ else {
+ $prefix = GetTablePrefix();
+ }
+ $f = $prefix.$TableName.".".$FieldName;
+ $FieldConfig = $objSearchConfig->GetItemByName($TableName,$FieldName);
+ if(!is_object($FieldConfig)) {
+ return false;
+ }
+
+ if ($FieldConfig->Get('ForeignField')) {
+ $x++;
+ $parts = explode(".",$FieldConfig->Get("ForeignField"));
+ $Table = $parts[0];
+ $pseudo = 'c'.$x;
+ $Table = AddTablePrefix($Table);
+ $Field = $parts[1];
+ $join = $FieldConfig->Get("JoinClause");
+ $join = str_replace($Table, $pseudo, $join);
+ $join = str_replace("{ForeignTable}", $pseudo, $join);
+ $join = str_replace("{LocalTable}", $TableName, $join);
+ $join = str_replace("{Table}", AddTablePrefix($this->SourceTable), $join);
+ $join = '('.$join.' AND '.$pseudo.'.CustomFieldId='.$FieldConfig->Get('CustomFieldId').')';
+ $this->AddRelationship($Table.' AS '.$pseudo, $join);
+
+ // for items that does not have appropriate records in CustomMetaData table
+ if ($Verb == 'notcontains' || $Verb == 'isnot') {
+ $or_not_null = ' OR '.$pseudo.'.'.$Field.' IS NULL';
+ }
+ else {
+ $or_not_null = '';
+ }
+
+ $FieldItem["where"] = str_replace('CustomMetaData', $pseudo, $FieldConfig->GetWhereClause($Verb,$Value)).$or_not_null;
+ $FieldItem["Field"] = $FieldConfig->Get("ForeignField");
+ $FieldItem["Table"] = $pseudo;
+ $FieldItem["conjuction"] = $conj;
+ $FieldItem["weight"] = $FieldConfig->Get("Priority");
+ }
+ else {
+ $classes = Array( 'Link' => '_clsLinkList',
+ 'News' => '_clsNewsList',
+ 'Topic' => '_clsTopicList',
+ 'Category' => 'clsCatList');
+ $list_class = getArrayValue($classes, $TableName);
+ if ($list_class) {
+ $objList =& new $list_class();
+ }
+
+ if ($FieldConfig->Get('CustomFieldId')) {
+ $ml_formatter =& $this->Application->recallObject('kMultiLanguage');
+ $FieldConfig->Set('FieldName', $ml_formatter->LangFieldName('cust_'.$FieldConfig->Get('CustomFieldId')));
+ }
+
+ switch ($FieldName) {
+ case 'HotItem':
+ $cutoff = $objList->GetHotValue();
+ $Value == 1 ? $not = '' : $not = 'NOT ';
+ $where_clause = $FieldConfig->GetWhereClause($Verb, $Value);
+ $where_clause .= ' OR ('.AddTablePrefix($TableName).'.HotItem=2 AND '.
+ $not.'('.AddTablePrefix($TableName).
+ '.Hits>='.$cutoff.'))';
+ break;
+ case 'PopItem':
+ $cutoff = $objList->GetPopValue();
+ $Value == 1 ? $not = '' : $not = 'NOT ';
+ $where_clause = $FieldConfig->GetWhereClause($Verb, $Value);
+ $where_clause .= ' OR ('.AddTablePrefix($TableName).'.PopItem=2 AND '.
+ $not.'('.AddTablePrefix($TableName).
+ '.CachedRating>='.$cutoff.'))';
+ break;
+ case 'NewItem':
+ $NewTime = $objConfig->Get($TableName.'_NewDays')*3600*24;
+ $Value == 1 ? $not = '' : $not = 'NOT ';
+ $where_clause = $FieldConfig->GetWhereClause($Verb, $Value);
+ $where_clause .= ' OR ('.AddTablePrefix($TableName).'.NewItem=2 AND '.
+ $not.'('.adodb_mktime().'-'.AddTablePrefix($TableName).
+ '.CreatedOn<'.$NewTime.'))';
+ break;
+ default:
+ $where_clause = $FieldConfig->GetWhereClause($Verb, $Value);
+ break;
+ }
+
+ $FieldItem = Array();
+ if ($FieldConfig->Get('CustomFieldId')) {
+ if (!getArrayValue($customs_joined, $main_prefix)) {
+ $item_table = $this->Application->getUnitOption($main_prefix, 'TableName');
+ $custom_table = $this->Application->getUnitOption($main_prefix.'-cdata', 'TableName');
+ $this->AddRelationship($custom_table.' AS '.$main_prefix.'_custom_data', $main_prefix.'_custom_data.ResourceId = '.$item_table.'.ResourceId');
+ $customs_joined[$main_prefix] = true;
+ }
+
+ $FieldItem['Table'] = $main_prefix.'_custom_data';
+ $FieldItem['Field'] = $FieldConfig->Get('FieldName');
+ }
+ else {
+ $FieldItem['Table'] = AddTablePrefix($TableName);
+ $FieldItem['Field'] = $FieldName;
+ }
+
+ $FieldItem['where'] = $FieldItem['Table'].'.'.$where_clause;
+ $FieldItem['conjuction'] = $conj;
+ $FieldItem['weight'] = $FieldConfig->Get('Priority');
+
+
+ }
+ $this->FieldList[] = $FieldItem;
+
+
+ // create search record
+ $this->SearchLogRecord[] = language('la_Field').' "'.$FieldConfig->getHumanField().'" '.$FieldConfig->getHumanVerb($Verb).' '.language('la_Value').' "'.$FieldConfig->getHumanValue($Value).'" '.language('lu_'.$conj);
+
+ unset($FieldItem);
+
+ }
+
+ function getKeywords(&$FieldConfig)
+ {
+ $ret = implode('<br />', $this->SearchLogRecord);
+ return preg_replace('/(.*) '.preg_quote(language('lu_and'), '/').'|'.preg_quote(language('lu_or'), '/').'$/is', '\\1', $ret);
+ }
+
+/* function AddAdvancedCustomFields()
+ {
+ $sql = "SELECT * FROM ".GetTablePrefix()."SearchConfig WHERE TableName='".$this->SourceTable."' AND AdvancedSearch=1 AND CustomFieldId>0";
+ //echo $sql;
+ foreach($this->Relationships as $Table=>$clause)
+ {
+ if(strlen($Table)>0 && $Table != "Category")
+ $sql .= " OR TableName='".$Table."'";
+ }
+ $ctable = GetTablePrefix()."CustomMetaData";
+ $rs = $this->adodbConnection->Execute($sql);
+ $CustomJoined = FALSE;
+ while($rs && !$rs->EOF)
+ {
+ $x = $rs->fields["CustomFieldId"];
+ $t = $ctable." as c".$x;
+ $join = "(c$x.ResourceId=".GetTablePrefix().$this->SourceTable.".ResourceId AND c$x.CustomFieldId=".$rs->fields["CustomFieldId"].")";
+ $this->AddRelationship($t,$join);
+ $f = "c".$x.".Value ";
+ $this->FieldList[] = $f;
+ $this->FieldWeight[$f] = $rs->fields["Priority"];
+ $rs->MoveNext();
+ }
+ }
+
+ function AddAdvancedFields()
+ {
+ $sql = "SELECT * FROM ".GetTablePrefix()."SearchConfig WHERE TableName='".$this->SourceTable."' AND AdvancedSearch=1 AND CustomFieldId=0";
+ //echo $sql;
+ foreach($this->Relationships as $Table=>$clause)
+ {
+ if(strlen($Table)>0 && $Table != "Category")
+ $sql .= " OR TableName='".$Table."'";
+ }
+ $rs = $this->adodbConnection->Execute($sql);
+
+ while($rs && !$rs->EOF)
+ {
+ $f = GetTablePrefix().$rs->fields["TableName"].".".$rs->fields["FieldName"];
+ $this->FieldList[] = $f;
+ $this->FieldWeight[$f] = $rs->fields["Priority"];
+ $rs->MoveNext();
+ }
+ $this->AddAdvancedCustomFields();
+ }*/
+
+ /* ready to write the code to build the query and go */
+
+ function BuildWhereClause()
+ {
+ $where = "";
+ foreach($this->FieldList as $f)
+ $where .= " (".$f["where"].") ".$f["conjuction"];
+
+ $cut_length = substr($where, -2) == 'OR' ? 2 : substr($where, -3) == 'AND' ? 3 : 0;
+ $where = substr($where, 0, strlen($where) - $cut_length);
+ return $where;
+ }
+
+ function PerformSearch($ItemType,$OrderBy=NULL,$InitTable=FALSE, $idlist=NULL)
+ {
+ static $SelectSQL, $OldItemType;
+ global $objSession, $objItemTypes;
+
+ // add recrod to log
+ $objSearchList = new clsSearchLogList();
+ $objSearchList->UpdateKeyword($this->getKeywords(), 1);
+
+ $ctype = $objItemTypes->GetItem($ItemType);
+ $idField = $ctype->Get("SourceTable")."Id";
+ $this->SourceTable = AddTablePrefix($ctype->Get("SourceTable"));
+ $result=0;
+ $PopField = $ctype->Get("PopField");
+ $RateField = $ctype->Get("RateField");
+ $typestr = str_pad($ItemType,2,"0",STR_PAD_LEFT);
+ $SelectSQL = "SELECT ".$this->SourceTable.".".$idField." as ItemId, ". $this->SourceTable.".Priority as Relevance, ".$this->SourceTable.".ResourceId, CONCAT($typestr) as ItemType, EditorsPick as EdPick FROM ".$this->SourceTable." ";
+
+ foreach($this->Relationships as $JoinTable=>$OnClause)
+ {
+ $SelectSQL .= "LEFT JOIN $JoinTable ON ($OnClause) ";
+ }
+ $first=1;
+ $WhereClause = $this->BuildWhereClause();
+ if(strlen($WhereClause)>0)
+ {
+ $SelectSQL .= " WHERE ".$WhereClause;
+ }
+ $SelectSQL .= " GROUP BY $idField ";
+ //echo $SelectSQL;
+ $this->adodbConnection->Execute("DROP TABLE IF EXISTS ".$this->ResultTable);
+ $full_sql = "CREATE TABLE ".$this->ResultTable." ".$indexSQL.$SelectSQL;
+ $this->adodbConnection->Execute($full_sql);
+ // if advanced seaech used, then delete simple search keywords
+ $objSession->SetVariable('Search_Keywords', '');
+ //print_pre($full_sql);
+ }
+
+ function BuildIndexes()
+ {
+ $sql = "ALTER TABLE ".$this->ResultTable." ADD INDEX (Relevance), ";
+ $sql .="ADD INDEX (ItemId), ";
+ $sql .="ADD INDEX (ItemType), ";
+ $sql .=" ADD INDEX sorting (EdPick,Relevance)";
+ $this->adodbConnection->Execute($sql);
+ }
+
+ function Result_IdList()
+ {
+ /* returns an array contain a resource ID list */
+ $sql = "SELECT DISTINCT(ResourceId) FROM ".$this->ResultTable;
+ $rs = $this->adodbConnection->Execute($sql);
+ $result = array();
+ while($rs && !$rs->EOF)
+ {
+ $result[] = $rs->fields["ResourceId"];
+ $rs->MoveNext();
+ }
+ return $result;
+ }
+
+ function SetRelevence($ItemType, $IdField)
+ {
+ }
+}
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.12.2/kernel/include/advsearch.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.12
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.12.2/tools/debug_sample.php
===================================================================
--- branches/unlabeled/unlabeled-1.12.2/tools/debug_sample.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.12.2/tools/debug_sample.php (revision 4941)
@@ -0,0 +1,90 @@
+<?php
+
+// define('SILENT_LOG', 1); // write all sql errors to log
+// define('DBG_REQUREST_LOG', $_SERVER['DOCUMENT_ROOT'].'/../request.log'); // write all POST/GET request log to file
+
+ define('DEBUG_MODE', 1); // enable/disable debug mode
+ if( defined('DEBUG_MODE') && DEBUG_MODE ) InitDebugger();
+
+ //define('DBG_SITE_PATH', '/'); // set alternative BASE_PATH for old in-portal parts (where no K4 included)
+
+ //define('CMS', 1); // search for missing templates on HDD in database
+
+ function InitDebugger()
+ {
+ define('DBG_LOCAL_BASE_PATH', 'w:'); // replace server's DocumentRoot by this path in filenames in errors
+
+// define('DBG_RAISE_ON_WARNINGS', 1); // show debugger automatically if some errors occured
+ define('DBG_SQL_PROFILE',1); // profile SQL queries
+ define('DBG_SQL_FAILURE', defined('IS_INSTALL') && IS_INSTALL ? 0 : 1); // assume sql errors as php fatal errors, warning otherwise
+
+// define('DBG_PROFILE_INCLUDES', 1);
+
+ define('DBG_SHOW_HTTPQUERY', 1); // show http query content
+ define('DBG_SHOW_SESSIONDATA', 1); // show session data
+
+// define('DBG_EDIT_HELP', 1); // Show help filename on help screen
+// define('DBG_HELP', 1); // Show FCK editor when viewing help screen
+
+// define('DBG_FORCE_THEME', 1); // Use this ThemeId, not one passed in env
+ define('DBG_PHRASES', 1); // Add ability to translate phrases on the fly (K4 only)
+// define('DBG_PHRASES_HIGHLIGHT', 1); // used for phrase existance detection debugging
+
+ define('DBG_WINDOW_WIDTH', 700);// Set custom debugger layer width (in pixels)
+
+// define('DBG_CACHE', 1); // debug cache usage
+// define('DBG_REDIRECT', 1); // set this to debug get redirect attempts
+ define('DBG_ZEND_PRESENT', 0); // set this to zero to debug debugger
+ //define('DBG_VALIDATE_CONFIGS',1); // check that config fields match ones from database
+// define('DBG_SHOW_TAGS', 1); // show tags beeing processed
+
+ // for ADODB to work: begin
+ define('ADODB_OUTP', 'dbg_SQLLog');
+
+ function dbg_SQLLog($msg,$new_line=false)
+ {
+
+ }
+ // for ADODB to work: end
+
+ function isSkipTable($sql)
+ {
+ // don't show sqls that use one or more tables from list below
+ static $skipTables = Array( 'PermissionConfig','SessionData','Permissions',
+ 'Phrase','Cache',
+ 'PersistantSessionData','EmailQueue','UserSession',
+ 'ThemeFiles', 'Language');
+ // ,'Modules',,'PermCache','Events''ConfigurationValues',
+
+ // make exception for scripts listed below
+ $filename = basename($_SERVER['PHP_SELF']);
+ switch ($filename) {
+ case 'session_list.php':
+ $allow_tables = Array('UserSession', 'SessionData');
+ break;
+
+ default:
+ $allow_tables = Array();
+ break;
+ }
+
+ foreach ($allow_tables as $allowed_table) {
+ unset($skipTables[ array_search($allowed_table, $skipTables)]);
+ }
+
+ foreach ($skipTables as $table) {
+ if( tableMatch($table,$sql) ) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ function tableMatch($table_name,$sql)
+ {
+ static $prefix = '';
+ $prefix = defined('TABLE_PREFIX')?TABLE_PREFIX:GetTablePrefix();
+ return strpos($sql,$prefix.$table_name)!==false;
+ }
+ }
+?>
Property changes on: branches/unlabeled/unlabeled-1.12.2/tools/debug_sample.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.12
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.12.2/core/units/admin/admin_config.php
===================================================================
--- branches/unlabeled/unlabeled-1.12.2/core/units/admin/admin_config.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.12.2/core/units/admin/admin_config.php (revision 4941)
@@ -0,0 +1,199 @@
+<?php
+
+ $config = Array(
+ 'Prefix' => 'adm',
+ 'EventHandlerClass' => Array('class' => 'kEventHandler', 'file' => '', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array('class' => 'AdminTagProcessor', 'file' => 'admin_tag_processor.php', 'build_event' => 'OnBuild'),
+
+
+ 'TitlePresets' => Array(
+ 'tree_root' => Array('format' => '!la_section_overview!'),
+
+ 'tree_reports' => Array('format' => '!la_section_overview!'),
+
+ 'tree_system' => Array('format' => '!la_section_overview!'),
+
+ 'tree_tools' => Array('format' => '!la_section_overview!'),
+
+ 'no_permissions' => Array('format' => '!la_title_NoPermissions!'),
+ ),
+
+ 'Sections' => Array(
+ 'in-portal:root' => Array(
+ 'parent' => null,
+ 'icon' => 'site',
+ 'label' => $this->Application->ConfigValue('Site_Name'),
+ 'url' => Array('t' => 'sections_list', 'pass' => 'm', 'pass_section' => true, 'no_amp' => 1),
+ 'permissions' => Array('view', 'advanced:admin_login', 'advanced:front_login'),
+ 'priority' => 0,
+ 'type' => stTREE,
+ ),
+
+ // "Summary & Logs" section
+ 'in-portal:reports' => Array(
+ 'parent' => 'in-portal:root',
+ 'icon' => 'summary_logs',
+ 'label' => 'la_tab_Reports',
+ 'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 4,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:log_summary' => Array(
+ 'parent' => 'in-portal:reports',
+ 'icon' => 'summary',
+ 'label' => 'la_tab_Summary',
+ 'url' => Array('index_file' => 'logs/summary.php', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:searchlog' => Array(
+ 'parent' => 'in-portal:reports',
+ 'icon' => 'search_log',
+ 'label' => 'la_tab_SearchLog',
+ 'url' => Array('index_file' => 'logs/searchlog.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'delete'),
+ 'priority' => 2,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:sessionlog' => Array(
+ 'parent' => 'in-portal:reports',
+ 'icon' => 'sessions_log',
+ 'label' => 'la_tab_SessionLog',
+ 'url' => Array('index_file' => 'logs/session_list.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'delete'),
+ 'priority' => 3,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:emaillog' => Array(
+ 'parent' => 'in-portal:reports',
+ 'icon' => 'email_log',
+ 'label' => 'la_tab_EmailLog',
+ 'url' => Array('index_file' => 'logs/email_log.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'delete'),
+ 'priority' => 4,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:visits' => Array(
+ 'parent' => 'in-portal:reports',
+ 'icon' => 'visits',
+ 'label' => 'la_tab_Visits',
+ 'url' => Array('t' => 'visits/visits_list', 'pass' => 'm'),
+ 'permissions' => Array('view', 'delete'),
+ 'priority' => 5,
+ 'type' => stTREE,
+ ),
+
+ // "Configuration" section
+ 'in-portal:system' => Array(
+ 'parent' => 'in-portal:root',
+ 'icon' => 'conf',
+ 'label' => 'la_tab_Sys_Config',
+ 'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 5,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:configure_general' => Array(
+ 'parent' => 'in-portal:system',
+ 'icon' => 'conf_general',
+ 'label' => 'la_tab_General',
+ 'url' => Array('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+
+ // "Tools" section
+ 'in-portal:tools' => Array(
+ 'parent' => 'in-portal:root',
+ 'icon' => 'tools',
+ 'label' => 'la_tab_Tools',
+ 'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 6,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:backup' => Array(
+ 'parent' => 'in-portal:tools',
+ 'icon' => 'tool_backup',
+ 'label' => 'la_tab_Backup',
+ 'url' => Array('index_file' => 'backup/backup1.php', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:restore' => Array(
+ 'parent' => 'in-portal:tools',
+ 'icon' => 'tool_restore',
+ 'label' => 'la_tab_Restore',
+ 'url' => Array('index_file' => 'backup/restore1.php', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 2,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:export' => Array(
+ 'parent' => 'in-portal:tools',
+ 'icon' => 'tool_export',
+ 'label' => 'la_tab_ExportData',
+ 'url' => Array('index_file' => 'backup/export1.php', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 3,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:main_import' => Array(
+ 'parent' => 'in-portal:tools',
+ 'icon' => 'tool_import',
+ 'label' => 'la_tab_ImportData',
+ 'url' => Array('index_file' => 'import/step1.php', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 4,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:sql_query' => Array(
+ 'parent' => 'in-portal:tools',
+ 'icon' => 'tool_import',
+ 'label' => 'la_tab_QueryDB',
+ 'url' => Array('index_file' => 'tools/sql_query.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 5,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:server_info' => Array(
+ 'parent' => 'in-portal:tools',
+ 'icon' => 'server_info',
+ 'label' => 'la_tab_ServerInfo',
+ 'url' => Array('index_file' => 'tools/server_info.php', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 6,
+ 'type' => stTREE,
+ ),
+
+ // "Help" section
+ 'in-portal:help' => Array(
+ 'parent' => 'in-portal:root',
+ 'icon' => 'help',
+ 'label' => 'la_tab_Help',
+ 'url' => Array('index_file' => 'help/manual.pdf', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 7,
+ 'type' => stTREE,
+ ),
+ ),
+
+ );
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.12.2/core/units/admin/admin_config.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.12
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.12.2/core/units/general/main_event_handler.php
===================================================================
--- branches/unlabeled/unlabeled-1.12.2/core/units/general/main_event_handler.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.12.2/core/units/general/main_event_handler.php (revision 4941)
@@ -0,0 +1,124 @@
+<?php
+
+ class MainEventHandler extends kEventHandler {
+
+
+ /**
+ * Description
+ *
+ * @var kDBConnection
+ * @access public
+ */
+ var $Conn;
+
+ /**
+ * Adds ability to address db connection
+ *
+ * @return kDBEventHandler
+ * @access public
+ */
+ function MainEventHandler()
+ {
+ parent::kBase();
+ $this->Conn =& $this->Application->GetADODBConnection();
+ }
+
+ /**
+ * Created url part for this module
+ *
+ * @param kEvent $event
+ */
+ function BuildEnv(&$event)
+ {
+ $prefix_special = $event->getPrefixSpecial();
+ $url_params = $event->getEventParam('url_params');
+
+ $query_vars = $this->Application->getUnitOption($event->Prefix, 'QueryString');
+
+ //if pass events is off and event is not implicity passed
+ if ( !$event->getEventParam('pass_events') && !isset($url_params[$prefix_special.'_event']) )
+ {
+ $url_params[$prefix_special.'_event'] = ''; // remove event from url if requested
+ //otherwise it will use value from get_var
+ }
+
+ if(!$query_vars) return true;
+
+ $processed_params = Array();
+ foreach($query_vars as $index => $var_name)
+ {
+ //if value passed in params use it, otherwise use current from application
+ $var_name = $prefix_special.'_'.$var_name;
+ $processed_params[$var_name] = isset( $url_params[$var_name] ) ? $url_params[$var_name] : $this->Application->GetVar($var_name);
+ if ( isset($url_params[$var_name]) ) unset( $url_params[$var_name] );
+ }
+
+ $ret = '';
+ $default_language_id = $this->Application->GetDefaultLanguageId();
+ if( $processed_params['m_lang'] != $default_language_id )
+ {
+ $language_name = $this->Application->getCache('language_names', $processed_params['m_lang']);
+ if ($language_name === false) {
+ $sql = 'SELECT PackName
+ FROM '.TABLE_PREFIX.'Language
+ WHERE LanguageId = '.$processed_params['m_lang'];
+ $language_name = $this->Conn->GetOne($sql);
+ $this->Application->setCache('language_names', $processed_params['m_lang'], $language_name);
+ }
+ $ret .= $language_name.'/';
+ }
+
+ $default_theme_id = $this->Application->GetDefaultThemeId();
+ if( $processed_params['m_theme'] != $default_theme_id )
+ {
+ $theme_name = $this->Application->getCache('theme_names', $processed_params['m_theme']);
+ if ($theme_name === false) {
+ $sql = 'SELECT Name
+ FROM '.TABLE_PREFIX.'Theme
+ WHERE ThemeId = '.$processed_params['m_theme'];
+ $theme_name = $this->Conn->GetOne($sql);
+ $this->Application->setCache('theme_names', $processed_params['m_theme'], $theme_name);
+
+ }
+ $ret .= $theme_name.'/';
+ }
+
+ if ($processed_params['m_cat_id'] > 0) {
+ $ret .= $this->Application->getFilename('c', $processed_params['m_cat_id']).'/';
+ }
+
+ $force_page_adding = false;
+ if (getArrayValue($url_params, 'reset'))
+ {
+ unset($url_params['reset']);
+ if ($processed_params['m_cat_id'])
+ {
+ $processed_params['m_cat_page'] = 1;
+ $force_page_adding = true;
+ }
+ }
+
+ if( $processed_params['m_cat_page'] > 1 || $force_page_adding )
+ {
+ $ret = preg_replace('/(.*)\//', '\\1', $ret).'_'.$processed_params['m_cat_page'].'/';
+ }
+
+ $template = getArrayValue($url_params, 't');
+ $category_template = $processed_params['m_cat_id'] ? $this->Application->getCache('category_templates', $processed_params['m_cat_id']) : '';
+
+ // remove template from url if it is category index cached template
+ if ($template == $category_template || strtolower($template) == '__default__') {
+ $template = '';
+ }
+
+ if ($template) {
+ $ret .= $template.'/';
+ }
+ unset($url_params['t']);
+
+ $event->setEventParam('url_params', $url_params);
+ $event->setEventParam('env_string', strtolower($ret) );
+ }
+ }
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.12.2/core/units/general/main_event_handler.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.12
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.12.2/admin/include/tabs.js
===================================================================
--- branches/unlabeled/unlabeled-1.12.2/admin/include/tabs.js (nonexistent)
+++ branches/unlabeled/unlabeled-1.12.2/admin/include/tabs.js (revision 4941)
@@ -0,0 +1,285 @@
+//parses input tags looking for validation attributes
+
+function DataIsValid(f)
+{
+ var ValType = '';
+ var span_id = '';
+ var form_result = true;
+ var field_result = true;
+ var j = 0;
+
+ for (var i = 0; i < f.elements.length; i++)
+ {
+ ValType = '';
+ Field = f.elements[i];
+ ValType = Field.getAttribute('ValidationType');
+ if(ValType)
+ {
+ ValType = TransformValidationType(ValType); // for capability with old forms
+ span_id = 'prompt_' + Field.name;
+ span = document.getElementById(span_id);
+ if(span)
+ {
+ field_result = true;
+ ValType = ValType.split(',');
+
+ j = 0;
+ while(j < ValType.length)
+ {
+ //alert('Validating ['+Field.name+'] as ['+ValType[j]+']');
+ if(ValType[j] == 'password')
+ {
+ var repasswd = document.getElementById(Field.name + '_verify');
+ if(repasswd)
+ {
+ field_result &= ValidateField(Field.value, ValType[j], repasswd.value);
+ document.getElementById('prompt_' + Field.name + '_verify').className = field_result ? 'text' : 'validation_error';
+ }
+ }
+ else
+ field_result &= ValidateField(Field.value, ValType[j]);
+ j++;
+ }
+ span.className = field_result ? 'text' : 'validation_error';
+ form_result &= field_result;
+ }
+ }
+ }
+ return form_result;
+}
+
+function TransformValidationType(OldType)
+{
+ // replace old validation types with new
+ // on the fly in case if we have some forms
+ // that still use old validation types
+
+ var NewType = '';
+ switch(OldType)
+ {
+ case 'optional_date':
+ NewType = 'date';
+ break;
+ default:
+ NewType = OldType;
+ break;
+ }
+ return NewType;
+}
+
+function ValidateField(FieldValue, ValidateAs, RePasswdValue)
+{
+ // validate FieldValue based on ValidateAs rule specified;
+ // in case if password field compare it with RePasswdValue
+ var result = true;
+ switch(ValidateAs)
+ {
+ case 'exists': // field is required
+ if(FieldValue.length == 0) result = false;
+ break;
+
+ case 'integer': // field must be integer number
+ result = ValidateNumber(FieldValue, ValidateAs);
+ break;
+
+ case 'password': // validate as password field
+ result = (FieldValue == RePasswdValue) || (FieldValue.length == 0);
+ break;
+
+ case 'date': // text must be a formatted date
+ result = ValidDate(FieldValue);
+ break;
+
+ case 'time': // text must be a formatted time
+ result = ValidTime(FieldValue);
+ break;
+ case 'custom_name':
+ result = ValidCustomName(FieldValue);
+ break;
+ case 'theme_name':
+ result = ValidThemeName(FieldValue);
+ break;
+ }
+ return result;
+}
+
+function MarkAsRequired(f)
+{
+ var ValType = '';
+ var span_id = '';
+ var result = true;
+
+ for (var i = 0; i < f.elements.length; i++)
+ {
+ ValType = '';
+ Field = f.elements[i];
+ ValType = Field.getAttribute('ValidationType');
+ if(ValType)
+ {
+ ValType = ValType.split(',');
+ if( InArray(ValType,'exists') !== false )
+ {
+ span_id = 'prompt_' + Field.name;
+ span = document.getElementById(span_id);
+ span.innerHTML = span.innerHTML + '<span class="error">*</span>';
+ }
+ }
+ }
+}
+
+function InArray(aArray, aValue)
+{
+ // checks if element in array
+ var k = 0;
+ while(k < aArray.length)
+ {
+ if(aArray[k] == aValue) return k;
+ k++;
+ }
+ return false;
+}
+
+//Used to submit the form when a tab is clicked on
+function edit_submit(formname, status_field, targetURL, save_value, env_str, new_target)
+{
+ var full_env = env;
+ if( HasParam(env_str) ) full_env += env_str;
+
+ if(full_env.substr(0,3) != "env") full_env = 'env=' + full_env;
+ f = document.getElementById(formname);
+
+ if(f)
+ {
+ var valid = false;
+ if(save_value != 2 && save_value !=-1)
+ {
+ valid = DataIsValid(f);
+ }
+ else
+ {
+ var a = f.Action;
+ if(a)
+ {
+ a.value='';
+ }
+ }
+ if(valid || save_value==2 || save_value==-1)
+ {
+ var URLPrefix = '';
+ if( targetURL.substring(0, rootURL.length) != rootURL ) URLPrefix = rootURL;
+
+ f.action = URLPrefix + targetURL;
+ if( !f.action.match('(.*)?env=(.*)') ) f.action += '?' + full_env;
+
+ if(status_field.length > 0)
+ {
+ f.elements[status_field].value = save_value; //0= stay in temp, 1=save to perm, 2 = purge no save
+ }
+
+ if(new_target != null && typeof(new_target) != 'undefined') f.target = new_target;
+ f.submit();
+ }
+ else
+ if(!valid) alert(ErrorMsg);
+ }
+ else
+ {
+ alert('Form '+formname+' was not found.');
+ }
+}
+
+//Used when the save or cancel buttin is hit
+function do_edit_save(formname, status_field, targetURL, save_value, env_str)
+{
+ var full_env = env;
+ if( HasParam(env_str) ) full_env += env_str;
+ if(full_env.substr(0,3)!="env")
+ full_env = 'env='+full_env;
+
+ f = document.getElementById(formname);
+ if(f)
+ {
+ f.action = rootURL + targetURL;
+
+ if( !f.action.match('(.*)?env=(.*)') ) f.action += '?' + full_env;
+
+ //alert(f.action);
+ if(status_field.length>0)
+ {
+ f.elements[status_field].value = save_value; //0= stay in temp, 1=save to perm, 2 = purge no save
+ }
+ f.submit();
+ }
+ else
+ alert('Form '+formname+' was not found.');
+}
+
+function jump_to_url(targetURL, env_str)
+{
+ var full_env = env;
+ if( HasParam(env_str) ) full_env += env_str;
+
+ if(full_env.substr(0,3)!="env")
+ full_env = 'env='+full_env;
+
+ document.location = rootURL + targetURL + '?' + full_env;
+}
+// -------------------------------------------------------------------------------------------------------------
+function submit_form(formname, status_field, targetURL, save_value, env_str)
+{
+ // by Alex, submits form.
+
+ var full_env = env;
+ if( HasParam(env_str) ) full_env += env_str;
+ if(full_env.substr(0,3)!="env")
+ full_env = 'env='+full_env;
+
+
+ f = document.getElementById(formname);
+
+ if(f)
+ {
+ var valid = false;
+ if(save_value != 2 && save_value !=-1)
+ {
+ valid = DataIsValid(f);
+ }
+ else
+ {
+ var a = f.Action;
+ if(a)
+ {
+ a.value='';
+ }
+ }
+ if(valid || save_value==2 || save_value==-1)
+ {
+ f.action = rootURL + targetURL + '?' + full_env;
+ if(status_field.length>0)
+ {
+ f.elements[status_field].value = save_value; //0= stay in temp, 1=save to perm, 2 = purge no save
+ }
+
+ f.submit();
+ }
+ else
+ if(!valid)
+ alert(ErrorMsg);
+
+ }
+ else
+ alert('Form '+formname+' was not found.');
+}
+
+function HasParam(param)
+{
+ // checks of parameter is passed to function (cross-browser)
+ return typeof(param) == 'undefined' ? false : true;
+}
+
+function SetBackground(element_id, img_url)
+{
+ // set background image of element specified by id
+ var el = document.getElementById(element_id);
+ el.style.backgroundImage = 'url('+img_url+')';
+}
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.12.2/admin/include/tabs.js
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.12
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.12.2/admin/reviews.php
===================================================================
--- branches/unlabeled/unlabeled-1.12.2/admin/reviews.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.12.2/admin/reviews.php (revision 4941)
@@ -0,0 +1,311 @@
+<?php
+##############################################################
+##In-portal ##
+##############################################################
+## In-portal ##
+## Intechnic Corporation ##
+## All Rights Reserved, 1998-2002 ##
+## ##
+## No portion of this code may be copied, reproduced or ##
+## otherwise redistributed without proper written ##
+## consent of Intechnic Corporation. Violation will ##
+## result in revocation of the license and support ##
+## privileges along maximum prosecution allowed by law. ##
+##############################################################
+
+function k4getmicrotime()
+{
+ list($usec, $sec) = explode(" ", microtime());
+ return ((float)$usec + (float)$sec);
+}
+
+$start = k4getmicrotime();
+
+// new startup: begin
+define('REL_PATH', 'admin');
+$relation_level = count( explode('/', REL_PATH) );
+define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
+require_once FULL_PATH.'/kernel/startup.php';
+// new startup: end
+
+define('REQUIRE_LAYER_HEADER', 1);
+$b_topmargin = "0";
+//$b_header_addon = "<DIV style='position:relative; z-Index: 1; background-color: #ffffff; padding-top:1px;'><div style='position:absolute; width:100%;top:0px;' align='right'><img src='images/logo_bg.gif'></div><img src='images/spacer.gif' width=1 height=15><br><div style='z-Index:1; position:relative'>";
+
+require_login();
+
+$indexURL = $rootURL."index.php";
+$homeURL = "javascript:AdminCatNav('".$_SERVER["PHP_SELF"]."?env=".BuildEnv()."');";
+
+$m_var_list_update["cat"] = 0;
+unset($m_var_list_update["cat"]);
+
+//admin only util
+
+$pathtolocal = $pathtoroot."kernel/";
+require_once ($pathtoroot.$admin."/include/elements.php");
+//require_once ($pathtoroot."kernel/admin/include/navmenu.php");
+require_once ($pathtolocal."admin/include/navmenu.php");
+require_once($pathtoroot.$admin."/browse/toolbar.php");
+
+$mod_prefixes = Array();
+$m = GetModuleArray();
+foreach($m as $key=>$value)
+{
+ $path = $pathtoroot.$value."admin/include/parser.php";
+ if(file_exists($path))
+ {
+ //echo "<!-- $path -->";
+ $mod_prefixes[] = $key;
+ @include_once($path);
+ }
+}
+
+$application->InitParser();
+
+$cat_templates = $objModules->ExecuteFunction('GetModuleInfo', 'reviews_template');
+foreach ($cat_templates as $a_mod => $a_template) {
+ if (!$a_template) continue;
+ $a_var = $a_mod.'_TAB_HTML';
+ $$a_var = $application->ParseBlock(Array('name'=>$a_template), 0, true);
+}
+
+if( !defined('IS_INSTALL') ) define('IS_INSTALL', 0);
+if( !IS_INSTALL ) require_login();
+
+//Set Section
+$section = 'in-portal:reviews';
+
+//Set Environment Variable
+
+// save last category visited
+$objSession->SetVariable('prev_category', $objSession->GetVariable('last_category') );
+$objSession->SetVariable('last_category', $objCatList->CurrentCategoryID() );
+
+$objSession->SetVariable("HasChanges", 0);
+// where should all edit popups submit changes
+$objSession->SetVariable("ReturnScript", basename($_SERVER['PHP_SELF']) );
+
+
+// common "Advanced View" tab php functions: begin
+function GetAdvView_SearchWord($prefix,$postfix='_adv_view_search')
+{
+ global $objSession;
+ return $objSession->GetVariable($prefix.$postfix);
+}
+
+function SaveAdvView_SearchWord($prefix,$postfix='_adv_view_search')
+{
+ global $objSession;
+ $SearchWord = $objSession->GetVariable($prefix.$postfix);
+ if( isset($_REQUEST['SearchWord']) )
+ {
+ $SearchWord = $_REQUEST['SearchWord'];
+ $objSession->SetVariable($prefix.$postfix, $SearchWord);
+ }
+}
+
+function ResetAdvView_SearchWord($prefix,$postfix='_adv_view_search')
+{
+ global $objSession;
+ $objSession->SetVariable($prefix.$postfix, '');
+}
+
+function ShowSearchForm($prefix, $envar, $TabID, $postfix='_adv_view_search')
+{
+ global $imagesURL;
+ $btn_prefix = $imagesURL.'/toolbar/icon16_search';
+ $SearchWord = GetAdvView_SearchWord($prefix,$postfix);
+ echo '<form method="post" action="'.$_SERVER["PHP_SELF"].'?'.$envar.'" name="'.$prefix.'_adv_view_search" id="'.$prefix.$postfix.'">
+ <input type="hidden" name="Action" value="">
+ <table cellspacing="0" cellpadding="0">
+ <tr>
+ <td>'.admin_language('la_SearchLabel').'&nbsp;</td>
+ <td><input id="'.$prefix.'_SearchWord" type="text" value="'.inp_htmlize($SearchWord,1).'" name="SearchWord" size="10" style="border-width: 1; border-style: solid; border-color: 999999"></td>
+ <td>
+ <img
+ id="'.$TabID.'_imgSearch"
+ src="'.$btn_prefix.'.gif"
+ title="'.admin_language("la_ToolTip_Search").'"
+ align="absMiddle"
+ onclick="SubmitSearch(\''.$prefix.$postfix.'\',\''.$prefix.$postfix.'\');"
+ onmouseover="this.src=\''.$btn_prefix.'_f2.gif\'"
+ onmouseout="this.src=\''.$btn_prefix.'.gif\'"
+ style="cursor:hand"
+ width="22"
+ height="22"
+ >
+ <img
+ id="imgSearchReset"
+ src="'.$btn_prefix.'_reset.gif"
+ title="'.admin_language("la_ToolTip_Search").'"
+ align="absMiddle"
+ onclick="SubmitSearch(\''.$prefix.$postfix.'\',\''.$prefix.$postfix.'_reset\');"
+ onmouseover="this.src=\''.$btn_prefix.'_reset_f2.gif\'"
+ onmouseout="this.src=\''.$btn_prefix.'_reset.gif\'"
+ style="cursor:hand"
+ width="22"
+ height="22"
+ >&nbsp;
+
+
+ </td>
+ </tr>
+ </table>
+ </form>
+ <script language="javascript">
+ document.getElementById("'.$prefix.'_SearchWord").onkeydown = getKey;
+ </script>
+
+ ';
+}
+// common "Advanced View" tab php functions: end
+
+/* page header */
+$charset = GetRegionalOption('Charset');
+print <<<END
+<html>
+<head>
+ <title>In-portal</title>
+ <meta http-equiv="content-type" content="text/html;charset=$charset">
+ <meta http-equiv="Pragma" content="no-cache">
+ <script language="JavaScript">
+ imagesPath='$imagesURL'+'/';
+ </script>
+
+END;
+
+ require_once($pathtoroot.$admin."/include/mainscript.php");
+
+print <<<END
+<script type="text/javascript">
+ if (window.opener != null) {
+ theMainScript.CloseAndRefreshParent();
+ }
+</script>
+END;
+
+print <<<END
+ <script src="$browseURL/toolbar.js"></script>
+ <script src="$browseURL/checkboxes_new.js"></script>
+ <script language="JavaScript1.2" src="$browseURL/fw_menu.js"></script>
+ <link rel="stylesheet" type="text/css" href="$browseURL/checkboxes.css">
+ <link rel="stylesheet" type="text/css" href="$cssURL/style.css">
+ <link rel="stylesheet" type="text/css" href="$browseURL/toolbar.css">
+END;
+load_module_styles();
+if( !isset($list) ) $list = '';
+
+int_SectionHeader();
+
+ $filter = false;
+ $bit_combo = $objModules->ExecuteFunction('GetModuleInfo', 'all_bitmask');
+ $bit_combo = $objModules->MergeReturn($bit_combo);
+ foreach($bit_combo['VarName'] as $mod_name => $VarName)
+ {
+ //echo "VarName: [$VarName] = [".$objConfig->Get($VarName)."], ALL = [".$bit_combo['Bits'][$mod_name]."]<br>";
+ if( $objConfig->Get($VarName) )
+ if( $objConfig->Get($VarName) != $bit_combo['Bits'][$mod_name] )
+ {
+ $filter = true;
+ break;
+ }
+ }
+
+?>
+</div>
+<!-- alex mark -->
+<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
+ <tbody>
+ <tr>
+ <td>
+ <div name="toolBar" id="mainToolBar">
+ <tb:button action="edit" title="<?php echo admin_language("la_ToolTip_Edit"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
+ <tb:button action="delete" title="<?php echo admin_language("la_ToolTip_Delete"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
+ <tb:separator ImagePath="<?php echo $imagesURL."/toolbar/";?>">
+ <tb:button action="approve" title="<?php echo admin_language("la_ToolTip_Approve"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
+ <tb:button action="decline" title="<?php echo admin_language("la_ToolTip_Decline"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
+ <tb:separator ImagePath="<?php echo $imagesURL."/toolbar/";?>">
+ <tb:button action="print" title="<?php echo admin_language("la_ToolTip_Print"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
+ <tb:button action="view" title="<?php echo admin_language("la_ToolTip_View"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+
+<?php if ($filter) { ?>
+<table width="100%" border="0" cellspacing="0" cellpadding="0" class="toolbar">
+ <tr>
+ <td valign="top">
+ <?php int_hint_red(admin_language("la_Warning_Filter")); ?>
+ </td>
+ </tr>
+</table>
+<?php } ?>
+<br>
+ <!-- CATEGORY DIVIDER -->
+
+</DIV>
+</div>
+<DIV style="background-color: #ffffff; position: relative; padding-top: 1px; top: -1px; z-Index:0" id="firstContainer">
+ <DIV style="background-color: #ffffff; position: relative; padding-top: 1px; top: -1px; z-Index:2" id="secondContainer">
+
+
+
+ <?php
+
+ print $ItemTabs->TabRow();
+
+ if(count($ItemTabs->Tabs))
+ {
+ ?>
+ <div class="divider" id="tabsDevider"><img width=1 height=1 src="images/spacer.gif"></div>
+ <?php
+ }
+ ?>
+ </DIV>
+
+ <?php
+ unset($m);
+ $m = GetModuleArray("admin");
+
+
+ foreach($m as $key=>$value)
+ {
+ $path = $pathtoroot.$value."admin/reviews.php";
+ //echo "Including File: $path<br>";
+ if(file_exists($path))
+ {
+ //echo "\n<!-- $path -->\n";
+ include_once($path);
+ }
+ }
+ $admin = $objConfig->Get("AdminDirectory");
+ if(!strlen($admin)) $admin = "admin";
+ ?>
+ <form method="post" action="<?php echo $rootURL.$admin; ?>/reviews.php?env=<?php echo BuildEnv(); ?>" name="viewmenu">
+ <input type="hidden" name="fieldname" value="">
+ <input type="hidden" name="varvalue" value="">
+ <input type="hidden" name="varvalue2" value="">
+ <input type="hidden" name="Action" value="">
+ </form>
+</DIV>
+<!-- END CODE-->
+<script language="JavaScript">
+ InitPage();
+ if(default_tab.length == 0)
+ {
+ cookie_start = theMainScript.GetCookie('active_tab');
+ if (cookie_start != null) start_tab = cookie_start;
+ if(start_tab!=null) toggleTabB(start_tab, true);
+ }
+ else
+ {
+ toggleTabB(default_tab,true);
+ }
+</script>
+<?php
+ $objSession->SetVariable("HasChanges", 0);
+ int_footer();
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.12.2/admin/reviews.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.12
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property

Event Timeline