예제 #1
0
 function addJsLib(OW_Event $e)
 {
     //        OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('googlelocation')->getStaticJsUrl() . 'jquery.ui.widget.js', "text/javascript");
     //        OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('googlelocation')->getStaticJsUrl() . 'jquery.ui.menu.js', "text/javascript");
     //        OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('googlelocation')->getStaticJsUrl() . 'jquery.ui.autocomplete.js', "text/javascript");
     //
     if (!$this->jsLibAdded) {
         $languageCode = GOOGLELOCATION_BOL_LocationService::getInstance()->getLanguageCode();
         $key = Ow::getConfig()->getValue('googlelocation', 'api_key');
         if (!empty($key)) {
             $key = '&key=' . $key;
         }
         $protocol = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443 ? "https://" : "http://";
         $baseJsDir = OW::getPluginManager()->getPlugin("base")->getStaticJsUrl();
         OW::getDocument()->addScript($baseJsDir . "jquery-ui.min.js");
         //OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('googlelocation')->getStaticJsUrl() . 'jquery-ui-1.10.3.custom.min.js');
         OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('googlelocation')->getStaticJsUrl() . 'jquery.js', null, GOOGLELOCATION_BOL_LocationService::JQUERY_LOAD_PRIORITY);
         OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('googlelocation')->getStaticJsUrl() . 'jquery.migrate.js', null, GOOGLELOCATION_BOL_LocationService::JQUERY_LOAD_PRIORITY);
         OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('googlelocation')->getStaticJsUrl() . 'jquery.ui.js', null, GOOGLELOCATION_BOL_LocationService::JQUERY_LOAD_PRIORITY);
         OW::getDocument()->addStyleSheet(OW::getPluginManager()->getPlugin('googlelocation')->getStaticCssUrl() . 'location.css');
         OW::getDocument()->addScript($protocol . 'maps.google.com/maps/api/js?sensor=false' . $key . '&language=' . $languageCode);
         OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('googlelocation')->getStaticJsUrl() . 'InfoBubble.js');
         OW::getDocument()->addOnloadScript('if( !window.map )
         {
             window.map = {};
         }');
         $this->jsLibAdded = 1;
     }
 }
예제 #2
0
    function addJsLib(OW_Event $e)
    {
        //        OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('googlelocation')->getStaticJsUrl() . 'jquery.ui.widget.js', "text/javascript");
        //        OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('googlelocation')->getStaticJsUrl() . 'jquery.ui.menu.js', "text/javascript");
        //        OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('googlelocation')->getStaticJsUrl() . 'jquery.ui.autocomplete.js', "text/javascript");
        //
        if (!$this->jsLibAdded) {
            $languageCode = GOOGLELOCATION_BOL_LocationService::getInstance()->getLanguageCode();
            $key = Ow::getConfig()->getValue('googlelocation', 'api_key');
            if (!empty($key)) {
                $key = '&key=' . $key;
            }
            $protocol = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443 ? "https://" : "http://";
            $baseJsDir = OW::getPluginManager()->getPlugin("base")->getStaticJsUrl();
            OW::getDocument()->addScript($baseJsDir . "jquery-ui.min.js");
            //OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('googlelocation')->getStaticJsUrl() . 'jquery-ui-1.10.3.custom.min.js');
            OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('googlelocation')->getStaticJsUrl() . 'jquery.js', null, GOOGLELOCATION_BOL_LocationService::JQUERY_LOAD_PRIORITY);
            OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('googlelocation')->getStaticJsUrl() . 'jquery.migrate.js', null, GOOGLELOCATION_BOL_LocationService::JQUERY_LOAD_PRIORITY);
            OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('googlelocation')->getStaticJsUrl() . 'jquery.ui.js', null, GOOGLELOCATION_BOL_LocationService::JQUERY_LOAD_PRIORITY);
            OW::getDocument()->addStyleSheet(OW::getPluginManager()->getPlugin('googlelocation')->getStaticCssUrl() . 'location.css');
            //OW::getDocument()->addStyleSheet(OW::getPluginManager()->getPlugin('googlelocation')->getStaticCssUrl() . 'jquery-ui.css');
            OW::getDocument()->addScript($protocol . 'maps.google.com/maps/api/js?sensor=false' . $key . '&language=' . $languageCode);
            OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('googlelocation')->getStaticJsUrl() . 'InfoBubble.js');
            OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('googlelocation')->getStaticJsUrl() . 'markerclusterer.js');
            OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('googlelocation')->getStaticJsUrl() . 'map.js', "text/javascript", GOOGLELOCATION_BOL_LocationService::JQUERY_LOAD_PRIORITY + 1);
            OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('googlelocation')->getStaticJsUrl() . 'autocomplete.js', "text/javascript", GOOGLELOCATION_BOL_LocationService::JQUERY_LOAD_PRIORITY + 1);
            OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('googlelocation')->getStaticJsUrl() . 'map_hint.js');
            $hintTemplate = new GOOGLELOCATION_CMP_MapHintTemplate();
            $template = $hintTemplate->render();
            OW::getDocument()->addOnloadScript('

            $("head").append(' . json_encode($template) . ')


            if( !window.map )
            {
                window.map = {};
            }
            $( document ).ready(function() { 
                if ( !window.googlelocation_hint_init )
                {
                    GoogleMapLocationHint.LAUNCHER().init(' . json_encode(GOOGLELOCATION_BOL_LocationService::getInstance()->getDefaultMarkerIcon()) . ');
                    window.googlelocation_hint_init = true;
                }
            });
            ');
            $this->jsLibAdded = 1;
        }
    }
