• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP JModelLegacy类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中JModelLegacy的典型用法代码示例。如果您正苦于以下问题:PHP JModelLegacy类的具体用法?PHP JModelLegacy怎么用?PHP JModelLegacy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了JModelLegacy类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: delete

 public function delete($pk = null)
 {
     // Get form model
     $formModel = JModelLegacy::getInstance('form', 'IssnregistryModel');
     if ($pk != null) {
         // Get number of forms related to this publisher
         $formsCount = $formModel->getFormsCountByPublisherId($pk);
         // Check result
         if ($formsCount != 0) {
             // If there are forms, the publisher can't be deleted
             JFactory::getApplication()->enqueueMessage(JText::_('COM_ISSNREGISTRY_PUBLISHER_DELETE_FAILED_FORMS_EXIST'), 'warning');
             // Return false as the item can't be deleted
             return false;
         }
         // Delete messages
         //$messageModel = JModelLegacy::getInstance('message', 'IssnregistryModel');
         //$messageModel->deleteByPublisherId($pk);
     }
     if (parent::delete($pk)) {
         // If this publisher was created based on a form, remove
         // publisher created attribute from the form
         if ($this->form_id != 0) {
             $formModel->removePublisherCreated($this->form_id);
         }
         // Get message model
         $messageModel = JModelLegacy::getInstance('message', 'IssnregistryModel');
         // Delete messages related to this publisher
         $messageModel->deleteByPublisherId($pk);
         // Return true
         return true;
     }
     return false;
 }
开发者ID:petkivim,项目名称:id-registry,代码行数:33,代码来源:publisher.php


示例2: passPHP

 function passPHP(&$parent, &$params, $selection = array(), $assignment = 'all', $article = 0)
 {
     if (!is_array($selection)) {
         $selection = array($selection);
     }
     $pass = 0;
     foreach ($selection as $php) {
         // replace \n with newline and other fix stuff
         $php = str_replace('\\|', '|', $php);
         $php = preg_replace('#(?<!\\\\)\\\\n#', "\n", $php);
         $php = trim(str_replace('[:REGEX_ENTER:]', '\\n', $php));
         if ($php == '') {
             $pass = 1;
             break;
         }
         if (!$article && strpos($php, '$article') !== false) {
             $article = '';
             if ($parent->params->option == 'com_content' && $parent->params->view == 'article') {
                 require_once JPATH_SITE . '/components/com_content/models/article.php';
                 $model = JModelLegacy::getInstance('article', 'contentModel');
                 $article = $model->getItem($parent->params->id);
             }
         }
         if (!isset($Itemid)) {
             $Itemid = JFactory::getApplication()->input->getInt('Itemid', 0);
         }
         if (!isset($mainframe)) {
             $mainframe = JFactory::getApplication();
         }
         if (!isset($app)) {
             $app = JFactory::getApplication();
         }
         if (!isset($document)) {
             $document = JFactory::getDocument();
         }
         if (!isset($doc)) {
             $doc = JFactory::getDocument();
         }
         if (!isset($database)) {
             $database = JFactory::getDBO();
         }
         if (!isset($db)) {
             $db = JFactory::getDBO();
         }
         if (!isset($user)) {
             $user = JFactory::getUser();
         }
         $php .= ';return true;';
         $temp_PHP_func = create_function('&$article, &$Itemid, &$mainframe, &$app, &$document, &$doc, &$database, &$db, &$user', $php);
         // evaluate the script
         ob_start();
         $pass = (bool) $temp_PHP_func($article, $Itemid, $mainframe, $app, $document, $doc, $database, $db, $user);
         unset($temp_PHP_func);
         ob_end_clean();
         if ($pass) {
             break;
         }
     }
     return $parent->pass($pass, $assignment);
 }
开发者ID:smart-one,项目名称:3kita,代码行数:60,代码来源:php.php


