Exemple #1
0
 /**
  * Constructor
  */
 protected function __construct()
 {
     global $section;
     parent::__construct(__FILE__);
     // load module style and scripts
     if (class_exists('head_tag')) {
         $head_tag = head_tag::getInstance();
         $head_tag->addTag('script', array('src' => url_GetFromFilePath($this->path . 'include/slideshow.js'), 'type' => 'text/javascript'));
         $head_tag->addTag('script', array('src' => url_GetFromFilePath($this->path . 'include/lightbox.js'), 'type' => 'text/javascript'));
         $head_tag->addTag('link', array('href' => url_GetFromFilePath($this->path . 'include/lightbox.css'), 'rel' => 'stylesheet', 'type' => 'text/css'));
         // load backend files if needed
         if ($section == 'backend') {
             $head_tag->addTag('link', array('href' => url_GetFromFilePath($this->path . 'include/gallery.css'), 'rel' => 'stylesheet', 'type' => 'text/css'));
             $head_tag->addTag('script', array('src' => url_GetFromFilePath($this->path . 'include/gallery_toolbar.js'), 'type' => 'text/javascript'));
             $head_tag->addTag('script', array('src' => url_GetFromFilePath($this->path . 'include/backend.js'), 'type' => 'text/javascript'));
             if (MainLanguageHandler::getInstance()->isRTL()) {
                 $head_tag->addTag('link', array('href' => url_GetFromFilePath($this->path . 'include/gallery_rtl.css'), 'rel' => 'stylesheet', 'type' => 'text/css'));
             }
         }
     }
     // register backend
     if ($section == 'backend' && class_exists('backend')) {
         $backend = backend::getInstance();
         $gallery_menu = new backend_MenuItem($this->getLanguageConstant('menu_gallery'), url_GetFromFilePath($this->path . 'images/icon.svg'), 'javascript:void(0);', $level = 5);
         $gallery_menu->addChild(null, new backend_MenuItem($this->getLanguageConstant('menu_images'), url_GetFromFilePath($this->path . 'images/images.svg'), window_Open('gallery_images', 670, $this->getLanguageConstant('title_images'), true, true, backend_UrlMake($this->name, 'images')), 5));
         $gallery_menu->addChild(null, new backend_MenuItem($this->getLanguageConstant('menu_groups'), url_GetFromFilePath($this->path . 'images/groups.svg'), window_Open('gallery_groups', 450, $this->getLanguageConstant('title_groups'), true, true, backend_UrlMake($this->name, 'groups')), 5));
         $gallery_menu->addChild(null, new backend_MenuItem($this->getLanguageConstant('menu_containers'), url_GetFromFilePath($this->path . 'images/containers.svg'), window_Open('gallery_containers', 490, $this->getLanguageConstant('title_containers'), true, true, backend_UrlMake($this->name, 'containers')), 5));
         $backend->addMenu($this->name, $gallery_menu);
     }
 }
Exemple #2
0
 /**
  * Constructor
  */
 protected function __construct()
 {
     global $section;
     parent::__construct(__FILE__);
     // load module style and scripts
     if (class_exists('head_tag')) {
         $head_tag = head_tag::getInstance();
         //$head_tag->addTag('link', array('href'=>url_GetFromFilePath($this->path.'include/_blank.css'), 'rel'=>'stylesheet', 'type'=>'text/css'));
         //$head_tag->addTag('script', array('src'=>url_GetFromFilePath($this->path.'include/_blank.js'), 'type'=>'text/javascript'));
     }
     // register backend
     if (class_exists('backend')) {
         // add backend specific script
         if (class_exists('head_tag')) {
             $head_tag = head_tag::getInstance();
             $head_tag->addTag('script', array('src' => url_GetFromFilePath($this->path . 'include/downloads_toolbar.js'), 'type' => 'text/javascript'));
         }
         // create main menu entries
         $backend = backend::getInstance();
         $downloads_menu = new backend_MenuItem($this->getLanguageConstant('menu_downloads'), url_GetFromFilePath($this->path . 'images/icon.svg'), 'javascript:void(0);', $level = 5);
         $downloads_menu->addChild(null, new backend_MenuItem($this->getLanguageConstant('menu_upload_file'), url_GetFromFilePath($this->path . 'images/upload.svg'), window_Open('upload_file', 400, $this->getLanguageConstant('title_upload_file'), true, true, backend_UrlMake($this->name, 'upload')), 5));
         $downloads_menu->addChild(null, new backend_MenuItem($this->getLanguageConstant('menu_manage'), url_GetFromFilePath($this->path . 'images/manage.svg'), window_Open('downloads', 520, $this->getLanguageConstant('title_manage'), true, true, backend_UrlMake($this->name, 'list')), 5));
         $backend->addMenu($this->name, $downloads_menu);
     }
 }
Exemple #3
0
 /**
  * Constructor
  */
 protected function __construct()
 {
     global $section, $action;
     parent::__construct(__FILE__);
     // register backend
     if (class_exists('backend')) {
         $backend = backend::getInstance();
         $import_menu = $backend->getMenu('shop_import');
         if (!is_null($import_menu)) {
             $import_menu->addChild(null, new backend_MenuItem($this->getLanguageConstant('menu_import_items'), url_GetFromFilePath($this->path . 'images/import.svg'), window_Open('shop_import_items', 350, $this->getLanguageConstant('title_import_items'), true, true, backend_UrlMake($this->name, 'import')), 6));
             $import_menu->addChild(null, new backend_MenuItem($this->getLanguageConstant('menu_import_english'), url_GetFromFilePath($this->path . 'images/import.svg'), window_Open('shop_import_items', 350, $this->getLanguageConstant('title_import_items'), true, true, backend_UrlMake($this->name, 'import_english')), 6));
         }
     }
     // register delivery method and create menu items
     if (ModuleHandler::is_loaded('backend') && ModuleHandler::is_loaded('shop')) {
         require_once 'units/method.php';
         require_once 'units/pickup_method.php';
         Paid_DeliveryMethod::getInstance($this);
         Pickup_DeliveryMethod::getInstance($this);
     }
     if (ModuleHandler::is_loaded('head_tag') && $section == 'shop' && $action == 'checkout') {
         $head_tag = head_tag::getInstance();
         $head_tag->addTag('script', array('src' => url_GetFromFilePath($this->path . 'include/pikaday.js'), 'type' => 'text/javascript'));
         $head_tag->addTag('link', array('href' => url_GetFromFilePath($this->path . 'include/pikaday.css'), 'rel' => 'stylesheet', 'type' => 'text/css'));
         $head_tag->addTag('link', array('href' => url_GetFromFilePath($this->path . 'include/checkout.css'), 'rel' => 'stylesheet', 'type' => 'text/css'));
     }
     if (ModuleHandler::is_loaded('backend') && ModuleHandler::is_loaded('head_tag') && $section == 'backend') {
         $head_tag = head_tag::getInstance();
         $head_tag->addTag('script', array('src' => url_GetFromFilePath($this->path . 'include/backend.js'), 'type' => 'text/javascript'));
     }
     // connect transaction handling event
     Events::connect('shop', 'transaction-completed', 'on_transaction_completed', $this);
 }
