phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: sitemgr/inc class.Admin_ManageCategories_UI.inc.


From: Patrick Walsh <address@hidden>
Subject: [Phpgroupware-cvs] CVS: sitemgr/inc class.Admin_ManageCategories_UI.inc.php,1.2,1.3 class.Categories_BO.inc.php,1.2,1.3 class.Categories_SO.inc.php,1.7,1.8 class.Category_SO.inc.php,1.3,1.4 class.Common_UI.inc.php,1.5,1.6 class.Pages_BO.inc.php,1.1.1.1,1.2 class.Pages_SO.inc.php,1.4,1.5 class.contributor_ManagePage_UI.inc.php,1.4,1.5
Date: Thu, 05 Sep 2002 05:06:06 -0400

Update of /cvsroot/phpgroupware/sitemgr/inc
In directory subversions:/tmp/cvs-serv13794

Modified Files:
        class.Admin_ManageCategories_UI.inc.php 
        class.Categories_BO.inc.php class.Categories_SO.inc.php 
        class.Category_SO.inc.php class.Common_UI.inc.php 
        class.Pages_BO.inc.php class.Pages_SO.inc.php 
        class.contributor_ManagePage_UI.inc.php 
Log Message:
Tons of goodies like drop down listboxes


Index: class.Admin_ManageCategories_UI.inc.php
===================================================================
RCS file: 
/cvsroot/phpgroupware/sitemgr/inc/class.Admin_ManageCategories_UI.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.Admin_ManageCategories_UI.inc.php     30 Aug 2002 09:45:25 -0000      
1.2
--- class.Admin_ManageCategories_UI.inc.php     5 Sep 2002 09:06:03 -0000       
1.3
***************
*** 34,38 ****
                {
                        global 
$btnSaveCategory,$btnAddCategory,$btnEditCategory,$btnDelete,$btnPermission;
!                       global 
$category_id,$catname,$catdesc,$catid,$sort_order;
                        global $groupaccessread, $groupaccesswrite, 
$individualaccessread, $individualaccesswrite;
  
--- 34,38 ----
                {
                        global 
$btnSaveCategory,$btnAddCategory,$btnEditCategory,$btnDelete,$btnPermission;
!                       global 
$category_id,$catname,$catdesc,$catid,$sort_order,$parent;
                        global $groupaccessread, $groupaccesswrite, 
$individualaccessread, $individualaccesswrite;
  
***************
*** 57,61 ****
                                else if($btnSaveCategory && ($catname == '' || 
$catdesc == ''))
                                {
!                                       
$this->_editCategory($catid,True,$catname,$catdesc,$sort_order);
                                }
                                else
--- 57,61 ----
                                else if($btnSaveCategory && ($catname == '' || 
$catdesc == ''))
                                {
!                                       
$this->_editCategory($catid,True,$catname,$catdesc,$sort_order, $parent);
                                }
                                else
***************
*** 73,77 ****
                                                $groupaccess = 
array_merge_recursive($groupaccessread, $groupaccesswrite);
                                                $individualaccess = 
array_merge_recursive($individualaccessread, $individualaccesswrite);
!                                               
$this->cat_bo->saveCategoryInfo($catid, $catname, $catdesc, $sort_order);
                                                
$this->cat_bo->saveCategoryPerms($catid, $groupaccess, $individualaccess);
                                        }
--- 73,77 ----
                                                $groupaccess = 
array_merge_recursive($groupaccessread, $groupaccesswrite);
                                                $individualaccess = 
array_merge_recursive($individualaccessread, $individualaccesswrite);
!                                               
$this->cat_bo->saveCategoryInfo($catid, $catname, $catdesc, $sort_order, 
$parent);
                                                
$this->cat_bo->saveCategoryPerms($catid, $groupaccess, $individualaccess);
                                        }