示例3: display

 /**
  * Display
  *
  * @param   string  $tmpl  Template
  *
  * @return  void
  */
 public function display($tmpl = 'default')
 {
     $srcs = FabrikHelperHTML::framework();
     $app = JFactory::getApplication();
     $input = $app->input;
     FabrikHelperHTML::script($srcs);
     $model = $this->getModel();
     $usersConfig = JComponentHelper::getParams('com_fabrik');
     $model->setId($input->getInt('id', $usersConfig->get('visualizationid', $input->getInt('visualizationid', 0))));
     $visualization = $model->getVisualization();
     $pluginParams = $model->getPluginParams();
     $pluginManager = JModelLegacy::getInstance('Pluginmanager', 'FabrikModel');
     $plugin = $pluginManager->getPlugIn($visualization->plugin, 'visualization');
     $plugin->_row = $visualization;
     if ($visualization->published == 0) {
         return JError::raiseWarning(500, FText::_('COM_FABRIK_SORRY_THIS_VISUALIZATION_IS_UNPUBLISHED'));
     }
     // Plugin is basically a model
     $pluginTask = $input->get('plugintask', 'render', 'request');
     // @FIXME cant set params directly like this, but I think plugin model setParams() is not right
     $plugin->_params = $pluginParams;
     $tmpl = $plugin->getParams()->get('calendar_layout', $tmpl);
     $plugin->{$pluginTask}($this);
     $this->plugin = $plugin;
     $viewName = $this->getName();
     $this->addTemplatePath($this->_basePath . '/plugins/' . $this->_name . '/' . $plugin->_name . '/tmpl/' . $tmpl);
     $root = $app->isAdmin() ? JPATH_ADMINISTRATOR : JPATH_SITE;
     $this->addTemplatePath($root . '/templates/' . $app->getTemplate() . '/html/com_fabrik/visualization/' . $plugin->_name . '/' . $tmpl);
     $ab_css_file = JPATH_SITE . '/plugins/fabrik_visualization/' . $plugin->_name . '/tmpl/' . $tmpl . '/template.css';
     if (JFile::exists($ab_css_file)) {
         JHTML::stylesheet('template.css', 'plugins/fabrik_visualization/' . $plugin->_name . '/tmpl/' . $tmpl . '/', true);
     }
     echo parent::display();
 }
开发者ID:ankaau,项目名称:GathBandhan,代码行数:41,代码来源:view.html.php


示例4: postSaveHook

 public function postSaveHook(JModelLegacy $model, $validData = array())
 {
     $item = $model->getItem();
     $sport_id = $item->get('id');
     $this->saveconfigs($sport_id);
     $this->setRedirect(JRoute::_('index.php?option=com_htraininglogs&view=cfgsport&layout=edit&id=' . $sport_id, false));
 }
开发者ID:hogeh,项目名称:htraininglogs2,代码行数:7,代码来源:cfgsport.php


示例5: postSaveHook

 public function postSaveHook(JModelLegacy $model, $validData = array())
 {
     $item = $model->getItem();
     $map_id = $item->get('id');
     $mapimage = $item->get('mapimage');
     $this->prepare_fileupload($map_id, $mapimage);
     //in case new HR file added
     $this->setRedirect(JRoute::_('index.php?option=com_htraininglogs&view=omap&layout=edit&id=' . $map_id, false));
 }
开发者ID:hogeh,项目名称:htraininglogs2,代码行数:9,代码来源:omap.php


示例6: postSaveHook

 public function postSaveHook(JModelLegacy $model, $validData = array())
 {
     $item = $model->getItem();
     $media_id = $item->get('id');
     $mediafile = JRequest::getVar('filename');
     $model->storeimage($mediafile, $media_id);
     $this->prepare_fileupload($media_id, $mediafile);
     //in case new m fedia file added
     //$this->setRedirect(JRoute::_('index.php?option=com_htraininglogs&view=media&layout=edit&id='.$media_id, false));
 }
开发者ID:hogeh,项目名称:htraininglogs2,代码行数:10,代码来源:media.php


示例7: postSaveHook

 public function postSaveHook(JModelLegacy $model, $validData = array())
 {
     $item = $model->getItem();
     $sub_id = $item->get('id');
     $sport_id = $item->get('sport_id');
     $this->saveomap();
     $split_id = $this->prepare_fileupload($sub_id, $sport_id);
     //in case new HR file added
     $this->setRedirect(JRoute::_('index.php?option=com_htraininglogs&view=session&layout=edit&sub_id=' . $sub_id . '&split_id=' . $split_id, false));
 }
