Example #1
0
 function bind($array, $ignore = '')
 {
     if (key_exists('plugins', $array) && is_array($array['plugins'])) {
         $registry = new JRegistry();
         $registry->loadArray($array['plugins']);
         $array['plugins'] = $registry->toString();
     }
     return parent::bind($array, $ignore);
 }
Example #2
0
 function bind($array, $ignore = '')
 {
     if (key_exists('params', $array) && is_array($array['params'])) {
         $registry = new JRegistry();
         $registry->loadArray($array['params']);
         if (JRequest::getVar('categories') == 'all' || JRequest::getVar('categories') == 'none') {
             $registry->set('categories', JRequest::getVar('categories'));
         }
         $array['permissions'] = $registry->toString();
     }
     return parent::bind($array, $ignore);
 }
Example #3
0
 function __construct(&$db)
 {
     parent::__construct('#__k2_extra_fields', 'id', $db);
 }
Example #4
0
 function __construct(&$db)
 {
     parent::__construct('#__k2_tags', 'id', $db);
 }
Example #5
0
 function __construct(&$db)
 {
     parent::__construct('#__k2_attachments', 'id', $db);
 }
 public function __construct($db)
 {
     parent::__construct('#__k2_extra_fields_groups', 'id', $db);
 }
Example #7
0
 /**
  * Method to get a table object, load it if necessary.
  *
  * @param   string  $name     The table name. Optional.
  * @param   string  $prefix   The class prefix. Optional.
  * @param   array   $options  Configuration array for model. Optional.
  *
  * @return  JTable  A JTable object
  */
 public function getTable($name = '', $prefix = 'K2Table', $options = array())
 {
     require_once JPATH_ADMINISTRATOR . '/components/com_k2/tables/table.php';
     K2Table::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_k2/tables');
     return parent::getTable($name, $prefix, $options);
 }
Example #8
0
 /**
  * Method to bind an associative array or object to the JTable instance.This
  * method only binds properties that are publicly accessible and optionally
  * takes an array of properties to ignore when binding.
  *
  * @param   mixed  $src     An associative array or object to bind to the JTable instance.
  * @param   mixed  $ignore  An optional array or space separated list of properties to ignore while binding.
  *
  * @return  boolean  True on success.
  *
  * @link    http://docs.joomla.org/JTable/bind
  * @since   11.1
  * @throws  InvalidArgumentException
  */
 public function bind($src, $ignore = array())
 {
     if (is_object($src)) {
         $src = get_object_vars($src);
     }
     if (isset($src['text'])) {
         $pattern = '#<hr\\s+id=("|\')system-readmore("|\')\\s*\\/*>#i';
         $tagPos = preg_match($pattern, $src['text']);
         if ($tagPos == 0) {
             $this->introtext = $src['text'];
             $this->fulltext = '';
         } else {
             list($this->introtext, $this->fulltext) = preg_split($pattern, $src['text'], 2);
         }
     }
     if (isset($src['metadata']) && is_array($src['metadata'])) {
         $registry = new JRegistry();
         $registry->loadArray($src['metadata']);
         $src['metadata'] = $registry->toString();
     }
     if (isset($src['params']) && is_array($src['params'])) {
         $registry = new JRegistry();
         $registry->loadArray($src['params']);
         $src['params'] = $registry->toString();
     }
     if (isset($src['plugins']) && is_array($src['plugins'])) {
         $registry = new JRegistry();
         $registry->loadArray($src['plugins']);
         $src['plugins'] = $registry->toString();
     }
     if (isset($src['rules']) && is_array($src['rules'])) {
         $rules = array();
         foreach ((array) $src['rules'] as $action => $ids) {
             $rules[$action] = array();
             foreach ($ids as $id => $p) {
                 if ($p !== '') {
                     $rules[$action][$id] = $p == '1' || $p == 'true' ? true : false;
                 }
             }
         }
         $this->setRules(new JAccessRules($rules));
     }
     return parent::bind($src, $ignore);
 }
Example #9
0
 /**
  * Method to bind an associative array or object to the JTable instance.This
  * method only binds properties that are publicly accessible and optionally
  * takes an array of properties to ignore when binding.
  *
  * @param   mixed  $src     An associative array or object to bind to the JTable instance.
  * @param   mixed  $ignore  An optional array or space separated list of properties to ignore while binding.
  *
  * @return  boolean  True on success.
  *
  * @link    http://docs.joomla.org/JTable/bind
  * @since   11.1
  * @throws  InvalidArgumentException
  */
 public function bind($src, $ignore = array())
 {
     if (is_object($src)) {
         $src = get_object_vars($src);
     }
     if (isset($src['value']) && is_array($src['value'])) {
         $registry = new JRegistry();
         $registry->loadArray($src['value']);
         $src['value'] = $registry->toString();
     }
     return parent::bind($src, $ignore);
 }
Example #10
0
 public function __construct($db)
 {
     parent::__construct('#__k2_comments', 'id', $db);
 }
Example #11
0
 public function __construct($db)
 {
     parent::__construct('#__k2_revisions', 'id', $db);
 }