예제 #3
0
 public function __construct($name)
 {
     parent::__construct($name);
     $militaryTime = Ow::getConfig()->getValue('base', 'military_time');
     $language = OW::getLanguage();
     $currentYear = date('Y', time());
     $title = new TextField('title');
     $title->setRequired();
     $title->setLabel($language->text('event', 'add_form_title_label'));
     $event = new OW_Event(self::EVENT_NAME, array('name' => 'title'), $title);
     OW::getEventManager()->trigger($event);
     $title = $event->getData();
     $this->addElement($title);
     $startDate = new DateField('start_date');
     $startDate->setMinYear($currentYear);
     $startDate->setMaxYear($currentYear + 5);
     $startDate->setRequired();
     $event = new OW_Event(self::EVENT_NAME, array('name' => 'start_date'), $startDate);
     OW::getEventManager()->trigger($event);
     $startDate = $event->getData();
     $this->addElement($startDate);
     $startTime = new EventTimeField('start_time');
     $startTime->setMilitaryTime($militaryTime);
     if (!empty($_POST['endDateFlag'])) {
         $startTime->setRequired();
     }
     $event = new OW_Event(self::EVENT_NAME, array('name' => 'start_time'), $startTime);
     OW::getEventManager()->trigger($event);
     $startTime = $event->getData();
     $this->addElement($startTime);
     $endDate = new DateField('end_date');
     $endDate->setMinYear($currentYear);
     $endDate->setMaxYear($currentYear + 5);
     $event = new OW_Event(self::EVENT_NAME, array('name' => 'end_date'), $endDate);
     OW::getEventManager()->trigger($event);
     $endDate = $event->getData();
     $this->addElement($endDate);
     $endTime = new EventTimeField('end_time');
     $endTime->setMilitaryTime($militaryTime);
     $event = new OW_Event(self::EVENT_NAME, array('name' => 'end_time'), $endTime);
     OW::getEventManager()->trigger($event);
     $endTime = $event->getData();
     $this->addElement($endTime);
     $location = new TextField('location');
     $location->setRequired();
     $location->setLabel($language->text('event', 'add_form_location_label'));
     $event = new OW_Event(self::EVENT_NAME, array('name' => 'location'), $location);
     OW::getEventManager()->trigger($event);
     $location = $event->getData();
     $this->addElement($location);
     $whoCanView = new RadioField('who_can_view');
     $whoCanView->setRequired();
     $whoCanView->addOptions(array('1' => $language->text('event', 'add_form_who_can_view_option_anybody'), '2' => $language->text('event', 'add_form_who_can_view_option_invit_only')));
     $whoCanView->setLabel($language->text('event', 'add_form_who_can_view_label'));
     $event = new OW_Event(self::EVENT_NAME, array('name' => 'who_can_view'), $whoCanView);
     OW::getEventManager()->trigger($event);
     $whoCanView = $event->getData();
     $this->addElement($whoCanView);
     $whoCanInvite = new RadioField('who_can_invite');
     $whoCanInvite->setRequired();
     $whoCanInvite->addOptions(array(EVENT_BOL_EventService::CAN_INVITE_PARTICIPANT => $language->text('event', 'add_form_who_can_invite_option_participants'), EVENT_BOL_EventService::CAN_INVITE_CREATOR => $language->text('event', 'add_form_who_can_invite_option_creator')));
     $whoCanInvite->setLabel($language->text('event', 'add_form_who_can_invite_label'));
     $event = new OW_Event(self::EVENT_NAME, array('name' => 'who_can_invite'), $whoCanInvite);
     OW::getEventManager()->trigger($event);
     $whoCanInvite = $event->getData();
     $this->addElement($whoCanInvite);
     $submit = new Submit('submit');
     $submit->setValue($language->text('event', 'add_form_submit_label'));
     $this->addElement($submit);
     $desc = new WysiwygTextarea('desc');
     $desc->setLabel($language->text('event', 'add_form_desc_label'));
     $desc->setRequired();
     $event = new OW_Event(self::EVENT_NAME, array('name' => 'desc'), $desc);
     OW::getEventManager()->trigger($event);
     $desc = $event->getData();
     $this->addElement($desc);
     $imageField = new FileField('image');
     $imageField->setLabel($language->text('event', 'add_form_image_label'));
     $this->addElement($imageField);
     $event = new OW_Event(self::EVENT_NAME, array('name' => 'image'), $imageField);
     OW::getEventManager()->trigger($event);
     $imageField = $event->getData();
     $this->setEnctype(Form::ENCTYPE_MULTYPART_FORMDATA);
 }
