Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1168580
in-portal
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Sep 24, 9:42 PM
Size
27 KB
Mime Type
text/x-diff
Expires
Fri, Sep 26, 9:42 PM (1 d, 5 h)
Engine
blob
Format
Raw Data
Handle
755326
Attached To
rINP In-Portal
in-portal
View Options
Index: branches/unlabeled/unlabeled-1.14.2/kernel/units/categories/categories_tag_processor.php
===================================================================
--- branches/unlabeled/unlabeled-1.14.2/kernel/units/categories/categories_tag_processor.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.14.2/kernel/units/categories/categories_tag_processor.php (revision 4246)
@@ -0,0 +1,294 @@
+<?php
+
+class CategoriesTagProcessor extends kDBTagProcessor {
+
+ function &GetList($params)
+ {
+ $special = $this->BuildListSpecial($params);
+
+ $prefix_special = $this->Prefix.'.'.$special;
+ $this->Special = $special;
+
+ $params['skip_counting'] = true;
+
+ $list =& $this->Application->recallObject( $prefix_special, $this->Prefix.'_List',$params);
+
+// $list->clearFilters();
+// $list->addFilter('parent_filter', 'ParentId = '.$parent_cat_id, WHERE_FILTER, FLT_SYSTEM);
+
+ //unset($params['skip_counting']);
+// $this->Application->HandleEvent($event, $prefix_special.':SetPagination', $params );
+
+ $list->Query();
+ return $list;
+ }
+
+ function SubCatCount($params)
+ {
+ $cat_object =& $this->Application->recallObject($this->getPrefixSpecial(),$this->Prefix, $params);
+ $sql = ' SELECT COUNT(*) - 1
+ FROM '.$cat_object->TableName.'
+ WHERE ParentPath LIKE "'.$cat_object->GetDBField('ParentPath').'%"';
+ return $this->Conn->GetOne($sql);
+ }
+
+ function IsNew($params)
+ {
+ $object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix, $params);
+ $ret = $object->GetDBField('IsNew') ? 1 : 0;
+ return $ret;
+ }
+
+ function IsPick($params)
+ {
+ $object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix, $params);
+ $ret = $object->GetDBField('EditorsPick') ? 1 : 0;
+ return $ret;
+ }
+
+ function ItemIcon($params)
+ {
+ $object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix, $params);
+ $status = $object->GetDBField('Status');
+ if($status == 1)
+ {
+ $ret = $object->GetDBField('IsNew') ? 'icon16_cat_new.gif' : 'icon16_cat.gif';
+ }
+ else
+ {
+ $ret = $status ? 'icon16_cat_pending.gif' : 'icon16_cat_disabled.gif';
+ }
+ return $ret;
+ }
+
+ function ItemCount($params)
+ {
+ $cat_object =& $this->Application->recallObject($this->getPrefixSpecial(),$this->Prefix, $params);
+ $ci_table = $this->Application->getUnitOption('ci','TableName');
+
+ $sql = ' SELECT COUNT(*)
+ FROM '.$cat_object->TableName.' c
+ LEFT JOIN '.$ci_table.' ci
+ ON c.CategoryId=ci.CategoryId
+ WHERE c.ParentPath LIKE "'.$cat_object->GetDBField('ParentPath').'%"
+ AND NOT (ci.CategoryId IS NULL)';
+ return $this->Conn->GetOne($sql);
+ }
+
+ function ListCategories($params)
+ {
+ return $this->PrintList2($params);
+ }
+
+ function RootCategoryName($params)
+ {
+ $root_phrase = $this->Application->ConfigValue('Root_Name');
+ $ret = $this->Application->Phrase($root_phrase);
+ return $ret;
+ }
+
+ function CheckModuleRoot($params)
+ {
+ $module_name = getArrayValue($params, 'module') ? $params['module'] : 'In-Commerce';
+ $module =& $this->Application->recallObject('mod.'.$module_name);
+ $module_root_cat = $module->GetDBField('RootCat');
+
+ $additional_cats = $this->SelectParam($params, 'add_cats');
+ if ($additional_cats) {
+ $additional_cats = explode(',', $additional_cats);
+ }
+ else {
+ $additional_cats = array();
+ }
+
+ if ($this->Application->GetVar('m_cat_id') == $module_root_cat || in_array($this->Application->GetVar('m_cat_id'), $additional_cats)) {
+ $home_template = getArrayValue($params, 'home_template');
+ if (!$home_template) return;
+ $this->Application->Redirect($home_template, Array('pass'=>'all'));
+ };
+ }
+
+ function CategoryPath($params)
+ {
+ $module_name = getArrayValue($params, 'module') ? $params['module'] : 'In-Commerce';
+ $module =& $this->Application->recallObject('mod.'.$module_name);
+ $module_root_cat = $module->GetDBField('RootCat');
+
+ $block_params['current'] = 0;
+ $block_params['separator'] = $params['separator'];
+
+ if(!isset($params['cat_id']))
+ {
+ $params['cat_id'] = getArrayValue($params, 'cat_id') ? $params['cat_id'] : $this->Application->GetVar('m_cat_id');
+ $block_params['current'] = 1;
+ }
+ $product_id = $this->Application->GetVar('p_id');
+ if ($product_id) {
+ $block_params['current'] = 0;
+ }
+
+ $block_params['is_module_root'] = ($params['cat_id'] == $module_root_cat) ? 1 : 0;
+
+ if($params['cat_id'] == 0)
+ {
+ $block_params['name'] = $this->SelectParam($params, 'root_cat_render_as,block_root_cat,rootcatblock');
+ return $this->Application->ParseBlock($block_params);
+ }
+ else
+ {
+ $block_params['name'] = $this->SelectParam($params,'render_as,block');
+
+ // $cat_object = &$this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix.'_List' );
+ $sql = 'SELECT CategoryId, ParentId, Name FROM '.$this->Application->getUnitOption($this->Prefix, 'TableName').'
+ WHERE CategoryId='.$params['cat_id'];
+ $res = $this->Conn->GetRow($sql);
+ if ($res === false) {
+ // in case if category is deleted
+ return '';
+ }
+
+ $block_params['cat_name'] = $res['Name'];
+ $block_params['cat_id'] = $res['CategoryId'];
+
+ $parent_params = $params;
+ $parent_params['cat_id'] = $res['ParentId'];
+
+ // which block to parse as current ?
+ if ($block_params['is_module_root'] == 1) { // module root
+ $block_params['name'] = $this->SelectParam($params, 'module_root_render_as,block_module_root,rootmoduleblock');
+ }
+ if ($block_params['current'] == 1) { // current cat (label)
+ $block_params['name'] = $this->SelectParam($params, 'current_render_as,block_current,currentblock');
+ }
+
+ $this->Application->SetVar($this->Prefix.'_id', $res['CategoryId']);
+ $current_cat = $this->Application->ParseBlock($block_params, 1);
+
+ $this->Application->SetVar($this->Prefix.'_id', $res['ParentId']);
+ $parent_cat = $this->CategoryPath($parent_params);
+
+ return $parent_cat.$current_cat;
+ }
+ }
+
+ function CurrentCategoryName($params){
+
+ $cat_object = &$this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix.'_List' );
+ $cat_id = $this->Application->GetVar("m_cat_id");
+ $sql = 'SELECT Name FROM '.$cat_object->TableName.' WHERE CategoryId='.$cat_id;
+ return $this->Conn->GetOne($sql);
+
+ }
+
+ function InitMainPrefix($params)
+ {
+ if($main_prefix = $this->Application->GetVar('main_prefix'))
+ {
+ $this->Application->StoreVar('selector_main_prefix', $main_prefix);
+ }
+
+ }
+
+ function CategoryLink($params)
+ {
+ // 'p_id'=>'0', ??
+ $params = array_merge(array('pass'=>'m'), $params);
+ $cat_id = getArrayValue($params,'cat_id');
+ if ($cat_id === false) {
+// $cat_id = $this->Application->Parser->GetParam('cat_id');
+ $cat_id = $this->Application->GetVar($this->Prefix.'_id');
+ }
+ if($cat_id == 'Root')
+ {
+ $object =& $this->Application->recallObject('mod.'.$params['module']);
+ $params['m_cat_id'] = $object->GetDBField('RootCat');
+ unset($params['module']);
+ }
+ else{
+ $params['m_cat_id'] = $cat_id;
+ }
+ unset($params['cat_id']);
+
+ $main_processor =& $this->Application->recallObject('m_TagProcessor');
+ return $main_processor->T($params);
+ }
+
+ function CategoryList($params)
+ {
+ //$object =& $this->Application->recallObject( $this->getPrefixSpecial() , $this->Prefix.'_List', $params );
+ $object =& $this->GetList($params);
+
+
+ if ($object->RecordsCount == 0)
+ {
+ if (isset($params['block_no_cats'])) {
+ $params['name'] = $params['block_no_cats'];
+ return $this->Application->ParseBlock($params);
+ }
+ else {
+ return '';
+ }
+ }
+
+ if(isset($params['block']))
+ {
+ return $this->PrintList($params);
+ }
+ else
+ {
+ $params['block'] = $params['block_main'];
+ $params['row_start_block'] = $params['block_row_start'];
+ $params['row_end_block'] = $params['block_row_end'];
+ return $this->PrintList2($params);
+ }
+ }
+
+ function Meta($params)
+ {
+ $name = getArrayValue($params, 'name');
+ $object =& $this->Application->recallObject($this->Prefix.'.-item');
+
+ $field = $object->GetField('Meta'.$name);
+ if ($field) return $field;
+
+ switch ($name) {
+ case 'Description':
+ $conf = 'Category_MetaDesc';
+ break;
+ case 'Keywords':
+ $conf = 'Category_MetaKey';
+ break;
+ }
+
+ return $this->Application->ConfigValue($conf);
+ }
+
+ function BuildListSpecial($params)
+ {
+ if ( isset($params['parent_cat_id']) ) {
+ $parent_cat_id = $params['parent_cat_id'];
+ }
+ else {
+ $parent_cat_id = $this->Application->GetVar($this->Prefix.'_id');
+ if (!$parent_cat_id) {
+ $parent_cat_id = $this->Application->GetVar('m_cat_id');
+ }
+ if (!$parent_cat_id) {
+ $parent_cat_id = 0;
+ }
+ }
+
+ $types = $this->SelectParam($params, 'types');
+ $except = $this->SelectParam($params, 'except');
+
+ if ($types.$except.$parent_cat_id == '') {
+ return parent::BuildListSpecial($params);
+ }
+
+ $special = crc32($types.$except.$parent_cat_id);
+ return $special;
+ }
+}
+
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.14.2/kernel/units/categories/categories_tag_processor.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.14
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.14.2/core/units/categories/categories_tag_processor.php
===================================================================
--- branches/unlabeled/unlabeled-1.14.2/core/units/categories/categories_tag_processor.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.14.2/core/units/categories/categories_tag_processor.php (revision 4246)
@@ -0,0 +1,294 @@
+<?php
+
+class CategoriesTagProcessor extends kDBTagProcessor {
+
+ function &GetList($params)
+ {
+ $special = $this->BuildListSpecial($params);
+
+ $prefix_special = $this->Prefix.'.'.$special;
+ $this->Special = $special;
+
+ $params['skip_counting'] = true;
+
+ $list =& $this->Application->recallObject( $prefix_special, $this->Prefix.'_List',$params);
+
+// $list->clearFilters();
+// $list->addFilter('parent_filter', 'ParentId = '.$parent_cat_id, WHERE_FILTER, FLT_SYSTEM);
+
+ //unset($params['skip_counting']);
+// $this->Application->HandleEvent($event, $prefix_special.':SetPagination', $params );
+
+ $list->Query();
+ return $list;
+ }
+
+ function SubCatCount($params)
+ {
+ $cat_object =& $this->Application->recallObject($this->getPrefixSpecial(),$this->Prefix, $params);
+ $sql = ' SELECT COUNT(*) - 1
+ FROM '.$cat_object->TableName.'
+ WHERE ParentPath LIKE "'.$cat_object->GetDBField('ParentPath').'%"';
+ return $this->Conn->GetOne($sql);
+ }
+
+ function IsNew($params)
+ {
+ $object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix, $params);
+ $ret = $object->GetDBField('IsNew') ? 1 : 0;
+ return $ret;
+ }
+
+ function IsPick($params)
+ {
+ $object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix, $params);
+ $ret = $object->GetDBField('EditorsPick') ? 1 : 0;
+ return $ret;
+ }
+
+ function ItemIcon($params)
+ {
+ $object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix, $params);
+ $status = $object->GetDBField('Status');
+ if($status == 1)
+ {
+ $ret = $object->GetDBField('IsNew') ? 'icon16_cat_new.gif' : 'icon16_cat.gif';
+ }
+ else
+ {
+ $ret = $status ? 'icon16_cat_pending.gif' : 'icon16_cat_disabled.gif';
+ }
+ return $ret;
+ }
+
+ function ItemCount($params)
+ {
+ $cat_object =& $this->Application->recallObject($this->getPrefixSpecial(),$this->Prefix, $params);
+ $ci_table = $this->Application->getUnitOption('ci','TableName');
+
+ $sql = ' SELECT COUNT(*)
+ FROM '.$cat_object->TableName.' c
+ LEFT JOIN '.$ci_table.' ci
+ ON c.CategoryId=ci.CategoryId
+ WHERE c.ParentPath LIKE "'.$cat_object->GetDBField('ParentPath').'%"
+ AND NOT (ci.CategoryId IS NULL)';
+ return $this->Conn->GetOne($sql);
+ }
+
+ function ListCategories($params)
+ {
+ return $this->PrintList2($params);
+ }
+
+ function RootCategoryName($params)
+ {
+ $root_phrase = $this->Application->ConfigValue('Root_Name');
+ $ret = $this->Application->Phrase($root_phrase);
+ return $ret;
+ }
+
+ function CheckModuleRoot($params)
+ {
+ $module_name = getArrayValue($params, 'module') ? $params['module'] : 'In-Commerce';
+ $module =& $this->Application->recallObject('mod.'.$module_name);
+ $module_root_cat = $module->GetDBField('RootCat');
+
+ $additional_cats = $this->SelectParam($params, 'add_cats');
+ if ($additional_cats) {
+ $additional_cats = explode(',', $additional_cats);
+ }
+ else {
+ $additional_cats = array();
+ }
+
+ if ($this->Application->GetVar('m_cat_id') == $module_root_cat || in_array($this->Application->GetVar('m_cat_id'), $additional_cats)) {
+ $home_template = getArrayValue($params, 'home_template');
+ if (!$home_template) return;
+ $this->Application->Redirect($home_template, Array('pass'=>'all'));
+ };
+ }
+
+ function CategoryPath($params)
+ {
+ $module_name = getArrayValue($params, 'module') ? $params['module'] : 'In-Commerce';
+ $module =& $this->Application->recallObject('mod.'.$module_name);
+ $module_root_cat = $module->GetDBField('RootCat');
+
+ $block_params['current'] = 0;
+ $block_params['separator'] = $params['separator'];
+
+ if(!isset($params['cat_id']))
+ {
+ $params['cat_id'] = getArrayValue($params, 'cat_id') ? $params['cat_id'] : $this->Application->GetVar('m_cat_id');
+ $block_params['current'] = 1;
+ }
+ $product_id = $this->Application->GetVar('p_id');
+ if ($product_id) {
+ $block_params['current'] = 0;
+ }
+
+ $block_params['is_module_root'] = ($params['cat_id'] == $module_root_cat) ? 1 : 0;
+
+ if($params['cat_id'] == 0)
+ {
+ $block_params['name'] = $this->SelectParam($params, 'root_cat_render_as,block_root_cat,rootcatblock');
+ return $this->Application->ParseBlock($block_params);
+ }
+ else
+ {
+ $block_params['name'] = $this->SelectParam($params,'render_as,block');
+
+ // $cat_object = &$this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix.'_List' );
+ $sql = 'SELECT CategoryId, ParentId, Name FROM '.$this->Application->getUnitOption($this->Prefix, 'TableName').'
+ WHERE CategoryId='.$params['cat_id'];
+ $res = $this->Conn->GetRow($sql);
+ if ($res === false) {
+ // in case if category is deleted
+ return '';
+ }
+
+ $block_params['cat_name'] = $res['Name'];
+ $block_params['cat_id'] = $res['CategoryId'];
+
+ $parent_params = $params;
+ $parent_params['cat_id'] = $res['ParentId'];
+
+ // which block to parse as current ?
+ if ($block_params['is_module_root'] == 1) { // module root
+ $block_params['name'] = $this->SelectParam($params, 'module_root_render_as,block_module_root,rootmoduleblock');
+ }
+ if ($block_params['current'] == 1) { // current cat (label)
+ $block_params['name'] = $this->SelectParam($params, 'current_render_as,block_current,currentblock');
+ }
+
+ $this->Application->SetVar($this->Prefix.'_id', $res['CategoryId']);
+ $current_cat = $this->Application->ParseBlock($block_params, 1);
+
+ $this->Application->SetVar($this->Prefix.'_id', $res['ParentId']);
+ $parent_cat = $this->CategoryPath($parent_params);
+
+ return $parent_cat.$current_cat;
+ }
+ }
+
+ function CurrentCategoryName($params){
+
+ $cat_object = &$this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix.'_List' );
+ $cat_id = $this->Application->GetVar("m_cat_id");
+ $sql = 'SELECT Name FROM '.$cat_object->TableName.' WHERE CategoryId='.$cat_id;
+ return $this->Conn->GetOne($sql);
+
+ }
+
+ function InitMainPrefix($params)
+ {
+ if($main_prefix = $this->Application->GetVar('main_prefix'))
+ {
+ $this->Application->StoreVar('selector_main_prefix', $main_prefix);
+ }
+
+ }
+
+ function CategoryLink($params)
+ {
+ // 'p_id'=>'0', ??
+ $params = array_merge(array('pass'=>'m'), $params);
+ $cat_id = getArrayValue($params,'cat_id');
+ if ($cat_id === false) {
+// $cat_id = $this->Application->Parser->GetParam('cat_id');
+ $cat_id = $this->Application->GetVar($this->Prefix.'_id');
+ }
+ if($cat_id == 'Root')
+ {
+ $object =& $this->Application->recallObject('mod.'.$params['module']);
+ $params['m_cat_id'] = $object->GetDBField('RootCat');
+ unset($params['module']);
+ }
+ else{
+ $params['m_cat_id'] = $cat_id;
+ }
+ unset($params['cat_id']);
+
+ $main_processor =& $this->Application->recallObject('m_TagProcessor');
+ return $main_processor->T($params);
+ }
+
+ function CategoryList($params)
+ {
+ //$object =& $this->Application->recallObject( $this->getPrefixSpecial() , $this->Prefix.'_List', $params );
+ $object =& $this->GetList($params);
+
+
+ if ($object->RecordsCount == 0)
+ {
+ if (isset($params['block_no_cats'])) {
+ $params['name'] = $params['block_no_cats'];
+ return $this->Application->ParseBlock($params);
+ }
+ else {
+ return '';
+ }
+ }
+
+ if(isset($params['block']))
+ {
+ return $this->PrintList($params);
+ }
+ else
+ {
+ $params['block'] = $params['block_main'];
+ $params['row_start_block'] = $params['block_row_start'];
+ $params['row_end_block'] = $params['block_row_end'];
+ return $this->PrintList2($params);
+ }
+ }
+
+ function Meta($params)
+ {
+ $name = getArrayValue($params, 'name');
+ $object =& $this->Application->recallObject($this->Prefix.'.-item');
+
+ $field = $object->GetField('Meta'.$name);
+ if ($field) return $field;
+
+ switch ($name) {
+ case 'Description':
+ $conf = 'Category_MetaDesc';
+ break;
+ case 'Keywords':
+ $conf = 'Category_MetaKey';
+ break;
+ }
+
+ return $this->Application->ConfigValue($conf);
+ }
+
+ function BuildListSpecial($params)
+ {
+ if ( isset($params['parent_cat_id']) ) {
+ $parent_cat_id = $params['parent_cat_id'];
+ }
+ else {
+ $parent_cat_id = $this->Application->GetVar($this->Prefix.'_id');
+ if (!$parent_cat_id) {
+ $parent_cat_id = $this->Application->GetVar('m_cat_id');
+ }
+ if (!$parent_cat_id) {
+ $parent_cat_id = 0;
+ }
+ }
+
+ $types = $this->SelectParam($params, 'types');
+ $except = $this->SelectParam($params, 'except');
+
+ if ($types.$except.$parent_cat_id == '') {
+ return parent::BuildListSpecial($params);
+ }
+
+ $special = crc32($types.$except.$parent_cat_id);
+ return $special;
+ }
+}
+
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.14.2/core/units/categories/categories_tag_processor.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.14
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.14.2/admin/category/addcategory_custom.php
===================================================================
--- branches/unlabeled/unlabeled-1.14.2/admin/category/addcategory_custom.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.14.2/admin/category/addcategory_custom.php (revision 4246)
@@ -0,0 +1,209 @@
+<?php
+##############################################################
+##In-portal ##
+##############################################################
+## In-portal ##
+## Intechnic Corporation ##
+## All Rights Reserved, 1998-2002 ##
+## ##
+## No portion of this code may be copied, reproduced or ##
+## otherwise redistributed without proper written ##
+## consent of Intechnic Corporation. Violation will ##
+## result in revocation of the license and support ##
+## privileges along maximum prosecution allowed by law. ##
+##############################################################
+
+// new startup: begin
+define('REL_PATH', 'admin/category');
+$relation_level = count( explode('/', REL_PATH) );
+define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
+require_once FULL_PATH.'/kernel/startup.php';
+// new startup: end
+
+
+require_once ($pathtoroot.$admin."/include/elements.php");
+require_once ($pathtoroot."kernel/admin/include/navmenu.php");
+//require_once ($pathtolocal."admin/include/navmenu.php");
+require_once($pathtoroot.$admin."/toolbar.php");
+require_once($pathtoroot.$admin."/listview/listview.php");
+
+$m = GetModuleArray();
+foreach($m as $key=>$value)
+
+{
+ $path = $pathtoroot. $value."admin/include/parser.php";
+ if(file_exists($path))
+ {
+ include_once($path);
+ }
+}
+unset($objEditItems);
+
+$application->SetVar('c_mode', 't');
+$objEditItems = new clsCatList();
+$objEditItems->SourceTable = $objSession->GetEditTable("Category");
+
+//Multiedit init
+$en = (int)$_GET["en"];
+$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable);
+$itemcount=$objEditItems->NumItems();
+
+$c = $objEditItems->GetItemByIndex($en);
+
+if($itemcount>1)
+{
+ if ($en+1 == $itemcount)
+ $en_next = -1;
+ else
+ $en_next = $en+1;
+
+ if ($en == 0)
+ $en_prev = -1;
+ else
+ $en_prev = $en-1;
+}
+$action = "m_edit_category";
+
+$envar = "env=" . BuildEnv() . "&en=$en";
+
+$section = 'in-portal:editcategory_custom';
+
+$title = admin_language("la_Text_Editing")." ".admin_language("la_Text_Category")." '".$c->Get("Name")."' - ".admin_language("la_tab_Custom");
+
+$formaction = $rootURL.$admin."/category/addcategory_custom.php?".$envar;
+
+//echo $envar."<br>\n";
+
+//Display header
+$sec = $objSections->GetSection($section);
+$objCatToolBar = new clsToolBar();
+
+$ListForm = "permlistform";
+$CheckClass = "PermChecks";
+$objCatToolBar->Set("CheckClass",$CheckClass);
+$objCatToolBar->Set("CheckForm",$ListForm);
+
+$saveURL = $admin."/category/category_maint.php";
+$cancelURL = $admin."/".$objSession->GetVariable('ReturnScript');
+$objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_edit_save('category','CatEditStatus','$saveURL',1);","tool_select.gif");
+$objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","do_edit_save('category','CatEditStatus','".$cancelURL."',2);","tool_cancel.gif");
+
+if ( isset($en_prev) || isset($en_next) )
+{
+ $url = $RootUrl.$admin."/category/addcategory_custom.php";
+ $StatusField = "CatEditStatus";
+ $form = "category";
+ MultiEditButtons($objCatToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick"),'','la_PrevCategory','la_NextCategory');
+}
+
+ int_header($objCatToolBar,NULL,$title);
+
+if ($objSession->GetVariable("HasChanges") == 1) {
+?>
+<table width="100%" border="0" cellspacing="0" cellpadding="0" class="toolbar">
+ <tr>
+ <td valign="top">
+ <?php int_hint_red(admin_language("la_Warning_Save_Item")); ?>
+ </td>
+ </tr>
+</table>
+<?php } ?>
+<form id="category" name="category" action="" method=POST>
+<?php
+
+ $objCustomFields = new clsCustomFieldList(1);
+
+ $objCustomDataList->SourceTable = $objSession->GetEditTable("CustomMetaData");
+ $objCustomDataList->LoadResource($c->Get("ResourceId"));
+
+ for($i=0;$i<$objCustomFields->NumItems(); $i++)
+ {
+ $field =& $objCustomFields->GetItemRefByIndex($i);
+ $fieldid = $field->Get("CustomFieldId");
+
+ $CF=$field->GetAdminUI();
+ if(is_object($cfield = $objCustomFields->GetItemByField("FieldName",substr($CF->name,1),FALSE))) {
+ $CF->default_value = $c->GetCustomFieldValue(substr($CF->name,1), '', 0, true);
+ }
+
+ $f = $objCustomDataList->GetDataItem($fieldid);
+ $fieldname = "CustomData[$fieldid]";
+
+ if(is_object($f))
+ {
+// $val_field = "<input type=\"text\" tabindex=\"".($i+1)."\" VALUE=\"".inp_htmlize($f->Get("Value"))."\" name=\"$fieldname\">";
+ $field->Set("Value", $CF->ItemFormElement());
+ if ($field->Get('Prompt') != '') {
+ $field->Set("FieldLabel", admin_language($field->Get('Prompt')));
+ }
+ else {
+ $field->Set("FieldLabel", admin_language('lu_fieldcustom__'.strtolower($field->Get('FieldName'))));
+ }
+ $field->Set("DataId",$f->Get("CustomDataId"));
+ }
+ else
+ {
+ $val_field = "<input type=text tabindex=\"".($i+1)."\" VALUE=\"\" name=\"$fieldname\">";
+ $field->Set("Value", $CF->ItemFormElement());
+ if ($field->Get('Prompt') != '') {
+ $field->Set("FieldLabel", admin_language($field->Get('Prompt')));
+ }
+ else {
+ $field->Set("FieldLabel", admin_language('lu_fieldcustom__'.strtolower($field->Get('FieldName'))));
+ }
+ $field->Set("DataId",0);
+ }
+ }
+ $objCustomFields->SortField = $objConfig->Get("CustomData_LV_Sortfield");;
+ $objCustomFields->SortItems($objConfig->Get("CustomData_LV_Sortorder")!="desc");
+
+ $objListView = new clsListView($objCatToolBar,$objCustomFields);
+ $objListView->IdField = "DataId";
+
+ $order = $objConfig->Get("CustomData_LV_Sortfield");
+ $SortOrder=0;
+ if($objConfig->Get("CustomData_LV_Sortorder")=="asc")
+ $SortOrder=1;
+
+ $objListView->ColumnHeaders->Add("FieldName",admin_language("la_ColHeader_FieldName"),1,0,$order,"width=\"30%\"","CustomData_LV_Sortfield","CustomData_LV_Sortorder","FieldName");
+ $objListView->ColumnHeaders->Add("FieldLabel",admin_language("la_ColHeader_FieldLabel"),1,0,$order,"width=\"30%\"","CustomData_LV_Sortfield","CustomData_LV_Sortorder","FieldLabel");
+ $objListView->ColumnHeaders->Add("Value",admin_language("la_ColHeader_Value"),1,0,$order,"width=\"40%\"","CustomData_LV_Sortfield","CustomData_LV_Sortorder","Value");
+
+ $objListView->ColumnHeaders->SetSort($objConfig->Get("CustomData_LV_Sortfield"), $objConfig->Get("CustomData_LV_Sortorder"));
+
+ $objListView->PrintToolBar = FALSE;
+ $objListView->checkboxes = FALSE;
+
+ $objListView->CurrentPageVar = "Page_CustomData";
+ $objListView->PerPageVar = "Perpage_CustomData";
+ //$objListView->CheckboxName = "itemlist[]";
+
+ for($i=0;$i<count($objCustomFields->Items);$i++)
+ {
+ $objListView->RowIcons[] = $imagesURL."/itemicons/icon16_custom.gif";
+ }
+ $objListView->PageLinks = $objListView->PrintPageLinks();
+
+ $objListView->SliceItems();
+ print $objListView->PrintList();
+?>
+ <input type="hidden" name="ItemId" value="<?php echo $c->Get("ResourceId"); ?>">
+ <input type="hidden" name="Action" value="m_edit_custom_data">
+ <input type="hidden" name="CatEditStatus" VALUE="0">
+ <input type="hidden" name="CustomType" VALUE="1">
+</FORM>
+
+
+<FORM id="save_edit" method="POST" NAME="save_edit" ID="save_edit">
+ <input type="hidden" name="CatEditStatus" VALUE="0">
+ <input type="hidden" name="CustomType" VALUE="1">
+</FORM>
+<!-- CODE FOR VIEW MENU -->
+<form ID="viewmenu" method="post" action="<?php echo $_SERVER["PHP_SELF"]."?".$envar; ?>" name="viewmenu">
+<input type="hidden" name="fieldname" value="">
+<input type="hidden" name="varvalue" value="">
+<input type="hidden" name="varvalue2" value="">
+<input type="hidden" name="Action" value="">
+</form>
+
+<?php int_footer(); ?>
Property changes on: branches/unlabeled/unlabeled-1.14.2/admin/category/addcategory_custom.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.14
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Event Timeline
Log In to Comment