AAAAhome/academiac/www/administrator/components/com_unitehcarousel/models/item.php000060400000005216151372306720024104 0ustar00loadForm('com_unitehcarousel.item', 'item', array('control' => 'jform', 'load_data' => $loadData)); if (empty($form)) { return false; } /* not implemented yet // Modify the form based on access controls. if (!$this->canEditState((object) $data)) { // Disable fields for display. $form->setFieldAttribute('ordering', 'disabled', 'true'); $form->setFieldAttribute('published', 'disabled', 'true'); // Disable fields while saving. // The controller has already verified this is a record you can edit. $form->setFieldAttribute('ordering', 'filter', 'unset'); $form->setFieldAttribute('published', 'filter', 'unset'); }*/ return $form; } protected function populateState(){ $table = $this->getTable(); $key = $table->getKeyName(); $pk = JRequest::getInt($key); //dmp($_REQUEST);exit(); return(parent::populateState()); } protected function loadFormData() { // Check the session for previously entered form data. $data = JFactory::getApplication()->getUserState('com_unitehcarousel.edit.item.data', array()); if (empty($data)) { $data = $this->getItem(); } return $data; } protected function prepareTableReal(&$table) { jimport('joomla.filter.output'); $date = JFactory::getDate(); $user = JFactory::getUser(); $table->title = htmlspecialchars_decode($table->title, ENT_QUOTES); $table->alias = JApplication::stringURLSafe($table->alias); if (empty($table->alias)) { $table->alias = JApplication::stringURLSafe($table->title); } if (empty($table->id)) { // Set ordering to the last item if not set if (empty($table->ordering)) { $db = JFactory::getDbo(); $db->setQuery('SELECT MAX(ordering) FROM #__unitehcarousel_slides'); $max = $db->loadResult(); $table->ordering = $max+1; } } } protected function getReorderConditions($table) { $condition = array(); return $condition; } } home/academiac/www/administrator/components/com_unitehcarousel/tables/item.php000060400000002323151372370200024061 0ustar00loadArray($array['params']); $array['params'] = (string)$registry; } if(empty($array['alias'])) { $array['alias'] = $array['title']; } $array['alias'] = JFilterOutput::stringURLSafe($array['alias']); if(trim(str_replace('-','',$array['alias'])) == '') { $array['alias'] = JFactory::getDate()->format("Y-m-d-H-i-s"); } //dmp($array);exit(); return parent::bind($array, $ignore); } //public function delete($pk=null){ /* dmp($_REQUEST); MaxFunctionsAdmin::showTrace("delete item"); dmp("items delete"); exit(); */ //parent::delete($pk); //} }