开发者ID:hogeh,项目名称:htraininglogs2,代码行数:10,代码来源:session.php


示例8: postSaveHook

 protected function postSaveHook(JModelLegacy $model, $validData = array())
 {
     $item = $model->getItem();
     $id = $item->get('id');
     if ($id) {
         if ($validData['saveresult'] == 1) {
             //Create a new datatable if it doesn't allready exist
             if (!$model->createDataTables($id)) {
                 $this->setMessage($model->getError());
             }
         }
     }
 }
开发者ID:shamusdougan,项目名称:GDMCWebsite,代码行数:13,代码来源:visform.php


示例9: display

 /**
  * Display the Message templates view
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  void
  */
 function display($tpl = null)
 {
     // Get data from the model
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode('<br />', $errors));
         return false;
     }
     // Add menu helper file
     require_once JPATH_COMPONENT . '/helpers/menu.php';
     // Add sidebar
     MenuHelper::addSubmenu('messagetemplates');
     // Load message type model
     $model = JModelLegacy::getInstance('messagetype', 'IssnregistryModel');
     // Load message types
     $types = $model->getMessageTypesHash();
     // Pass $types to the layout
     $this->assignRef('types', $types);
     // Set the toolbar
     $this->addToolBar();
     // Render the sidebar
     $this->sidebar = JHtmlSidebar::render();
     // Display the template
     parent::display($tpl);
 }
开发者ID:petkivim,项目名称:id-registry,代码行数:34,代码来源:view.html.php


示例10: getInput

 /**
  * Method to get the field input markup.
  *
  * @return	string	The field input markup.
  * @since	1.6
  */
 protected function getInput()
 {
     $html = array();
     $recordId = (int) $this->form->getValue('id');
     $size = ($v = $this->element['size']) ? ' size="' . $v . '"' : '';
     $class = ($v = $this->element['class']) ? ' class="' . $v . '"' : 'class="text_area"';
     // Get a reverse lookup of the base link URL to Title
     $model = JModelLegacy::getInstance('menutypes', 'menusModel');
     $rlu = $model->getReverseLookup();
     switch ($this->value) {
         case 'url':
             $value = JText::_('COM_MENUS_TYPE_EXTERNAL_URL');
             break;
         case 'alias':
             $value = JText::_('COM_MENUS_TYPE_ALIAS');
             break;
         case 'separator':
             $value = JText::_('COM_MENUS_TYPE_SEPARATOR');
             break;
         default:
             $link = $this->form->getValue('link');
             // Clean the link back to the option, view and layout
             $value = JText::_(JArrayHelper::getValue($rlu, MenusHelper::getLinkKey($link)));
             break;
     }
     // Load the javascript and css
     JHtml::_('behavior.framework');
     JHtml::_('behavior.modal');
     $html[] = '<span class="input-append"><input type="text" readonly="readonly" disabled="disabled" value="' . $value . '"' . $size . $class . ' /><a class="btn btn-primary" onclick="SqueezeBox.fromElement(this, {handler:\'iframe\', size: {x: 600, y: 450}, url:\'' . JRoute::_('index.php?option=com_menus&view=menutypes&tmpl=component&recordId=' . $recordId) . '\'})"><i class="icon-list icon-white"></i> ' . JText::_('JSELECT') . '</a></span>';
     $html[] = '<input class="input-small" type="hidden" name="' . $this->name . '" value="' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '" />';
     return implode("\n", $html);
 }
开发者ID:RuDers,项目名称:JoomlaSQL,代码行数:38,代码来源:menutype.php


