コード例 #1
0
ファイル: view.html.php プロジェクト: grlf/eyedock
 /**
  * Display the view
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $document = JFactory::getDocument();
     $document->addStyleSheet(JURI::root() . '/administrator/components/com_b2jcontact/css/component.css');
     require_once JPATH_COMPONENT . '/helpers/contact.php';
     require_once JPATH_COMPONENT . '/helpers/b2jlanghandler.php';
     $lang_handler = new B2JLangHandler();
     if ($lang_handler->HasMessages()) {
         $langErrors = $lang_handler->GetMessages();
         $message = 'Thank you for using B2J Contact!<br/>';
         foreach ($langErrors as $langErorr) {
             $message .= $langErorr;
         }
         $message .= "Join B2J Contact Translation group on <a target='_blank' href='http://www.transifex.com/projects/p/b2j-contact/'>Transifex</a>.";
         JFactory::getApplication()->enqueueMessage($message, "warning");
     }
     ContactHelper::addSubmenu('contacts');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     // Preprocess the list of items to find ordering divisions.
     // TODO: Complete the ordering stuff with nested sets
     foreach ($this->items as &$item) {
         $item->order_up = true;
         $item->order_dn = true;
     }
     $this->addToolbar();
     $this->sidebar = JHtmlSidebar::render();
     parent::display($tpl);
 }
コード例 #2
0
ファイル: fieldsbuilder.php プロジェクト: grlf/eyedock
 public function __construct(&$params, B2JMessageBoard &$messageboard)
 {
     parent::__construct($params, $messageboard);
     $this->senderEmail = $this->getSenderEmail();
     if (!isset($GLOBALS[$GLOBALS["ext_name"] . '_js_loaded'])) {
         $min = JFactory::getConfig()->get("debug") ? "" : ".min";
         JHtml::_("jquery.framework");
         $document = JFactory::getDocument();
         $document->addScript(JRoute::_("index.php?option=" . $GLOBALS["com_name"] . "&amp;view=loader&amp;owner=" . $this->Application->owner . "&amp;id=" . $this->Application->oid . "&amp;type=js&amp;filename=jtext"));
         $document->addScript(JUri::base(true) . "/components/" . $GLOBALS["com_name"] . "/js/fileuploader.js");
         $uncompressed = JFactory::getConfig()->get("debug") ? "-uncompressed" : "";
         $document->addScript(JUri::base(true) . "/media/system/js/core" . $uncompressed . ".js");
         //$document->addScript(JUri::base(true) . "/media/jui/js/chosen.jquery" . $min . ".js");
         $document->addScript(JUri::base(true) . "/components/" . $GLOBALS["com_name"] . "/js/glDatePicker.js");
         $document->addScript(JUri::base(true) . "/components/" . $GLOBALS["com_name"] . "/js/chosen.jquery.js");
         $GLOBALS[$GLOBALS["ext_name"] . '_js_loaded'] = true;
     }
     $this->isvalid = intval($this->ValidateForm());
     // show lang notice
     $config = JComponentHelper::getParams("com_b2jcontact");
     $front_notis = $config->get('front_notis');
     if (isset($front_notis)) {
         if ($front_notis == 1) {
             $notice = true;
         } else {
             $notice = false;
         }
     } else {
         $notice = true;
     }
     if ($notice) {
         $lang_handler = new B2JLangHandler();
         if ($lang_handler->HasMessages()) {
             $message = array();
             $message[] = 'Thank you for using B2J Contact!';
             $langMeesages = $lang_handler->GetMessages();
             foreach ($langMeesages as $langMes) {
                 $message[] = $langMes;
             }
             $message[] = "Join B2J Contact Translation group on <a target='_blank' href='http://www.transifex.com/projects/p/b2j-contact/'>Transifex</a>. You may turn this message off from the Global Configurations of the component.";
             $messageboard->Append($message, B2JMessageBoard::warning);
         }
     }
     // show lang notice
 }