***************
*** 80,84 ****
                                        $this->t->set_file('ManageCategories', 
'manage_categories.tpl');
                                        $this->t->set_block('ManageCategories', 
'CategoryBlock', 'CBlock');
!                                       $this->cat_list = 
$this->cat_bo->getPermittedCategoryIDReadList();
                                        if($this->cat_list)
                                        {
--- 80,85 ----
                                        $this->t->set_file('ManageCategories', 
'manage_categories.tpl');
                                        $this->t->set_block('ManageCategories', 
'CategoryBlock', 'CBlock');
!                                       //$this->cat_list = 
$this->cat_bo->getPermittedCategoryIDReadList();
!                                       $this->cat_list = 
$this->cat_bo->getPermittedCatWriteNested();
                                        if($this->cat_list)
                                        {
***************
*** 86,89 ****
--- 87,101 ----
                                                {
                                                        $this->cat = 
$this->cat_bo->getCategory($this->cat_list[$i]);
+                                                       if ($this->cat->depth)
+                                                       {
+                                                               $buffer = '-';
+                                                       }
+                                                       else
+                                                       {
+                                                               $buffer = '';
+                                                       }
+                                                       $buffer = 
str_pad($buffer,$this->cat->depth*18,
+                                                               
'&nbsp;',STR_PAD_LEFT);
+                                                       
$this->t->set_var('buffer', $buffer);
                                                        
$this->t->set_var('category', $this->cat->name);
                                                        $category_id = 
$this->cat_list[$i];
***************
*** 120,124 ****
                                                '" method="POST">
                                                <input type=submit 
name=btnAddCategory value = "Add a category">
!                                               </form>');
                                        $this->t->pfp('out', 
'ManageCategories');       
                                }
--- 132,141 ----
                                                '" method="POST">
                                                <input type=submit 
name=btnAddCategory value = "Add a category">
!                                               </form>'
!                                       );
!                                       
$this->t->set_var('managepageslink',$GLOBALS['phpgw']->link(
!                                               '/index.php',
!                                               
'menuaction=sitemgr.contributor_ManagePage_UI._managePage')
!                                       );
                                        $this->t->pfp('out', 
'ManageCategories');       
                                }
***************
*** 136,140 ****
  
  
!               function 
_editCategory($cat_id,$error=False,$catname='',$catdesc='',$sort_order=0)
                {
                        $this->t->set_file('EditCategory', 'edit_category.tpl');
--- 153,157 ----
  
  
!               function 
_editCategory($cat_id,$error=False,$catname='',$catdesc='',$sort_order=0, 
$parent=0)
                {
                        $this->t->set_file('EditCategory', 'edit_category.tpl');
***************
*** 170,175 ****
                                'catdesc' => $this->cat->description,
                                'sort_order' => $this->cat->sort_order,
!                               'actionurl' =>
!                               
$GLOBALS['phpgw']->link('/index.php','menuaction=sitemgr.Admin_ManageCategories_UI._manageCategories')
                        ));
                        
--- 187,193 ----
                                'catdesc' => $this->cat->description,
                                'sort_order' => $this->cat->sort_order,
!                               'parent_dropdown' => 
$this->getParentOptions($this->cat->parent,$cat_id),
!                               'actionurl' => 
$GLOBALS['phpgw']->link('/index.php',
!                                       
'menuaction=sitemgr.Admin_ManageCategories_UI._manageCategories')
                        ));
                        
***************
*** 274,277 ****
--- 292,320 ----
  
                        $this->t->pfp('out','EditCategory');
+               }
+ 
+               function getParentOptions($selected_id=0,$skip_id=0)
+               {
+                       $option_list=$this->cat_bo->getCategoryOptionList();
+                       if (!(int) $selected_id)
+                       {
+                               $selected=' SELECTED';
+                       }
+                       $retval="\n".'<SELECT NAME="parent">'."\n";
+                       foreach($option_list as $option)
+                       {
+                               if ($option['value']!=$skip_id)
+                               {
+                                       $selected='';
+                                       if ($option['value']==$selected_id)
+                                       {
+                                               $selected=' SELECTED';
+                                       }
+                                       $retval.='<OPTION 
VALUE="'.$option['value'].'"'.$selected.'>'.
+                                               
$option['display'].'</OPTION>'."\n";
+                               }
+                       }
+                       $retval.='</SELECT>';
+                       return $retval;
                }
  

Index: class.Categories_BO.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/inc/class.Categories_BO.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.Categories_BO.inc.php 30 Aug 2002 09:45:25 -0000      1.2
--- class.Categories_BO.inc.php 5 Sep 2002 09:06:03 -0000       1.3
***************
*** 11,21 ****
                }
  