예제 #4
0
파일: base.php 프로젝트: vazahat/dudex
 public function __construct($name)
 {
     parent::__construct($name);
     $militaryTime = Ow::getConfig()->getValue('base', 'military_time');
     $language = OW::getLanguage();
     $currentYear = date('Y', time());
     $title = new TextField('title');
     $title->setRequired();
     $title->setLabel($language->text('eventx', 'add_form_title_label'));
     $event = new OW_Event(self::EVENTX_NAME, array('name' => 'title'), $title);
     OW::getEventManager()->trigger($event);
     $title = $event->getData();
     $this->addElement($title);
     $startDate = new DateField('start_date');
     $startDate->setMinYear($currentYear);
     $startDate->setMaxYear($currentYear + 5);
     $startDate->setRequired();
     $event = new OW_Event(self::EVENTX_NAME, array('name' => 'start_date'), $startDate);
     OW::getEventManager()->trigger($event);
     $startDate = $event->getData();
     $this->addElement($startDate);
     $startTime = new EventTimeField('start_time');
     $startTime->setMilitaryTime($militaryTime);
     if (!empty($_POST['endDateFlag'])) {
         $startTime->setRequired();
     }
     $event = new OW_Event(self::EVENTX_NAME, array('name' => 'start_time'), $startTime);
     OW::getEventManager()->trigger($event);
     $startTime = $event->getData();
     $this->addElement($startTime);
     $endDate = new DateField('end_date');
     $endDate->setMinYear($currentYear);
     $endDate->setMaxYear($currentYear + 5);
     $event = new OW_Event(self::EVENTX_NAME, array('name' => 'end_date'), $endDate);
     OW::getEventManager()->trigger($event);
     $endDate = $event->getData();
     $this->addElement($endDate);
     $endTime = new EventTimeField('end_time');
     $endTime->setMilitaryTime($militaryTime);
     $event = new OW_Event(self::EVENTX_NAME, array('name' => 'end_time'), $endTime);
     OW::getEventManager()->trigger($event);
     $endTime = $event->getData();
     $this->addElement($endTime);
     if (OW::getConfig()->getValue('eventx', 'enableCategoryList') == '1') {
         if (OW::getConfig()->getValue('eventx', 'enableMultiCategories') == 1) {
             $element = new CheckboxGroup('event_category');
             $element->setColumnCount(3);
         } else {
             $element = new SelectBox('event_category');
         }
         $element->setRequired(true);
         $element->setLabel($language->text('eventx', 'event_category_label'));
         foreach (EVENTX_BOL_EventService::getInstance()->getCategoriesList() as $category) {
             $element->addOption($category->id, $category->name);
         }
         $this->addElement($element);
     }
     $maxInvites = new TextField('max_invites');
     $maxInvites->setRequired();
     $validator = new IntValidator(0);
     $validator->setErrorMessage($language->text('eventx', 'invalid_integer_value'));
     $maxInvites->addValidator($validator);
     $maxInvites->setLabel($language->text('eventx', 'add_form_maxinvites_label'));
     $this->addElement($maxInvites);
     $location = new TextField('location');
     $location->setRequired();
     $location->setId('location');
     $location->setLabel($language->text('eventx', 'add_form_location_label'));
     $event = new OW_Event(self::EVENTX_NAME, array('name' => 'location'), $location);
     OW::getEventManager()->trigger($event);
     $location = $event->getData();
     $this->addElement($location);
     $whoCanView = new RadioField('who_can_view');
     $whoCanView->setRequired();
     $whoCanView->addOptions(array('1' => $language->text('eventx', 'add_form_who_can_view_option_anybody'), '2' => $language->text('eventx', 'add_form_who_can_view_option_invit_only')));
     $whoCanView->setLabel($language->text('eventx', 'add_form_who_can_view_label'));
     $event = new OW_Event(self::EVENTX_NAME, array('name' => 'who_can_view'), $whoCanView);
     OW::getEventManager()->trigger($event);
     $whoCanView = $event->getData();
     $this->addElement($whoCanView);
     $whoCanInvite = new RadioField('who_can_invite');
     $whoCanInvite->setRequired();
     $whoCanInvite->addOptions(array(EVENTX_BOL_EventService::CAN_INVITE_PARTICIPANT => $language->text('eventx', 'add_form_who_can_invite_option_participants'), EVENTX_BOL_EventService::CAN_INVITE_CREATOR => $language->text('eventx', 'add_form_who_can_invite_option_creator')));
     $whoCanInvite->setLabel($language->text('eventx', 'add_form_who_can_invite_label'));
     $event = new OW_Event(self::EVENTX_NAME, array('name' => 'who_can_invite'), $whoCanInvite);
     OW::getEventManager()->trigger($event);
     $whoCanInvite = $event->getData();
     $this->addElement($whoCanInvite);
     $desc = new WysiwygTextarea('desc');
     $desc->setLabel($language->text('eventx', 'add_form_desc_label'));
     $desc->setRequired();
     $event = new OW_Event(self::EVENTX_NAME, array('name' => 'desc'), $desc);
     OW::getEventManager()->trigger($event);
     $desc = $event->getData();
     $this->addElement($desc);
     $imageField = new FileField('image');
     $imageField->setLabel($language->text('eventx', 'add_form_image_label'));
     $this->addElement($imageField);
     if (OW::getConfig()->getValue('eventx', 'enableTagsList') == '1') {
         $tags = new TagsInputField('tags');
         $tags->setId('tags');
         $tags->setLabel($language->text('base', 'tags_cloud_cap_label'));
         $this->addElement($tags);
     }
     $submit = new Submit('submit');
     $submit->setValue($language->text('eventx', 'add_form_submit_label'));
     $this->addElement($submit);
     $event = new OW_Event(self::EVENTX_NAME, array('name' => 'image'), $imageField);
     OW::getEventManager()->trigger($event);
     $imageField = $event->getData();
     $this->setEnctype(Form::ENCTYPE_MULTYPART_FORMDATA);
 }