public function __construct(&$params, FoxMessageBoard &$messageboard)
 {
     parent::__construct($params, $messageboard);
     $this->ValidateEmail();
     // email can have text without being valid
     // Load resources only once
     static $resources = true;
     if ($resources) {
         // The easy way to include chosen. It taunts the page source with tons of embedded javascripts.
         // JHtml::_("jquery.framework"); // jquery
         // JHtml::_('behavior.framework', true); // mootools
         // JHtml::_('formbehavior.chosen', 'select'); // chosen
         // We need jQuery to be loaded before our scripts
         JHtml::_("jquery.framework");
         $foxDocument = FoxDocument::getInstance();
         $foxDocument->addResource(array("root" => "components", "filename" => "foxtext", "type" => "js"));
         // Prevent further load of the same resources
         $resources = false;
     }
     $this->isvalid = intval($this->ValidateForm());
     // Are all fields valid?
     $lang_handler = new FLangHandler();
     if ($lang_handler->HasMessages()) {
         $messageboard->Append($lang_handler->GetMessages(), FoxMessageBoard::warning);
     }
     $conflict = new FoxConflicting();
     if ($conflict->HasMessages()) {
         $messageboard->Append($conflict->GetMessages(), FoxMessageBoard::warning);
     }
 }
Exemple #2
0
 public function __construct(&$params, FoxMessageBoard &$messageboard)
 {
     parent::__construct($params, $messageboard);
     $this->ValidateEmail();
     // email can have text without being valid
     // Load required js only once
     if (!isset($GLOBALS[$GLOBALS["ext_name"] . '_js_loaded'])) {
         // The easy way to include chosen. It taunts the page source with tons of embedded javascripts.
         // JHtml::_("jquery.framework"); // jquery
         // JHtml::_('behavior.framework', true); // mootools
         // JHtml::_('formbehavior.chosen', 'select'); // chosen
         // We need jQuery to be loaded before our scripts
         JHtml::_("jquery.framework");
         $foxDocument = FoxDocument::getInstance();
         $min = JFactory::getConfig()->get("debug") ? "" : ".min";
         $foxDocument->addResource(array("root" => "components", "filename" => "jtext", "type" => "js"));
         $foxDocument->addScript(JUri::base(true) . "/components/" . $GLOBALS["com_name"] . "/js/fileuploader" . $min . ".js");
         $document = JFactory::getDocument();
         // chosen.jquery requires core for Joomla.JText
         $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");
         $GLOBALS[$GLOBALS["ext_name"] . '_js_loaded'] = true;
     }
     $this->isvalid = intval($this->ValidateForm());
     // Are all fields valid?
     $lang_handler = new FLangHandler();
     if ($lang_handler->HasMessages()) {
         $messageboard->Append($lang_handler->GetMessages(), FoxMessageBoard::warning);
     }
     $conflict = new FoxConflicting();
     if ($conflict->HasMessages()) {
         $messageboard->Append($conflict->GetMessages(), FoxMessageBoard::warning);
     }
 }
 public function __construct(&$params, &$messages)
 {
     parent::__construct($params, $messages);
     $this->Name = "FFieldPump";
     $this->ValidateEmail();
     // email can have text without being valid
     // Show checkboxes javascript in <head> section as a source
     if (!isset($GLOBALS[$GLOBALS["ext_name"] . '_checkbox_js_loaded'])) {
         $this->js_load("fcheckbox-min.js", 1, 0);
         $GLOBALS[$GLOBALS["ext_name"] . '_checkbox_js_loaded'] = true;
     }
     // Show dropdown javascript in <head> section as a source
     if (!isset($GLOBALS[$GLOBALS["ext_name"] . '_dropdown_js_loaded'])) {
         $this->js_load("dropdown-min.js", 1, 0);
         $GLOBALS[$GLOBALS["ext_name"] . '_dropdown_js_loaded'] = true;
     }
     $this->isvalid = intval($this->ValidateForm());
     // Are all fields valid?
     $lang_handler = new FLangHandler();
     if ($lang_handler->HasMessages()) {
         $messages += $lang_handler->GetMessages();
     }
 }