示例11: display

 function display($tpl = NULL)
 {
     /**
      * @var JSite $app
      */
     $app = JFactory::getApplication();
     $this->params = $app->getParams();
     /* Default Page fallback*/
     $active = $app->getMenu()->getActive();
     if (NULL == $active) {
         $this->params->merge($app->getMenu()->getDefault()->params);
         $active = $app->getMenu()->getDefault();
     }
     $this->currentItemid = $active->id;
     $entriesPerPage = $this->params->get('max_events_per_page', 12);
     $model = $this->getModel('events');
     $eventModel = JModelLegacy::getInstance('Event', 'EventgalleryModel');
     $recursive = $this->params->get('show_items_per_category_recursive', false);
     $user = JFactory::getUser();
     $usergroups = JUserHelper::getUserGroups($user->id);
     $entries = $model->getEntries(JRequest::getVar('start', 0), $entriesPerPage, $this->params->get('tags'), $this->params->get('sort_events_by'), $usergroups, $this->params->get('catid', null), $recursive);
     $this->pageNav = $model->getPagination();
     $this->entries = $entries;
     $this->eventModel = $eventModel;
     $this->_prepareDocument();
     parent::display($tpl);
 }
开发者ID:sansandeep143,项目名称:av,代码行数:27,代码来源:view.html.php


示例12: display

 /**
  * Called via ajax to perform viz ajax task (defined by plugintask method)
  *
  * @param   boolean  $cachable   If true, the view output will be cached
  * @param   array    $urlparams  An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
  *
  * @return  JController  A JController object to support chaining.
  */
 public function display($cachable = false, $urlparams = false)
 {
     $document = JFactory::getDocument();
     $app = JFactory::getApplication();
     $input = $app->input;
     $id = $input->getInt('visualizationid');
     $viz = FabTable::getInstance('Visualization', 'FabrikTable');
     $viz->load($id);
     $modelpaths = JModelLegacy::addIncludePath(JPATH_SITE . '/plugins/fabrik_visualization/' . $viz->plugin . '/models');
     $model = $this->getModel($viz->plugin);
     $model->setId($id);
     $pluginTask = $input->get('plugintask', '', 'request');
     if ($pluginTask !== '') {
         echo $model->{$pluginTask}();
     } else {
         $task = $input->get('task');
         $path = JPATH_SITE . '/plugins/fabrik_visualization/' . $viz->plugin . '/controllers/' . $viz->plugin . '.php';
         if (file_exists($path)) {
             require_once $path;
         } else {
             throw new RuntimeException('Could not load visualization: ' . $viz->plugin);
         }
         $controllerName = 'FabrikControllerVisualization' . $viz->plugin;
         $controller = new $controllerName();
         $controller->addViewPath(JPATH_SITE . '/plugins/fabrik_visualization/' . $viz->plugin . '/views');
         $controller->addViewPath(COM_FABRIK_FRONTEND . '/views');
         // Add the model path
         $modelpaths = JModelLegacy::addIncludePath(JPATH_SITE . '/plugins/fabrik_visualization/' . $viz->plugin . '/models');
         $modelpaths = JModelLegacy::addIncludePath(COM_FABRIK_FRONTEND . '/models');
         $origId = $input->getInt('visualizationid');
         $input->set('visualizationid', $id);
         $controller->{$task}();
     }
     return $this;
 }
开发者ID:ppantilla,项目名称:bbninja,代码行数:43,代码来源:visualization.raw.php


示例13: delete

 /**
  * Deletes a message type.
  *
  * @param   integer  $pk  Primary key of the message type to be deleted.
  *
  * @return  boolean  True on success, false on failure.
  *
  */
 public function delete($pk = null)
 {
     // Add configuration helper file
     require_once JPATH_COMPONENT . '/helpers/configuration.php';
     // If message type is defined as default in configuration, it cannot be removed
     if (ConfigurationHelper::isMessageTypeUsedInConfiguration($this->id)) {
         // Raise a warning
         JFactory::getApplication()->enqueueMessage(JText::_('COM_ISSNREGISTRY_MESSAGE_TYPE_DELETE_FAILED_SETTINGS'), 'warning');
         // Return false as the item can't be deleted
         return false;
     }
     // Load message template model
     $messageTemplateModel = JModelLegacy::getInstance('messagetemplate', 'IssnregistryModel');
     // Get number of templates that use this message type
     $templateCount = $messageTemplateModel->getMessageTemplatesCountByMessageType($this->id);
     // If template count is not zero, message type cannot be deleted
     if ($templateCount != 0) {
         // Raise a warning
         JFactory::getApplication()->enqueueMessage(JText::_('COM_ISSNREGISTRY_MESSAGE_TYPE_DELETE_FAILED_USED'), 'warning');
         // Return false as the item can't be deleted
         return false;
     }
     // No ISSNs have been used, delete the item
     return parent::delete($pk);
 }
