Ejemplo n.º 1
0
 function DOCMAN_Category($id)
 {
     $this->objDBTable =& mosDMCategory::getInstance($id);
     $this->_format($this->objDBTable);
 }
Ejemplo n.º 2
0
 function categoryParentList($id, $action, $options = array())
 {
     global $_DOCMAN;
     $database = JFactory::getDBO();
     require_once $_DOCMAN->getPath('classes', 'utils');
     $list = DOCMAN_utils::categoryArray();
     // using getInstance for performance
     // $cat = new mosDMCategory($database);
     // $cat->load($id);
     $cat =& mosDMCategory::getInstance($id);
     $this_treename = '';
     foreach ($list as $item) {
         if ($this_treename) {
             if ($item->id != $cat->id && strpos($item->treename, $this_treename) === false) {
                 $options[] = JHTML::_('select.option', $item->id, $item->treename);
             }
         } else {
             if ($item->id != $cat->id) {
                 $options[] = JHTML::_('select.option', $item->id, $item->treename);
             } else {
                 $this_treename = "{$item->treename}/";
             }
         }
     }
     $parent = JHTML::_('select.genericlist', $options, 'parent_id', 'class="inputbox" size="1"', 'value', 'text', $cat->parent_id);
     return $parent;
 }
Ejemplo n.º 3
0
 /**
  * @desc 	Transform the document to a object if necessary
  * @param 	mixed	object or numeric $category
  * @access  	private
  * @return 	object 	a document object
  */
 function isCategory(&$category)
 {
     $database = JFactory::getDBO();
     // check to see if we have a object
     if (!is_a($category, 'mosDMCategory')) {
         // try to create a category db object
         if (is_object($category)) {
             $id = (int) @$category->id;
         } else {
             $id = (int) $category;
         }
         $category =& mosDMCategory::getInstance($id);
     }
     return $category;
 }