Exemple #4
0
 /**
  * Constructor
  */
 protected function __construct()
 {
     parent::__construct(__FILE__);
     if (class_exists('head_tag')) {
         $head_tag = head_tag::getInstance();
         $head_tag->addTag('script', array('src' => url_GetFromFilePath($this->path . 'include/swfobject.js'), 'type' => 'text/javascript'));
     }
 }
Exemple #5
0
 /**
  * Constructor
  */
 protected function __construct()
 {
     parent::__construct(__FILE__, false);
     // get instance of head tag early on
     if (class_exists('head_tag')) {
         $this->head_tag = head_tag::getInstance();
     }
     // include jquery by default
     $this->includeScriptById(collection::JQUERY);
 }
Exemple #6
0
 /**
  * Constructor
  */
 protected function __construct()
 {
     global $section;
     parent::__construct(__FILE__);
     // load module style and scripts
     if (class_exists('head_tag')) {
         $head_tag = head_tag::getInstance();
         //$head_tag->addTag('link', array('href'=>url_GetFromFilePath($this->path.'include/_blank.css'), 'rel'=>'stylesheet', 'type'=>'text/css'));
         //$head_tag->addTag('script', array('src'=>url_GetFromFilePath($this->path.'include/_blank.js'), 'type'=>'text/javascript'));
     }
     // register backend
     if (class_exists('backend')) {
         $backend = backend::getInstance();
     }
 }
Exemple #7
0
 /**
  * Constructor
  */
 protected function __construct()
 {
     parent::__construct(__FILE__);
     // load module style and scripts
     if (class_exists('head_tag')) {
         $head_tag = head_tag::getInstance();
         //$head_tag->addTag('link', array('href'=>url_GetFromFilePath($this->path.'include/_blank.css'), 'rel'=>'stylesheet', 'type'=>'text/css'));
         //$head_tag->addTag('script', array('src'=>url_GetFromFilePath($this->path.'include/_blank.js'), 'type'=>'text/javascript'));
     }
     // register backend
     if (class_exists('backend')) {
         $backend = backend::getInstance();
         $tips_menu = new backend_MenuItem($this->getLanguageConstant('menu_tips'), url_GetFromFilePath($this->path . 'images/icon.svg'), 'javascript:void(0);', $level = 5);
         $tips_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_tips_manage'), url_GetFromFilePath($this->path . 'images/manage.svg'), window_Open('tips', 500, $this->getLanguageConstant('title_tips_manage'), true, true, backend_UrlMake($this->name, 'tips')), $level = 5));
         $backend->addMenu($this->name, $tips_menu);
     }
 }
Exemple #8
0
 /**
  * Constructor
  */
 protected function __construct()
 {
     global $section;
     parent::__construct(__FILE__);
     // register backend
     if (class_exists('backend')) {
         $backend = backend::getInstance();
         $callbox_menu = new backend_MenuItem($this->getLanguageConstant('menu_callbox'), url_GetFromFilePath($this->path . 'images/icon.svg'), 'javascript:void(0);', $level = 5);
         $callbox_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_settings'), url_GetFromFilePath($this->path . 'images/settings.svg'), window_Open('callbox_settings', 400, $this->getLanguageConstant('title_settings'), true, true, backend_UrlMake($this->name, 'settings')), $level = 5));
         $backend->addMenu($this->name, $callbox_menu);
     }
     if (class_exists('head_tag') && $section != 'backend' && $this->settings['include_code']) {
         $head_tag = head_tag::getInstance();
         $url = str_replace('{id}', $this->settings['account_id'], '//{id}.tctm.co/t.js');
         $head_tag->addTag('script', array('src' => $url, 'type' => 'text/javascript', 'async' => ''));
     }
 }
Exemple #9
0
 /**
  * Constructor
  */
 protected function __construct()
 {
     global $section;
     parent::__construct(__FILE__);
     // register backend
     if ($section == 'backend' && class_exists('backend')) {
         $backend = backend::getInstance();
         if (class_exists('head_tag')) {
             $head_tag = head_tag::getInstance();
             $head_tag->addTag('script', array('src' => url_GetFromFilePath($this->path . 'include/backend.js'), 'type' => 'text/javascript'));
         }
         $leads_menu = new backend_MenuItem($this->getLanguageConstant('menu_leads'), url_GetFromFilePath($this->path . 'images/icon.svg'), 'javascript:void(0);', $level = 5);
         $leads_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_results'), url_GetFromFilePath($this->path . 'images/results.svg'), window_Open('leads_results', 730, $this->getLanguageConstant('title_results'), true, true, backend_UrlMake($this->name, 'results')), $level = 5));
         $leads_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_types'), url_GetFromFilePath($this->path . 'images/types.svg'), window_Open('leads_types', 350, $this->getLanguageConstant('title_types'), true, true, backend_UrlMake($this->name, 'types')), $level = 5));
         $backend->addMenu($this->name, $leads_menu);
     }
 }