!               function getPermittedCategoryIDWriteList()
                {
!                       $full_list = $this->so->getFullcategoryIDList();
                        $permitted_list=array();
                        if (is_array($full_list))
                        {
-                               reset($full_list);
                                foreach($full_list as $item)
                                {
--- 11,93 ----
                }
  
!               function getCategoryOptionList()
                {
!                       $retval[] = array('value'=>0,'display'=>'[No Parent]');
!                       $list = $this->getPermittedCatWriteNested();
!                       foreach($list as $cat_id)
!                       {
!                               $cat = $this->getCategory($cat_id);
!                               $padding = str_pad('',12*$cat->depth,'&nbsp;');
!                               $retval[] = array('value'=>$cat->id, 
'display'=>$padding.$cat->name);
!                       }
!                       return $retval;
!               }
! 
!               function getPermittedCatReadNested($cat_id=0)
!               {
!                       return $this->getPermittedCatNested($cat_id,'read');
!               }
!               function getPermittedCatWriteNested($cat_id=0)
!               {
!                       return $this->getPermittedCatNested($cat_id,'write');
!               }
! 
!               // Don't call this function directly.  Use above funcs.
!               function getPermittedCatNested($cat_id=0,$check='')
!               {
!                       if (!$check)
!                       {
!                               // You should use the getPermittedCatReadNested 
and WriteNested funcs
!                               die("Whatcha doin callin this function, 
Willis?");
!                       }
! 
!                       $root_list = $this->so->getFullChildrenIDList($cat_id);
! 
!                       $permitted_list=array();
!                       if (is_array($root_list))
!                       {
!                               foreach($root_list as $root_cat)
!                               {
!                                       if ($check=='read')
!                                       {
!                                               $permitted = 
$this->acl->can_read_category($root_cat);
!                                       }
!                                       elseif ($check=='write')
!                                       {
!                                               $permitted = 
$this->acl->can_write_category($root_cat);
!                                       }
!                                       else
!                                       {
!                                               die("What'd I tell you about 
calling this function?");
!                                       }
! 
!                                       if ($permitted)
!                                       {
!                                               $permitted_list[]=$root_cat;
!                                               $sub_list = 
$this->getPermittedCatNested($root_cat,$check);
!                                               if (is_array($sub_list) && 
count($sub_list)>0)
!                                               {
!                                                       
//array_push($permitted_list, $sub_list);
!                                                       
$permitted_list=array_merge($permitted_list, $sub_list);
!                                               }
!                                       }
!                               }
!                       }
!                       return $permitted_list;
!               }
! 
!               function getPermittedCategoryIDWriteList($cat_id='')
!               {
!                       if (is_int($cat_id))
!                       {
!                               $full_list = 
$this->so->getChildrenIDList($cat_id);
!                       }
!                       else
!                       {
!                               $full_list = $this->so->getFullcategoryIDList();
!                       }
                        $permitted_list=array();
                        if (is_array($full_list))
                        {
                                foreach($full_list as $item)
                                {
***************
*** 29,35 ****
                }
  
!               function getPermittedCategoryIDReadList()
                {
!                       $full_list = $this->so->getFullcategoryIDList();
                        $permitted_list=array();
                        if (is_array($full_list))
--- 101,114 ----
                }
  
!               function getPermittedCategoryIDReadList($cat_id='')
                {
!                       if (is_int($cat_id))
!                       {
!                               $full_list = 
$this->so->getChildrenIDList($cat_id);
!                       }
!                       else
!                       {
!                               $full_list = $this->so->getFullcategoryIDList();
!                       }
                        $permitted_list=array();
                        if (is_array($full_list))
***************
*** 47,55 ****
                }
  
!               function addCategory($name, $description)               
                {
                        if ($this->acl->is_admin())
                        {
!                               return $this->so->addCategory($name, 
$description);
                        }
                        else
--- 126,134 ----
                }
  
!               function addCategory($name, $description, $parent=0)            
                {
                        if ($this->acl->is_admin())
                        {
!                               return $this->so->addCategory($name, 
$description, $parent);
                        }
                        else
***************
*** 76,80 ****
                }
  
!               function saveCategoryInfo($cat_id, $cat_name, $cat_description, 
$sort_order=0)
                {
                        $cat_info = CreateObject('sitemgr.Category_SO', True);
--- 155,159 ----
                }
  
!               function saveCategoryInfo($cat_id, $cat_name, $cat_description, 
$sort_order=0, $parent=0)
                {
                        $cat_info = CreateObject('sitemgr.Category_SO', True);
***************
*** 83,88 ****
                        $cat_info->description = $cat_description;
                        $cat_info->sort_order = $sort_order;
  
!                       if ($this->acl->can_read_category($cat_id))
                        {       
                                if($this->so->saveCategory($cat_info))
--- 162,168 ----
                        $cat_info->description = $cat_description;
                        $cat_info->sort_order = $sort_order;
+                       $cat_info->parent = $parent;
  
!                       if ($this->acl->can_write_category($cat_id))
                        {       
                                if($this->so->saveCategory($cat_info))

Index: class.Categories_SO.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/inc/class.Categories_SO.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** class.Categories_SO.inc.php 3 Sep 2002 02:37:44 -0000       1.7
--- class.Categories_SO.inc.php 5 Sep 2002 09:06:03 -0000       1.8
***************
*** 9,12 ****
--- 9,32 ----
                }
  
+               function getChildrenIDList($parent=0)
+               {
+                       if ($parent)
+                       {
+                               $cats = 
$this->cats->return_array('all','',False,'','','cat_data',False,$parent);
+                       }
+                       else
+                       {
+                               $cats = 
$this->cats->return_array('mains','',False,'','','cat_data',False, $parent);
+                       }
+                       while (is_array($cats) && list(,$subs) = each($cats))
+                       {
+                               if ($cats['parent']==$parent)
+                               {
+                                       $subs_id_list[] = $subs['id'];
+                               }
+                       }
+                       return $subs_id_list;
+               }
+ 
                function getFullChildrenIDList($parent = '')
                {
***************
*** 16,20 ****
                        }
  
!                       $cats = 
$this->cats->return_array('all','',False,'','','cat_data',False, $parent);
  
                        while (is_array($cats) && list(,$subs) = each($cats))
--- 36,47 ----
                        }
  
!                       if ($parent == 0)
!                       {
!                               $cats = 
$this->cats->return_array('mains','',False,'','','cat_data',False, $parent);
!                       }
!                       else
!                       {
!                               $cats = 
$this->cats->return_array('all','',False,'','','cat_data',False,$parent);
!                       }
  
                        while (is_array($cats) && list(,$subs) = each($cats))
***************
*** 62,65 ****
--- 89,93 ----
                                'descr'         => $cat_info->description,
                                'data'          => (int) $cat_info->sort_order,
+                               'access'        => 'public',
                                'id'            => $cat_info->id,
                                'parent'        => $cat_info->parent
***************
*** 81,84 ****
--- 109,114 ----
                                $cat_info->description  = 
$cat[0]['description'];
                                $cat_info->parent               = 
$cat[0]['parent'];
+                               $cat_info->depth                = 
$cat[0]['level'];
+                               $cat_info->root                 = 
$cat[0]['main'];
                                return $cat_info;
                        }

Index: class.Category_SO.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/inc/class.Category_SO.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.Category_SO.inc.php   3 Sep 2002 00:30:12 -0000       1.3
--- class.Category_SO.inc.php   5 Sep 2002 09:06:03 -0000       1.4
***************
*** 7,10 ****
--- 7,12 ----
                var $sort_order;
                var $parent;
+               var $depth;
+               var $root;
  
                function Category_SO()

Index: class.Common_UI.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/inc/class.Common_UI.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** class.Common_UI.inc.php     5 Sep 2002 06:54:50 -0000       1.5
--- class.Common_UI.inc.php     5 Sep 2002 09:06:03 -0000       1.6
***************
*** 12,19 ****
        class Common_UI
        {
!               var $t;
!               var $acl;
!               var $theme;
!               var $prefs_so;
                var $public_functions = array
                (
--- 12,16 ----
        class Common_UI
        {
!               var $t, $acl, $theme, $prefs_so, $pages_bo;
                var $public_functions = array
                (
***************
*** 27,30 ****
--- 24,28 ----
                        $this->theme = CreateObject('sitemgr.Theme_BO',True);
                        $this->prefs_so = 
CreateObject('sitemgr.sitePreference_SO', True);
+                       $this->pages_bo = CreateObject('sitemgr.Pages_BO');
                }
  
***************
*** 50,54 ****
                                        'title'=>'Default home page ID number',
                                        'note'=>'(This should be a page that is 
readable by everyone. If you leave this blank, the site index will be shown by 
default.)',
!                                       'input_size'=>10
                                );
                                $preferences['login-domain'] = array(
--- 48,53 ----
                                        'title'=>'Default home page ID number',
                                        'note'=>'(This should be a page that is 
readable by everyone. If you leave this blank, the site index will be shown by 
default.)',
!                                       'input'=>'option',
!                                       
'options'=>$this->pages_bo->getPageOptionList()
                                );
                                $preferences['login-domain'] = array(

Index: class.Pages_BO.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/inc/class.Pages_BO.inc.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** class.Pages_BO.inc.php      29 Aug 2002 03:03:17 -0000      1.1.1.1
--- class.Pages_BO.inc.php      5 Sep 2002 09:06:03 -0000       1.2
***************
*** 11,15 ****
                }
  
!               function getPageIDList($cat_id)
                {
                        if ($this->acl->can_read_category($cat_id))
--- 11,27 ----
                }
  
!               function getPageOptionList()
!               {
!                       $pagelist = $this->pageso->getPageIDList();
!                       $retval[]=array('value'=>'','display'=>'[Show Site 
Index]');
!                       foreach($pagelist as $page_id)
!                       {
!                               $page = $this->pageso->getPage($page_id);
!                               
$retval[]=array('value'=>$page_id,'display'=>$page->name);
!                       }
!                       return $retval;
!               }
! 
!               function getPageIDList($cat_id=0)
                {
                        if ($this->acl->can_read_category($cat_id))
***************
*** 65,70 ****
                }
  
!               function savePageInfo($cat_id, $page_Info)
                {
                        $fixed_name = strtr($page_Info->name, 
'address@hidden&*()-_=+   /?><,.\\\'":;|`~{}[]','                               
');
                        $fixed_name = str_replace(' ', '', $fixed_name);
--- 77,86 ----
                }
  
!               function savePageInfo($page_Info)
                {
+                       if (!$this->acl->can_write_category($page_Info->cat_id))
+                       {
+                               return 'You don\'t have permission to write to 
that category.';
+                       }
                        $fixed_name = strtr($page_Info->name, 
'address@hidden&*()-_=+   /?><,.\\\'":;|`~{}[]','                               
');
                        $fixed_name = str_replace(' ', '', $fixed_name);

Index: class.Pages_SO.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/inc/class.Pages_SO.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** class.Pages_SO.inc.php      3 Sep 2002 03:15:13 -0000       1.4
--- class.Pages_SO.inc.php      5 Sep 2002 09:06:03 -0000       1.5
***************
*** 9,15 ****
                }
  
!               function getPageIDList($cat_id)
                {
!                       $sql = 'SELECT page_id FROM phpgw_sitemgr_pages WHERE 
cat_id="' . $cat_id . '" ORDER BY sort_order';
                        $this->db->query($sql,__LINE__,__FILE__);
                        while ($this->db->next_record())
--- 9,22 ----
                }
  
!               function getPageIDList($cat_id=0)
                {
!                       if (!$cat_id)
!                       {
!                               $sql = 'SELECT page_id FROM phpgw_sitemgr_pages 
WHERE 1 ORDER BY cat_id, sort_order ASC';
!                       }
!                       else
!                       {
!                               $sql = 'SELECT page_id FROM phpgw_sitemgr_pages 
WHERE cat_id="' . $cat_id . '" ORDER BY sort_order';
!                       }
                        $this->db->query($sql,__LINE__,__FILE__);
                        while ($this->db->next_record())

Index: class.contributor_ManagePage_UI.inc.php
===================================================================
RCS file: 
/cvsroot/phpgroupware/sitemgr/inc/class.contributor_ManagePage_UI.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** class.contributor_ManagePage_UI.inc.php     4 Sep 2002 03:45:23 -0000       
1.4
--- class.contributor_ManagePage_UI.inc.php     5 Sep 2002 09:06:03 -0000       
1.5
***************
*** 51,54 ****
--- 51,55 ----
                        global $main;
                        global $sort_order;
+                       global $parent;
                        global $hidden;
                        global $btnEditPage;
***************
*** 75,78 ****
--- 76,80 ----
                                }
                                $this->t->set_var('add_edit','Edit Page');
+                               
$this->t->set_var('move_to',$this->getParentOptions($page->cat_id));
                        }
                        else
***************
*** 83,87 ****
--- 85,94 ----
                                $this->page->name = $name;
                                $this->page->sort_order = $sort_order;
+                               $this->page->cat_id = $category_id;
                                $this->t->set_var('add_edit','Add Page');
+                               $move_msg = 'Cannot move page until it has been 
saved.';
+                               $move_msg .= '<INPUT TYPE="hidden" 
name="parent" value="'.
+                                       $category_id.'">';
+                               $this->t->set_var('move_to',$move_msg);
                        }
                        
***************
*** 104,107 ****
--- 111,116 ----
                                'category_id' => $category_id
                        ));
+ 
+                       
                        
                        $this->t->set_var('actionurl', 
$GLOBALS['phpgw']->link('/index.php',
***************
*** 126,129 ****
--- 135,139 ----
                        global $category_id;
                        global $sort_order;
+                       global $parent;
                        global $title;
                        global $name;
***************
*** 164,169 ****
                                        $this->page->subtitle = $subtitle;
                                        $this->page->content = $main;
-                                       $this->page->cat_id = $category_id;
                                        $this->page->sort_order = $sort_order;
  
                                        if($hidden)
--- 174,179 ----
                                        $this->page->subtitle = $subtitle;
                                        $this->page->content = $main;
                                        $this->page->sort_order = $sort_order;
+                                       $this->page->cat_id = $parent;
  
                                        if($hidden)
***************
*** 175,179 ****
                                                $this->page->hidden = 0;
                                        }
!                                       $save_msg = 
$this->pagebo->savePageInfo($category_id, $this->page);
                                }
                                if (!is_string($save_msg))
--- 185,189 ----
                                                $this->page->hidden = 0;
                                        }
!                                       $save_msg = 
$this->pagebo->savePageInfo($this->page);
                                }
                                if (!is_string($save_msg))
***************
*** 230,234 ****
                                                                $this->page_id 
=$this->page_list[$j];
                                                                $this->page = 
$this->pagebo->getPage($this->page_id);
!                                                               
$page_description = 'Name: '.$this->page->name.'<br>Title: 
'.$this->page->title.'<br>ID: '.$this->page->id;
                                                                
$this->t->set_var('page', $page_description);
                                                                
$this->t->set_var('edit',
--- 240,244 ----
                                                                $this->page_id 
=$this->page_list[$j];
                                                                $this->page = 
$this->pagebo->getPage($this->page_id);
!                                                               
$page_description = '<b>Name: </b>'.$this->page->name.'<br><b>Title: 
</b>'.$this->page->title;
                                                                
$this->t->set_var('page', $page_description);
                                                                
$this->t->set_var('edit',
***************
*** 261,265 ****
                                                }
                                                $this->t->set_var('number', 
$i+1);
!                                               $this->t->set_var('category', 
$this->category->name); 
                                                $this->t->set_var('add', 
                                                        '<form action="'.
--- 271,275 ----
                                                }
                                                $this->t->set_var('number', 
$i+1);
!                                               $this->t->set_var('category', 
'<b>'.$this->category->name.'</b>'); 
                                                $this->t->set_var('add', 
                                                        '<form action="'.
***************
*** 281,284 ****
--- 291,319 ----
                        }
                        $common_ui->DisplayFooter();
+               }
+ 
+               function getParentOptions($selected_id=0)
+               {
+                       $option_list=$this->categorybo->getCategoryOptionList();
+                       if (!(int) $selected_id)
+                       {
+                               $selected=' SELECTED'; 
+                       }       
+                       $retval="\n".'<SELECT NAME="parent">'."\n";
+                       foreach($option_list as $option)
+                       {   
+                               if ((int) $option['value']!=0)
+                               {
+                                       $selected='';
+                                       if ($option['value']==$selected_id)
+                                       {
+                                               $selected=' SELECTED';
+                                       }
+                                       $retval.='<OPTION 
VALUE="'.$option['value'].'"'.$selected.'>'.
+                                       $option['display'].'</OPTION>'."\n";
+                               }
+                       }       
+                       $retval.='</SELECT>';
+                       return $retval;
                }
        }       





reply via email to

[Prev in Thread] Current Thread [Next in Thread]