Server IP : 180.180.241.3 / Your IP : 216.73.216.252 Web Server : Microsoft-IIS/7.5 System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586 User : IUSR ( 0) PHP Version : 5.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /AppServ/www/news/tmp/install_53214838987c8/site/models/ |
Upload File : |
<?php /*------------------------------------------------------------------------ # Timage # ------------------------------------------------------------------------ # author Trust Elegance # copyright Copyright (C) 2012 trustelegance.com. All Rights Reserved. # @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL # Websites: http://www.trustelegance.com # Technical Support: http://http://www.trustelegance.com/index.php?option=com_rsform&view=rsform&Itemid=55 -------------------------------------------------------------------------*/ defined('_JEXEC') or die('Restricted access'); jimport('joomla.application.component.modelform'); jimport('joomla.application.component.modelitem'); jimport('joomla.event.dispatcher'); class TimageModelUpdTimage extends JModelForm { protected $item; public function getForm($data = array(), $loadData = true) { $app = JFactory::getApplication('site'); $form = $this->loadForm('com_timage.updtimage', 'updtimage', array('control' => 'jform', 'load_data' => true)); if (empty($form)) { return false; } return $form; } function &getItem() { if (!isset($this->_item)) { $cache = JFactory::getCache('com_timage', ''); $id = $this->getState('timage.id'); $this->_item = $cache->get($id); if ($this->_item === false) { $menuitemid = JRequest::getInt( 'Itemid' ); $menu = JSite::getMenu(); if ($menuitemid) { $menuparams = $menu->getParams( $menuitemid ); $headingtxtcolor = $menuparams->get('headingtxtcolor'); $headingbgcolor = $menuparams->get('headingbgcolor'); } $this->setState('menuparams', $menuparams); } } return $this->_item; } public function updItem($data) { $id = $data['id']; $greeting = $data['greeting']; $db = $this->getDbo(); $query = $db->getQuery(true); $query->clear(); $query->update(' #__timage '); $query->set(' greeting = '.$db->Quote($greeting) ); $query->where(' id = ' . (int) $id ); $db->setQuery((string)$query); if (!$db->query()) { JError::raiseError(500, $db->getErrorMsg()); return false; } else { return true; } } } ?>