Exemple #10
0
 /**
  * Constructor
  */
 protected function __construct()
 {
     global $section;
     parent::__construct(__FILE__);
     // register backend
     if (class_exists('backend')) {
         $backend = backend::getInstance();
         $menu = $backend->getMenu($backend->name);
         if (!is_null($menu)) {
             $menu->insertChild(new backend_MenuItem($this->getLanguageConstant('menu_page_speed'), url_GetFromFilePath($this->path . 'images/icon.svg'), window_Open('page_speed', 670, $this->getLanguageConstant('title_page_speed'), true, false, backend_UrlMake($this->name, 'show')), $level = 5), 1);
         }
         // add style for backend
         if (class_exists('head_tag') && $section == 'backend') {
             $head_tag = head_tag::getInstance();
             $head_tag->addTag('link', array('href' => url_GetFromFilePath($this->path . 'include/page_speed.css'), 'rel' => 'stylesheet', 'type' => 'text/css'));
         }
     }
 }
Exemple #11
0
 /**
  * Constructor
  */
 protected function __construct()
 {
     global $section;
     parent::__construct(__FILE__);
     // load module style and scripts
     if (class_exists('head_tag')) {
         $head_tag = head_tag::getInstance();
         /* $head_tag->addTag('link', array('href'=>url_GetFromFilePath($this->path.'include/default_style.css'), 'rel'=>'stylesheet', 'type'=>'text/css')); */
         /* $head_tag->addTag('script', array('src'=>url_GetFromFilePath($this->path.'include/youtube_controls.js'), 'type'=>'text/javascript')); */
     }
     // register backend
     if ($section == 'backend' && class_exists('backend')) {
         $backend = backend::getInstance();
         $youtube_menu = new backend_MenuItem($this->getLanguageConstant('menu_youtube'), url_GetFromFilePath($this->path . 'images/icon.svg'), 'javascript:void(0);', $level = 5);
         $youtube_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_video_list'), url_GetFromFilePath($this->path . 'images/list.svg'), window_Open($this->name . '_video_list', 650, $this->getLanguageConstant('title_video_list'), true, true, backend_UrlMake($this->name, 'video_list')), $level = 5));
         $youtube_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_video_groups'), url_GetFromFilePath($this->path . 'images/groups.svg'), window_Open($this->name . '_group_list', 570, $this->getLanguageConstant('title_video_groups'), true, true, backend_UrlMake($this->name, 'group_list')), $level = 5));
         $backend->addMenu($this->name, $youtube_menu);
     }
 }
Exemple #12
0
 /**
  * Constructor
  */
 protected function __construct()
 {
     global $section;
     parent::__construct(__FILE__);
     // create mailer support
     $system_mailer = new ContactForm_SystemMailer($this->language);
     $smtp_mailer = new ContactForm_SmtpMailer($this->language);
     $this->registerMailer('system', $system_mailer);
     $this->registerMailer('smtp', $smtp_mailer);
     // configure SMTP mailer
     $smtp_mailer->set_server($this->settings['smtp_server'], $this->settings['smtp_port'], $this->settings['use_ssl']);
     if ($this->settings['smtp_authenticate']) {
         $smtp_mailer->set_credentials($this->settings['smtp_username'], $this->settings['smtp_password']);
     }
     // register backend
     if ($section == 'backend' && class_exists('backend')) {
         $backend = backend::getInstance();
         $contact_menu = new backend_MenuItem($this->getLanguageConstant('menu_contact'), url_GetFromFilePath($this->path . 'images/icon.svg'), 'javascript:void(0);', $level = 5);
         $contact_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_manage_forms'), url_GetFromFilePath($this->path . 'images/forms.svg'), window_Open('contact_forms', 600, $this->getLanguageConstant('title_forms_manage'), true, true, backend_UrlMake($this->name, 'forms_manage')), $level = 5));
         $contact_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_manage_templates'), url_GetFromFilePath($this->path . 'images/templates.svg'), window_Open('contact_form_templates', 550, $this->getLanguageConstant('title_templates_manage'), true, true, backend_UrlMake($this->name, 'templates_manage')), $level = 5));
         $contact_menu->addSeparator(5);
         $contact_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_settings'), url_GetFromFilePath($this->path . 'images/settings.svg'), window_Open('contact_form_settings', 400, $this->getLanguageConstant('title_settings'), true, true, backend_UrlMake($this->name, 'settings_show')), $level = 5));
         $contact_menu->addSeparator(5);
         $contact_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_submissions'), url_GetFromFilePath($this->path . 'images/submissions.svg'), window_Open('contact_form_submissions', 650, $this->getLanguageConstant('title_submissions'), true, true, backend_UrlMake($this->name, 'submissions')), $level = 5));
         $backend->addMenu($this->name, $contact_menu);
         // add backend support script
         $head_tag = head_tag::getInstance();
         $head_tag->addTag('script', array('src' => url_GetFromFilePath($this->path . 'include/backend.js'), 'type' => 'text/javascript'));
         $head_tag->addTag('link', array('href' => url_GetFromFilePath($this->path . 'include/backend.css'), 'rel' => 'stylesheet', 'type' => 'text/css'));
     }
     if (class_exists('collection') && $section != 'backend') {
         $collection = collection::getInstance();
         $collection->includeScript(collection::DIALOG);
         $collection->includeScript(collection::COMMUNICATOR);
     }
     if (class_exists('head_tag') && $section != 'backend') {
         $head_tag = head_tag::getInstance();
         $head_tag->addTag('script', array('src' => url_GetFromFilePath($this->path . 'include/contact_form.js'), 'type' => 'text/javascript'));
         $head_tag->addTag('link', array('href' => url_GetFromFilePath($this->path . 'include/contact_form.css'), 'rel' => 'stylesheet', 'type' => 'text/css'));
     }
 }
Exemple #13
0
 public function addMeta()
 {
     $head_tag = head_tag::getInstance();
     $language_handler = MainLanguageHandler::getInstance();
     $language_list = $language_handler->getLanguages(false);
     $default_language = $language_handler->getDefaultLanguage();
     // prepare params
     $params = $_REQUEST;
     $link_params = array();
     foreach ($params as $key => $value) {
         if (!in_array($key, $this->invalid_params)) {
             $link_params[$key] = escape_chars($value);
         }
     }
     // add link to each language
     foreach ($language_list as $language_code) {
         $link_params['language'] = $language_code;
         $url = url_MakeFromArray($link_params);
         $head_tag->addTag('link', array('rel' => 'alternate', 'href' => $url, 'hreflang' => $language_code == $default_language ? 'x-default' : $language_code));
     }
 }