开发者ID:petkivim,项目名称:id-registry,代码行数:33,代码来源:messagetype.php


示例14: display

 /**
  * Display the view
  */
 public function display($tpl = null)
 {
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $this->authors = $this->get('Authors');
     $model = JModelLegacy::getInstance('Categories', 'TZ_Portfolio_PlusModel');
     $model->setState('filter.group', $this->state->get('filter.group'));
     $this->assign('listGroup', $model->getGroups());
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     // Levels filter.
     $options = array();
     $options[] = JHtml::_('select.option', '1', JText::_('J1'));
     $options[] = JHtml::_('select.option', '2', JText::_('J2'));
     $options[] = JHtml::_('select.option', '3', JText::_('J3'));
     $options[] = JHtml::_('select.option', '4', JText::_('J4'));
     $options[] = JHtml::_('select.option', '5', JText::_('J5'));
     $options[] = JHtml::_('select.option', '6', JText::_('J6'));
     $options[] = JHtml::_('select.option', '7', JText::_('J7'));
     $options[] = JHtml::_('select.option', '8', JText::_('J8'));
     $options[] = JHtml::_('select.option', '9', JText::_('J9'));
     $options[] = JHtml::_('select.option', '10', JText::_('J10'));
     $this->assign('f_levels', $options);
     // We don't need toolbar in the modal window.
     if ($this->getLayout() !== 'modal') {
         $this->addToolbar();
     }
     TZ_Portfolio_PlusHelper::addSubmenu('featured');
     $this->sidebar = JHtmlSidebar::render();
     parent::display($tpl);
 }
开发者ID:templaza,项目名称:tz_portfolio_plus,代码行数:38,代码来源:view.html.php


示例15: display

 /**
  * Return statistics CSV file
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  void
  */
 function display($tpl = null)
 {
     $this->item = $this->get('Item');
     // Get parameters
     $jinput = JFactory::getApplication()->input;
     $type = $jinput->get('type', null, 'string');
     $begin = $jinput->get('begin', null, 'string');
     $end = $jinput->get('end', null, 'string');
     // Convert date strings to JDate objects
     $beginDate = new JDate($begin);
     $endDate = new JDate($end . ' 23:59:59');
     // Get statistic model
     $statisticModel = JModelLegacy::getInstance('statistic', 'IssnregistryModel');
     // Get statistics
     $csv = $statisticModel->getStats($type, $beginDate, $endDate);
     // Set document properties
     $document = JFactory::getDocument();
     $document->setMimeEncoding('text/csv; charset="UTF-8"');
     JResponse::setHeader('Content-disposition', 'attachment; filename="statistics.csv"', true);
     // Write to output
     $out = fopen('php://output', 'w');
     // Loop through CSV data and write each row to output
     foreach ($csv as $row) {
         // Columns are tab separated
         fputcsv($out, $row, "\t");
     }
     // Close output
     fclose($out);
 }
开发者ID:petkivim,项目名称:id-registry,代码行数:36,代码来源:view.csv.php


示例16: display

 function display($tpl = null)
 {
     $this->config = JBFactory::getConfig();
     $input = JFactory::getApplication()->input;
     AImporter::model('tour');
     $cart = JModelLegacy::getInstance('TourCart', 'bookpro');
     $cart->load();
     $cart->clear();
     $model = new BookProModelTour();
     $id = $input->getInt('id');
     $this->tour = $model->getComplexItem($id);
     $this->itineraries = TourHelper::buildItinerary($id);
     //$this->packages	= $packages;
     $date = TourHelper::getDateFirstInPackagerateFromTourid($this->tour->id);
     $this->date = JFactory::getDate($date)->format(DateHelper::getConvertDateFormat('P'));
     $this->tour->rdate = $this->date;
     $dispatcher = JDispatcher::getInstance();
     //$this->_prepareDocument();
     //		$dispatcher		= JDispatcher::getInstance();
     //		$this->event 	= new stdClass();
     //		JPluginHelper::importPlugin('bookpro');
     //		$results 		= $dispatcher->trigger('onBookproProductAfterTitle', array ($this->tour));
     //		$this->event->afterDisplayTitle=isset($results[0])?$results[0]:null;
     parent::display($tpl);
 }