Exemple #14
0
 /**
  * Constructor
  */
 protected function __construct()
 {
     global $section;
     parent::__construct(__FILE__);
     // register delivery method and create menu items
     if (class_exists('backend') && class_exists('shop')) {
         require_once 'units/method.php';
         require_once 'units/pickup_method.php';
         Simple_DeliveryMethod::getInstance($this);
         Simple_ManualPickupMethod::getInstance($this);
         $backend = backend::getInstance();
         $method_menu = $backend->getMenu('shop_delivery_methods');
         if (!is_null($method_menu)) {
             $method_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_delivery'), url_GetFromFilePath($this->path . 'images/icon.png'), window_Open('delivery_intervals', 650, $this->getLanguageConstant('title_intervals'), true, true, backend_UrlMake($this->name, 'intervals')), $level = 5));
         }
     }
     // register backend style
     $head_tag = head_tag::getInstance();
     $head_tag->addTag('link', array('href' => url_GetFromFilePath($this->path . 'include/backend.css'), 'rel' => 'stylesheet', 'type' => 'text/css'));
     $head_tag->addTag('script', array('src' => url_GetFromFilePath($this->path . 'include/backend.js'), 'type' => 'text/javascript'));
 }
Exemple #15
0
 /**
  * Constructor
  */
 protected function __construct()
 {
     global $section;
     parent::__construct(__FILE__);
     // load module style and scripts
     if ($section == 'backend' && class_exists('head_tag')) {
         $head_tag = head_tag::getInstance();
         $head_tag->addTag('link', array('href' => url_GetFromFilePath($this->path . 'include/chat.css'), 'rel' => 'stylesheet', 'type' => 'text/css'));
         //$head_tag->addTag('script', array('src'=>url_GetFromFilePath($this->path.'include/_blank.js'), 'type'=>'text/javascript'));
     }
     // register backend
     if ($section == 'backend' && class_exists('backend')) {
         $backend = backend::getInstance();
         $chat_menu = new backend_MenuItem($this->getLanguageConstant('menu_chat'), url_GetFromFilePath($this->path . 'images/icon.svg'), 'javascript:void(0);', $level = 5);
         $chat_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_join_chat'), url_GetFromFilePath($this->path . 'images/chat.svg'), window_Open('chat', 670, $this->getLanguageConstant('title_chat'), true, true, backend_UrlMake($this->name, 'chat')), $level = 5));
         $chat_menu->addSeparator(5);
         $chat_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_users'), url_GetFromFilePath($this->path . 'images/users.svg'), window_Open('chat_users', 550, $this->getLanguageConstant('title_chat_users'), true, true, backend_UrlMake($this->name, 'users')), $level = 5));
         $chat_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_rooms'), url_GetFromFilePath($this->path . 'images/rooms.svg'), window_Open('chat_rooms', 450, $this->getLanguageConstant('title_chat_rooms'), true, true, backend_UrlMake($this->name, 'rooms')), $level = 5));
         $chat_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_admins'), url_GetFromFilePath($this->path . 'images/admins.svg'), window_Open('chat_admins', 450, $this->getLanguageConstant('title_chat_admins'), true, true, backend_UrlMake($this->name, 'admins')), $level = 5));
         $backend->addMenu($this->name, $chat_menu);
     }
 }
Exemple #16
0
 /**
  * Constructor
  */
 protected function __construct()
 {
     global $section;
     parent::__construct(__FILE__);
     // load module style and scripts
     if (class_exists('head_tag')) {
         $head_tag = head_tag::getInstance();
         $head_tag->addTag('script', array('src' => 'https://js.stripe.com/v2/', 'type' => 'text/javascript'));
     }
     // register backend
     if (class_exists('backend') && class_exists('shop')) {
         $backend = backend::getInstance();
         $method_menu = $backend->getMenu('shop_payment_methods');
         if (!is_null($method_menu)) {
             $method_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_stripe'), url_GetFromFilePath($this->path . 'images/icon.png'), window_Open('stripe', 350, $this->getLanguageConstant('title_settings'), true, true, backend_UrlMake($this->name, 'show_settings')), $level = 5));
         }
     }
     // register payment method
     if (class_exists('shop')) {
         require_once "units/stripe_payment_method.php";
         Stripe_PaymentMethod::getInstance($this);
     }
 }
Exemple #17
0
 /**
  * Constructor
  *
  * @return backend
  */
 protected function __construct()
 {
     global $section, $language;
     parent::__construct(__FILE__);
     // create events
     Events::register('backend', 'user-create');
     Events::register('backend', 'user-change');
     Events::register('backend', 'user-delete');
     Events::register('backend', 'user-password-change');
     // load CSS and JScript
     if (class_exists('head_tag') && $section == 'backend') {
         $head_tag = head_tag::getInstance();
         $collection = collection::getInstance();
         $collection->includeScript(collection::JQUERY);
         $collection->includeScript(collection::JQUERY_EVENT_DRAG);
         $collection->includeScript(collection::WINDOW_SYSTEM);
         if ($_SESSION['logged']) {
             $collection->includeScript(collection::JQUERY_EXTENSIONS);
             $collection->includeScript(collection::NOTEBOOK);
             $collection->includeScript(collection::SHOWDOWN);
             $collection->includeScript(collection::TOOLBAR);
         }
         $head_tag->addTag('link', array('href' => url_GetFromFilePath($this->path . 'include/backend.css'), 'rel' => 'stylesheet', 'type' => 'text/css'));
         $head_tag->addTag('script', array('src' => url_GetFromFilePath($this->path . 'include/backend.js'), 'type' => 'text/javascript'));
     }
     // add admin level menus
     if ($section == 'backend') {
         $system_menu = new backend_MenuItem($this->getLanguageConstant('menu_system'), url_GetFromFilePath($this->path . 'images/icons/16/system.svg'), 'javascript:void(0);', $level = 1);
         $system_menu->addChild(null, new backend_MenuItem($this->getLanguageConstant('menu_modules'), url_GetFromFilePath($this->path . 'images/icons/16/modules.svg'), window_Open('system_modules', 610, $this->getLanguageConstant('title_modules'), true, false, backend_UrlMake($this->name, 'modules')), $level = 10));
         $system_menu->addChild(null, new backend_MenuItem($this->getLanguageConstant('menu_users'), url_GetFromFilePath($this->path . 'images/icons/16/users.svg'), window_Open('system_users', 690, $this->getLanguageConstant('title_users_manager'), true, false, backend_UrlMake($this->name, 'users')), $level = 10));
         $system_menu->addSeparator(10);
         $system_menu->addChild(null, new backend_MenuItem($this->getLanguageConstant('menu_change_password'), url_GetFromFilePath($this->path . 'images/icons/16/change_password.svg'), window_Open('change_password_window', 350, $this->getLanguageConstant('title_change_password'), true, false, backend_UrlMake($this->name, 'change_password')), $level = 1));
         $system_menu->addChild(null, new backend_MenuItem($this->getLanguageConstant('menu_logout'), url_GetFromFilePath($this->path . 'images/icons/16/logout.svg'), window_Open('logout_window', 350, $this->getLanguageConstant('title_logout'), true, false, backend_UrlMake($this->name, 'logout')), $level = 1));
         $this->addMenu($this->name, $system_menu);
     }
 }
Exemple #18
0
 /** 
  * Method called by the page module to add elements before printing
  */
 public function addElements()
 {
     global $section, $db_use, $optimize_code, $url_rewrite;
     $head_tag = head_tag::getInstance();
     $collection = collection::getInstance();
     $language_handler = MainLanguageHandler::getInstance();
     $default_language = $language_handler->getDefaultLanguage();
     $language_list = $language_handler->getLanguages(false);
     // add base url tag
     $head_tag->addTag('base', array('href' => _BASEURL));
     // add mobile menu script
     if (_MOBILE_VERSION && !in_array('mobile_menu', $this->omit_elements)) {
         $collection->includeScript(collection::MOBILE_MENU);
     }
     // content meta tags
     if (!in_array('content_type', $this->omit_elements)) {
         $head_tag->addTag('meta', array('http-equiv' => 'Content-Type', 'content' => 'text/html; charset=UTF-8'));
     }
     if (!in_array('viewport', $this->omit_elements) && _MOBILE_VERSION) {
         $head_tag->addTag('meta', array('name' => 'viewport', 'content' => 'width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0'));
     }
     if (!in_array('language', $this->omit_elements) && _STANDARD == 'html401') {
         $head_tag->addTag('meta', array('http-equiv' => 'Content-Language', 'content' => join(', ', $language_list)));
     }
     // add other languages if required
     if (count($language_list) > 1 && $url_rewrite && class_exists('language_menu')) {
         language_menu::getInstance()->addMeta();
     }
     // robot tags
     $head_tag->addTag('meta', array('name' => 'robots', 'content' => 'index, follow'));
     $head_tag->addTag('meta', array('name' => 'googlebot', 'content' => 'index, follow'));
     $head_tag->addTag('meta', array('name' => 'rating', 'content' => 'general'));
     if ($section != 'backend' && $section != 'backend_module' && $db_use) {
         // google analytics
         if (!empty($this->settings['analytics'])) {
             $head_tag->addGoogleAnalytics($this->settings['analytics'], $this->settings['analytics_domain'], $this->settings['analytics_version']);
         }
         // google website optimizer
         if (!empty($this->settings['optimizer'])) {
             $head_tag->addGoogleSiteOptimizer($this->settings['optimizer'], $this->settings['optimizer_key'], $this->optimizer_page, $this->optimizer_show_control);
         }
         // google webmaster tools
         if (!empty($this->settings['wm_tools'])) {
             $head_tag->addTag('meta', array('name' => 'google-site-verification', 'content' => $this->settings['wm_tools']));
         }
         // bing webmaster tools
         if (!empty($this->settings['bing_wm_tools'])) {
             $head_tag->addTag('meta', array('name' => 'msvalidate.01', 'content' => $this->settings['bing_wm_tools']));
         }
         // page description
         if ($db_use) {
             if (!is_null($this->page_description)) {
                 $value = $this->page_description;
             } else {
                 $value = $this->settings['description'];
             }
         }
         $head_tag->addTag('meta', array('name' => 'description', 'content' => $value));
     }
     // copyright
     if (!in_array('copyright', $this->omit_elements) && _STANDARD == 'html401') {
         $copyright = MainLanguageHandler::getInstance()->getText('copyright');
         $copyright = strip_tags($copyright);
         $head_tag->addTag('meta', array('name' => 'copyright', 'content' => $copyright));
     }
     // favicon
     if (file_exists(_BASEPATH . '/images/favicon.png')) {
         // regular, single size favicon
         $icon_files = array('16x16' => _BASEPATH . '/images/favicon.png');
     } else {
         if (file_exists(_BASEPATH . '/images/favicon')) {
             $icon_sizes = array(16, 32, 64);
             $icon_files = array();
             foreach ($icon_sizes as $size) {
                 $file_name = _BASEPATH . '/images/favicon/' . $size . '.png';
                 if (file_exists($file_name)) {
                     $icon_files[$size . 'x' . $size] = $file_name;
                 }
             }
         } else {
             $icon_files = array('16x16' => _BASEPATH . '/images/default_icon/16.png', '32x32' => _BASEPATH . '/images/default_icon/32.png', '64x64' => _BASEPATH . '/images/default_icon/64.png');
         }
     }
     foreach ($icon_files as $sizes => $icon) {
         $head_tag->addTag('link', array('rel' => 'icon', 'type' => 'image/png', 'sizes' => $sizes, 'href' => url_GetFromFilePath($icon)));
     }
     // add default styles and script if they exists
     $collection->includeScript(collection::JQUERY);
     if ($section != 'backend') {
         $styles = array();
         $less_style = null;
         // prepare list of files without extensions
         if (_DESKTOP_VERSION) {
             $styles = array('/styles/common.css', '/styles/main.css', '/styles/header.css', '/styles/content.css', '/styles/footer.css');
             $less_style = '/styles/main.less';
         } else {
             $styles = array('/styles/common.css', '/styles/main.css', '/styles/header_mobile.css', '/styles/content_mobile.css', '/styles/footer_mobile.css');
             $less_style = '/styles/main_mobile.less';
         }
         // include styles
         foreach ($styles as $style) {
             // check for css files
             if (file_exists(_BASEPATH . $style)) {
                 $head_tag->addTag('link', array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => url_GetFromFilePath(_BASEPATH . $style)));
             }
         }
         // add main less file if it exists
         if (file_exists(_BASEPATH . $less_style)) {
             $head_tag->addTag('link', array('rel' => 'stylesheet/less', 'type' => 'text/css', 'href' => url_GetFromFilePath(_BASEPATH . $less_style)));
             if (!$optimize_code) {
                 $collection->includeScript(collection::LESS);
             }
         }
         // add main javascript
         if (file_exists(_BASEPATH . '/scripts/main.js')) {
             $head_tag->addTag('script', array('type' => 'text/javascript', 'src' => url_GetFromFilePath(_BASEPATH . '/scripts/main.js')));
         }
     }
 }