开发者ID:hixbotay,项目名称:executivetransport,代码行数:25,代码来源:view.html.php


示例17: display

 /**
  * Display the view.
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise a Error object.
  *
  * @since   1.0.0
  */
 public function display($tpl = null)
 {
     $jinput = JFactory::getApplication()->input;
     $campaignId = $jinput->get('campaign', 0, 'integer');
     $campaigns = JModelLegacy::getInstance('Campaigns', 'CMDonationModel')->getCampaignsForFilter();
     $campaignList = array();
     $campaign = array();
     if (!empty($campaigns)) {
         foreach ($campaigns as $camp) {
             $campaignList[$camp->id] = htmlspecialchars($camp->name);
             if ($camp->id == $campaignId) {
                 $campaign = $camp;
             }
         }
     }
     $statistics = array();
     if (!empty($campaign)) {
         $statistics = CMDonationHelper::generateStatistics($campaignId);
     }
     $params = JComponentHelper::getParams('com_cmdonation');
     // Get payment methods.
     $paymentMethods = CMDonationHelper::getPaymentMethods();
     $this->assignRef('paymentMethods', $paymentMethods);
     $this->assignRef('params', $params);
     $this->assignRef('campaignList', $campaignList);
     $this->assignRef('campaignId', $campaignId);
     $this->assignRef('campaign', $campaign);
     $this->assignRef('statistics', $statistics);
     $this->submenu = CMDonationHelper::addSubmenu('statistics');
     $this->addToolbar($campaign, $statistics);
     parent::display($tpl);
 }
开发者ID:sis-direct,项目名称:cmdonation,代码行数:41,代码来源:view.html.php


示例18: display

 /**
  * Execute and display a template script.
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise a JError object.
  */
 public function display($tpl = null)
 {
     // Do not allow cache
     JFactory::getApplication()->allowCache(false);
     $jinput = JFactory::getApplication()->input;
     $mediaParams = JComponentHelper::getParams('com_media');
     $mediaModel = JModelLegacy::getInstance('List', 'MediaModel');
     $view = $jinput->get('view');
     // Set the path definitions
     $popup_upload = $jinput->get('pop_up', null);
     $path = 'file_path';
     if (substr(strtolower($view), 0, 6) == 'images' || $popup_upload == 1) {
         $path = 'image_path';
     }
     $media_path = $mediaParams->get($path, 'images');
     define('COM_MEDIA_BASE', JPATH_ROOT . '/' . $media_path);
     define('COM_MEDIA_BASEURL', JUri::root() . $media_path);
     $lang = JFactory::getLanguage();
     JHtml::_('stylesheet', 'media/popup-imagelist.css', array(), true);
     if ($lang->isRTL()) {
         JHtml::_('stylesheet', 'media/popup-imagelist_rtl.css', array(), true);
     }
     $document = JFactory::getDocument();
     $document->addScriptDeclaration("var ImageManager = window.parent.ImageManager;");
     $images = $mediaModel->getImages();
     $documents = $mediaModel->getDocuments();
     $folders = $mediaModel->getFolders();
     $state = $mediaModel->getState();
     $this->baseURL = COM_MEDIA_BASEURL;
     $this->images =& $images;
     $this->documents =& $documents;
     $this->folders =& $folders;
     $this->state =& $state;
     parent::display($tpl);
 }
开发者ID:RomanaBW,项目名称:BwPostman,代码行数:42,代码来源:view.html.php