Exemple #19
0
 /**
  * Parse loaded template
  *
  * @param integer $level Current level of parsing
  * @param array $tags Leave blank, used for recursion
  * @param boolean $parent_block If parent tag is block element
  */
 public function parse($tags = array())
 {
     global $section, $action, $language, $template_path, $system_template_path;
     if (!$this->active && empty($tags)) {
         return;
     }
     // get language handler for later
     $language_handler = MainLanguageHandler::getInstance();
     // take the tag list for parsing
     $tag_array = empty($tags) ? $this->engine->document->tagChildren : $tags;
     // start parsing tags
     $count = count($tag_array);
     for ($i = 0; $i < $count; $i++) {
         $tag = $tag_array[$i];
         // if tag has eval set
         if (isset($tag->tagAttrs['cms:eval']) || isset($tag->tagAttrs['eval'])) {
             // get evaluation values
             if (isset($tag->tagAttrs['eval'])) {
                 $value = $tag->tagAttrs['eval'];
             } else {
                 $value = $tag->tagAttrs['cms:eval'];
             }
             $eval_params = explode(',', $value);
             foreach ($eval_params as $param) {
                 // prepare module includes for evaluation
                 $settings = array();
                 if (!is_null($this->module)) {
                     $settings = $this->module->settings;
                 }
                 $params = $this->params;
                 $to_eval = $tag->tagAttrs[$param];
                 $tag->tagAttrs[$param] = eval('global $section, $action, $language, $language_rtl, $language_handler; return ' . $to_eval . ';');
             }
             // unset param
             unset($tag->tagAttrs['cms:eval']);
         }
         if (isset($tag->tagAttrs['cms:optional'])) {
             // get evaluation values
             $optional_params = explode(',', $tag->tagAttrs['cms:optional']);
             foreach ($optional_params as $param) {
                 // prepare module includes for evaluation
                 $settings = array();
                 if (!is_null($this->module)) {
                     $settings = $this->module->settings;
                 }
                 $params = $this->params;
                 $to_eval = $tag->tagAttrs[$param];
                 $value = eval('global $section, $action, $language, $language_rtl, $language_handler; return ' . $to_eval . ';');
                 if ($value == false) {
                     unset($tag->tagAttrs[$param]);
                 } else {
                     $tag->tagAttrs[$param] = $value;
                 }
             }
             // unset param
             unset($tag->tagAttrs['cms:optional']);
         }
         // implement tooltip
         if (isset($tag->tagAttrs['cms:tooltip'])) {
             if (!is_null($this->module)) {
                 $value = $this->module->getLanguageConstant($tag->tagAttrs['cms:tooltip']);
             } else {
                 $value = $language_handler->getText($tag->tagAttrs['cms:tooltip']);
             }
             $tag->tagAttrs['data-tooltip'] = $value;
             unset($tag->tagAttrs['cms:tooltip']);
         }
         // implement constants
         if (isset($tag->tagAttrs['cms:constant'])) {
             $params = explode(',', $tag->tagAttrs['cms:constant']);
             if (count($params) > 0) {
                 foreach ($params as $param) {
                     if (!is_null($this->module)) {
                         $tag->tagAttrs[$param] = $this->module->getLanguageConstant($tag->tagAttrs[$param]);
                     } else {
                         $tag->tagAttrs[$param] = $language_handler->getText($tag->tagAttrs[$param]);
                     }
                 }
             }
             unset($tag->tagAttrs['cms:constant']);
         }
         // check if specified tag shouldn't be cached
         $skip_cache = false;
         if (isset($tag->tagAttrs['skip_cache'])) {
             // unset param
             unset($tag->tagAttrs['skip_cache']);
             // get cache handler
             $cache = CacheHandler::getInstance();
             // only if current URL is being cached, we start dirty area
             if ($cache->isCaching()) {
                 $cache->startDirtyArea();
                 $skip_cache = true;
                 // reconstruct template for cache,
                 // ugly but we are not doing it a lot
                 $data = $this->getDataForCache($tag);
                 $cache->setCacheForDirtyArea($data);
             }
         }
         // now parse the tag
         switch ($tag->tagName) {
             // handle tag used for setting session variable
             case '_session':
             case 'cms:session':
                 $name = $tag->tagAttrs['name'];
                 // allow setting referral only once per seesion
                 if (isset($tag->tagAttrs['once'])) {
                     $only_once = in_array($tag->tagAttrs['once'], array(1, 'yes'));
                 } else {
                     $only_once = false;
                 }
                 $should_set = $only_once && !isset($_SESSION[$name]) || !$only_once;
                 // store value
                 if (!in_array($name, $this->protected_variables) && $should_set) {
                     $_SESSION[$name] = $tag->tagAttrs['value'];
                 }
                 break;
                 // transfer control to module
             // transfer control to module
             case '_module':
             case 'cms:module':
                 if (class_exists($tag->tagAttrs['name'])) {
                     $module = call_user_func(array($tag->tagAttrs['name'], 'getInstance'));
                     $module->transferControl($tag->tagAttrs, $tag->tagChildren);
                 }
                 break;
                 // load other template
             // load other template
             case '_template':
             case 'cms:template':
                 $file = $tag->tagAttrs['file'];
                 $path = key_exists('path', $tag->tagAttrs) ? $tag->tagAttrs['path'] : '';
                 if (!is_null($this->module)) {
                     $path = preg_replace('/^%module%/i', $this->module->path, $path);
                     $path = preg_replace('/^%templates%/i', $template_path, $path);
                 }
                 $new = new TemplateHandler($file, $path);
                 $new->setLocalParams($this->params);
                 $new->parse();
                 break;
                 // raw text copy
             // raw text copy
             case '_raw':
             case 'cms:raw':
                 if (key_exists('file', $tag->tagAttrs)) {
                     // if file attribute is specified
                     $file = $tag->tagAttrs['file'];
                     $path = key_exists('path', $tag->tagAttrs) ? $tag->tagAttrs['path'] : $template_path;
                     $text = file_get_contents($path . $file);
                 } elseif (key_exists('text', $tag->tagAttrs)) {
                     // if text attribute is specified
                     $text = $tag->tagAttrs['text'];
                 } else {
                     // in any other case we display data inside tag
                     $text = $tag->tagData;
                 }
                 echo $text;
                 break;
                 // multi language constants
             // multi language constants
             case '_text':
             case 'cms:text':
                 $constant = $tag->tagAttrs['constant'];
                 $language = key_exists('language', $tag->tagAttrs) ? $tag->tagAttrs['language'] : $language;
                 $text = "";
                 // check if constant is module based
                 if (key_exists('module', $tag->tagAttrs)) {
                     if (class_exists($tag->tagAttrs['module'])) {
                         $module = call_user_func(array($tag->tagAttrs['module'], 'getInstance'));
                         $text = $module->getLanguageConstant($constant, $language);
                     }
                 } else {
                     // use default language handler
                     $text = MainLanguageHandler::getInstance()->getText($constant, $language);
                 }
                 echo $text;
                 break;
                 // support for markdown
             // support for markdown
             case 'cms:markdown':
                 $char_count = isset($tag->tagAttrs['chars']) ? fix_id($tag->tagAttrs['chars']) : null;
                 $end_with = isset($tag->tagAttrs['end_with']) ? fix_id($tag->tagAttrs['end_with']) : null;
                 $name = isset($tag->tagAttrs['param']) ? $tag->tagAttrs['param'] : null;
                 $multilanguage = isset($tag->tagAttrs['multilanguage']) ? $tag->tagAttrs['multilanguage'] == 'yes' : false;
                 // get content for parsing
                 if (is_null($name)) {
                     $content = $tag->tagData;
                 }
                 $content = $multilanguage ? $this->params[$name][$language] : $this->params[$name];
                 // convert to HTML
                 $content = Markdown($content);
                 // limit words if specified
                 if (!is_null($char_count)) {
                     if (is_null($end_with)) {
                         $content = limit_words($content, $char_count);
                     } else {
                         $content = limit_words($content, $char_count, $end_with);
                     }
                 }
                 echo $content;
                 break;
                 // call section specific data
             // call section specific data
             case '_section_data':
             case 'cms:section_data':
                 if (!is_null($this->module)) {
                     $file = $this->module->getSectionFile($section, $action, $language);
                     $new = new TemplateHandler(basename($file), dirname($file) . '/');
                     $new->setLocalParams($this->params);
                     $new->setMappedModule($this->module);
                     $new->parse();
                 } else {
                     // log error
                     trigger_error('Mapped module is not loaded! File: ' . $this->file, E_USER_WARNING);
                 }
                 break;
                 // print multilanguage data
             // print multilanguage data
             case '_language_data':
             case 'cms:language_data':
                 $name = isset($tag->tagAttrs['param']) ? $tag->tagAttrs['param'] : null;
                 if (!isset($this->params[$name]) || !is_array($this->params[$name]) || is_null($name)) {
                     break;
                 }
                 $template = new TemplateHandler('language_data.xml', $system_template_path);
                 $template->setMappedModule($this->module);
                 foreach ($this->params[$name] as $lang => $data) {
                     $params = array('param' => $name, 'language' => $lang, 'data' => $data);
                     $template->restoreXML();
                     $template->setLocalParams($params);
                     $template->parse();
                 }
                 break;
                 // replace tag data string with matching params
             // replace tag data string with matching params
             case '_replace':
             case 'cms:replace':
                 $pool = isset($tag->tagAttrs['param']) ? $this->params[$tag->tagAttrs['param']] : $this->params;
                 $keys = array_keys($pool);
                 $values = array_values($pool);
                 foreach ($keys as $i => $key) {
                     $keys[$i] = "%{$key}%";
                 }
                 // we can't replact string with array, only matching data types
                 foreach ($values as $i => $value) {
                     if (is_array($value)) {
                         unset($keys[$i]);
                         unset($values[$i]);
                     }
                 }
                 echo str_replace($keys, $values, $tag->tagData);
                 break;
                 // conditional tag
             // conditional tag
             case '_if':
             case 'cms:if':
                 $settings = !is_null($this->module) ? $this->module->settings : array();
                 $params = $this->params;
                 $condition = true;
                 // check if section is specified and matches
                 if (isset($tag->tagAttrs['section'])) {
                     $condition &= $tag->tagAttrs['section'] == $section;
                 }
                 // check if action is specified and matches
                 if (isset($tag->tagAttrs['action'])) {
                     $condition &= $tag->tagAttrs['action'] == $action;
                 }
                 // check custom condition
                 if (isset($tag->tagAttrs['condition'])) {
                     $to_eval = $tag->tagAttrs['condition'];
                     $eval_result = eval('global $section, $action, $language, $language_rtl, $language_handler; return ' . $to_eval . ';') == true;
                     $condition &= $eval_result;
                 }
                 // parse children
                 if ($condition) {
                     $this->parse($tag->tagChildren);
                 }
                 break;
                 // conditional tag parsed for desktop version
             // conditional tag parsed for desktop version
             case 'cms:desktop':
                 if (_DESKTOP_VERSION) {
                     $this->parse($tag->tagChildren);
                 }
                 break;
                 // conditional tag parsed for mobile version
             // conditional tag parsed for mobile version
             case 'cms:mobile':
                 if (_MOBILE_VERSION) {
                     $this->parse($tag->tagChildren);
                 }
                 break;
                 // conditional tag parsed for users that are logged in
             // conditional tag parsed for users that are logged in
             case 'cms:user':
                 if ($_SESSION['logged']) {
                     $this->parse($tag->tagChildren);
                 }
                 break;
                 // conditional tag parsed for guests
             // conditional tag parsed for guests
             case 'cms:guest':
                 if (!$_SESSION['logged']) {
                     $this->parse($tag->tagChildren);
                 }
                 break;
                 // variable
             // variable
             case '_var':
             case 'cms:var':
                 $settings = array();
                 if (!is_null($this->module)) {
                     $settings = $this->module->settings;
                 }
                 $params = $this->params;
                 $to_eval = $tag->tagAttrs['name'];
                 echo eval('global $section, $action, $language, $language_rtl, $language_handler; return ' . $to_eval . ';');
                 break;
                 // support for script tag
             // support for script tag
             case 'cms:script':
                 if (class_exists('head_tag')) {
                     $head_tag = head_tag::getInstance();
                     $head_tag->addTag('script', $tag->tagAttrs);
                 }
                 break;
                 // support for collection module
             // support for collection module
             case 'cms:collection':
                 if (array_key_exists('include', $tag->tagAttrs) && class_exists('collection')) {
                     $scripts = fix_chars(explode(',', $tag->tagAttrs['include']));
                     $collection = collection::getInstance();
                     $collection->includeScript($scripts);
                 }
                 break;
                 // support for link tag
             // support for link tag
             case 'cms:link':
                 if (class_exists('head_tag')) {
                     $head_tag = head_tag::getInstance();
                     $head_tag->addTag('link', $tag->tagAttrs);
                 }
                 break;
                 // support for parameter based choice
             // support for parameter based choice
             case 'cms:choice':
                 $param_value = null;
                 if (array_key_exists('param', $tag->tagAttrs)) {
                     // grap param value from GET or POST parameters
                     $param_name = fix_chars($tag->tagAttrs['param']);
                     $param_value = isset($_REQUEST[$param_name]) ? fix_chars($_REQUEST[$param_name]) : null;
                 } else {
                     if (array_key_exists('value', $tag->tagAttrs)) {
                         // use param value specified
                         $param_value = fix_chars($tag->tagAttrs['value']);
                     }
                 }
                 // parse only option
                 foreach ($tag->tagChildren as $option) {
                     if (!$option->tagName == 'option') {
                         continue;
                     }
                     $option_value = isset($option->tagAttrs['value']) ? $option->tagAttrs['value'] : null;
                     $option_default = isset($option->tagAttrs['default']) ? $option->tagAttrs['default'] == 1 : false;
                     // values match or option is default, parse its content
                     if ($option_value == $param_value || $option_default) {
                         $this->parse($option->tagChildren);
                         break;
                     }
                 }
                 break;
                 // default action for parser, draw tag
             // default action for parser, draw tag
             default:
                 if (in_array($tag->tagName, array_keys($this->handlers))) {
                     // custom tag handler is set...
                     $handle = $this->handlers[$tag->tagName];
                     $obj = $handle['object'];
                     $function = $handle['function'];
                     $obj->{$function}($tag->tagAttrs, $tag->tagChildren);
                 } else {
                     // default tag handler
                     echo '<' . $tag->tagName . $this->getTagParams($tag->tagAttrs) . '>';
                     if (count($tag->tagChildren) > 0) {
                         $this->parse($tag->tagChildren);
                     }
                     if (count($tag->tagData) > 0) {
                         echo $tag->tagData;
                     }
                     $close_tag = $this->close_all_tags ? true : !in_array($tag->tagName, $this->tags_without_end);
                     if ($close_tag) {
                         echo '</' . $tag->tagName . '>';
                     }
                 }
                 break;
         }
         // end cache dirty area if initialized
         if ($skip_cache) {
             $cache->endDirtyArea();
         }
     }
 }
Exemple #20
0
 /**
  * Include buyer information and checkout form scripts.
  *
  * @param array $tag_params
  * @param array $children
  */
 public function includeScripts($tag_params, $children)
 {
     if (!class_exists('head_tag')) {
         return;
     }
     $head_tag = head_tag::getInstance();
     $collection = collection::getInstance();
     $collection->includeScript(collection::DIALOG);
     $collection->includeScript(collection::PAGE_CONTROL);
     $head_tag->addTag('script', array('src' => url_GetFromFilePath($this->path . 'include/checkout.js'), 'type' => 'text/javascript'));
 }
Exemple #21
0
 /**
  * Add feed links to site head tag
  */
 private function createFeedLinks()
 {
     global $language;
     if (!class_exists('head_tag')) {
         return;
     }
     $head = head_tag::getInstance();
     $manager = NewsFeedManager::getInstance();
     $items = $manager->getItems($manager->getFieldNames(), array('active' => 1));
     if (count($items) > 0) {
         foreach ($items as $item) {
             $url = url_Make('show_feed', $this->name, array('id', $item->id), array('language', $language));
             $head->addTag('link', array('href' => $url, 'title' => $item->title[$language], 'rel' => 'alternate', 'type' => 'application/rss+xml'));
         }
     }
 }
Exemple #22
0
 /**
  * Include beacon JavaScript.
  */
 private function includeScripts()
 {
     if (!class_exists('head_tag')) {
         return;
     }
     $head_tag = head_tag::getInstance();
     $head_tag->addTag('script', array('src' => url_GetFromFilePath($this->path . 'include/beacon.js'), 'type' => 'text/javascript'));
 }