示例19: initialise

 private function initialise()
 {
     static $loaded = false;
     if (!$loaded || true) {
         defined('DS') || define('DS', DIRECTORY_SEPARATOR);
         require_once JPATH_SITE . '/components/com_sobipro/lib/sobi.php';
         Sobi::Initialise();
         if (SOBI_CMS == 'joomla3') {
             SPFactory::header()->initBase(true)->addJsFile(array('sobipro', 'jqnc', 'adm.sobipro', 'adm.jnmenu', 'jquery-base64'));
         } else {
             SPFactory::header()->initBase(true)->addJsFile(array('sobipro', 'jquery', 'adm.sobipro', 'adm.jnmenu', 'jquery-migrate', 'jquery-base64'))->addCSSCode('#toolbar-box { display: block }');
         }
         $loaded = true;
         SPLoader::loadClass('mlo.input');
         SPLoader::loadClass('models.datamodel');
         SPLoader::loadClass('models.dbobject');
         SPLoader::loadModel('section');
         $model = JModelLegacy::getInstance('MenusModelItem')->getItem();
         self::$mid = $model->id;
         if (isset($model->params['SobiProSettings']) && strlen($model->params['SobiProSettings'])) {
             $this->params = json_decode(base64_decode($model->params['SobiProSettings']));
         }
         $jsString = json_encode(array('component' => Sobi::Txt('SOBI_NATIVE_TASKS'), 'buttonLabel' => Sobi::Txt('SOBI_SELECT_FUNCTIONALITY')));
         SPFactory::header()->addJsCode("SpStrings = {$jsString}; ");
     }
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:26,代码来源:native.php


示例20: display

 function display($tpl = null)
 {
     $objPhpExcel = new PHPExcel();
     $data = JRequest::get('donvi_id');
     $user = JFactory::getUser();
     $user_id = $user->id;
     $model = JModelLegacy::getInstance('Tuan', 'BaocaotuanModel');
     if ($data['task'] == "excelbctuan") {
         $baocao_id = $data['baocao_id'];
         $ketqua = $model->getThongtin('ju.name as tennhanvien, bc.*', 'zxbaocao bc', array('inner' => 'jos_users ju on ju.id = bc.user_id'), 'bc.trangthai = 1 and bc.user_id = ' . $user_id . ' and bc.id IN (' . $baocao_id . ')', 'batdau asc, ketthuc asc');
         $this->assignRef('rows', $ketqua);
         if (is_null($tpl)) {
             $tpl = 'excel_baocaotuan';
         }
     }
     if ($data['task'] == "excellamthemgio") {
         $lamthemgio_id = $data['lamthemgio_id'];
         $thongtin_all = $model->getThongtin('ju.name as tennhanvien, DATE_FORMAT(ltg.timebatdau,"%Hh%i") as timebatdau, DATE_FORMAT(ltg.timeketthuc,"%Hh%i") as timeketthuc,ltg.thoigian,ltg.congvieclamthem as congvieclamthem, DATE_FORMAT(ltg.ngaylamthem,"%d/%m/%Y") as ngaylamthem, DATE_FORMAT(ltg.ngaylamthem,"%m") as thanglamthem, DATE_FORMAT(ltg.ngaylamthem,"%Y") as namlamthem', 'zxlamthemgio ltg', array('inner' => 'jos_users ju on ju.id = ltg.user_id'), ' ltg.user_id = ' . $user_id . ' and ltg.id IN (' . $lamthemgio_id . ')', ' ngaylamthem asc');
         $thanglamthem = $model->getThongtin('distinct(DATE_FORMAT(ltg.ngaylamthem,"%m")) as thanglamthem', 'zxlamthemgio ltg', null, ' ltg.user_id = ' . $user_id . ' and ltg.id IN (' . $lamthemgio_id . ')', ' ngaylamthem asc');
         $ketqua = array();
         for ($i = 0; $i < count($thanglamthem); $i++) {
             for ($j = 0; $j < count($thongtin_all); $j++) {
                 if ($thanglamthem[$i]->thanglamthem == $thongtin_all[$j]->thanglamthem) {
                     $ketqua[$thanglamthem[$i]->thanglamthem][] = $thongtin_all[$j];
                 }
             }
         }
         $this->assignRef('rows', $ketqua);
         if (is_null($tpl)) {
             $tpl = 'excel_lamthemgio';
         }
     }
     parent::display($tpl);
 }
开发者ID:phucdnict,项目名称:cbcc_05062015,代码行数:34,代码来源:view.xls.php



注:本文中的JModelLegacy类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP JModelList类代码示例发布时间:2022-05-23
下一篇:
PHP JModelForm类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap