/** * Constructor */ protected function __construct() { global $section; parent::__construct(__FILE__); // register backend if (class_exists('backend') && class_exists('shop')) { $backend = backend::getInstance(); $method_menu = $backend->getMenu('shop_payment_methods'); $recurring_menu = $backend->getMenu('shop_recurring_plans'); // add menu entry for payment methods if (!is_null($method_menu)) { $method_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_paypal'), url_GetFromFilePath($this->path . 'images/icon.svg'), window_Open('paypal', 400, $this->getLanguageConstant('title_settings'), true, true, backend_UrlMake($this->name, 'settings')), $level = 5)); } if (!is_null($recurring_menu)) { $recurring_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_paypal'), url_GetFromFilePath($this->path . 'images/icon.svg'), window_Open('paypal_recurring_plans', 400, $this->getLanguageConstant('title_recurring_plans'), true, true, backend_UrlMake($this->name, 'recurring_plans')), $level = 5)); } } // register payment method if (class_exists('shop')) { require_once 'units/express_payment_method.php'; require_once 'units/direct_payment_method.php'; // set helped in debug mode if specified PayPal_Helper::setSandbox(shop::getInstance()->isDebug()); PayPal_Helper::setCredentials($this->settings['api_username'], $this->settings['api_password'], $this->settings['api_signature']); // create payment methods if ($this->settings['express_enabled'] == 1) { $this->express_method = PayPal_Express::getInstance($this); } if ($this->settings['direct_enabled'] == 1) { $this->direct_method = PayPal_Direct::getInstance($this); } } }
/** * 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); }
/** * 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')); } }
/** * Constructor */ protected function __construct() { global $section; parent::__construct(__FILE__); // register backend if (class_exists('backend')) { $backend = backend::getInstance(); $faq_menu = new backend_MenuItem($this->getLanguageConstant('menu_faq'), url_GetFromFilePath($this->path . 'images/icon.svg'), 'javascript:void(0);', $level = 4); $faq_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_manage_questions'), url_GetFromFilePath($this->path . 'images/questions.svg'), window_Open('faq', 700, $this->getLanguageConstant('title_questions'), true, true, backend_UrlMake($this->name, 'manage')), $level = 4)); $backend->addMenu($this->name, $faq_menu); } }
/** * Constructor */ protected function __construct() { global $section; parent::__construct(__FILE__); // register backend if ($section == 'backend' && class_exists('backend')) { $backend = backend::getInstance(); $codes_menu = new backend_MenuItem($this->getLanguageConstant('menu_codes'), url_GetFromFilePath($this->path . 'images/icon.png'), 'javascript:void(0);', $level = 5); $codes_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_codes_manage'), url_GetFromFilePath($this->path . 'images/manage.png'), window_Open('codes_manage', 450, $this->getLanguageConstant('title_codes_manage'), true, true, backend_UrlMake($this->name, 'codes_manage')), $level = 5)); $backend->addMenu($this->name, $codes_menu); } }
/** * 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_license'), url_GetFromFilePath($this->path . 'images/icon.svg'), window_Open('licenses', 680, $this->getLanguageConstant('title_licenses'), true, false, backend_UrlMake($this->name, 'show')), $level = 10), 1); } } }
/** * Constructor */ protected function __construct() { global $section; parent::__construct(__FILE__); // load CSS and JScript if (class_exists('head_tag')) { $head_tag = head_tag::getInstance(); $head_tag->addTag('script', array('src' => url_GetFromFilePath($this->path . 'include/language.js'), 'type' => 'text/javascript')); if ($section == 'backend') { $head_tag->addTag('script', array('src' => url_GetFromFilePath($this->path . 'include/selector.js'), 'type' => 'text/javascript')); } } }
/** * Constructor */ protected function __construct() { global $section; parent::__construct(__FILE__); // register backend if ($section == 'backend' && class_exists('backend')) { $backend = backend::getInstance(); $links_menu = new backend_MenuItem($this->getLanguageConstant('menu_links'), url_GetFromFilePath($this->path . 'images/icon.svg'), 'javascript:void(0);', $level = 5); $links_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_links_manage'), url_GetFromFilePath($this->path . 'images/manage.svg'), window_Open('links_list', 720, $this->getLanguageConstant('title_links_manage'), true, true, backend_UrlMake($this->name, 'links_list')), $level = 5)); $links_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_links_groups'), url_getFromFilePath($this->path . 'images/groups.svg'), window_Open('groups_list', 500, $this->getLanguageConstant('title_groups_manage'), true, true, backend_UrlMake($this->name, 'groups_list')), $level = 5)); $links_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_links_overview'), url_GetFromFilePath($this->path . 'images/overview.svg'), window_Open('links_overview', 650, $this->getLanguageConstant('title_links_overview'), true, true, backend_UrlMake($this->name, 'overview')), $level = 6)); $backend->addMenu($this->name, $links_menu); } }
/** * Show login form * * @param string $message */ private function login($message = '') { $manager = LoginRetryManager::getInstance(); $show_captcha = false; // check if user has more than 3 failed atempts $show_captcha = $manager->getRetryCount() > 3; // create template and show login form $template = new TemplateHandler('session_login.xml', $this->parent->path . 'templates/'); $template->setMappedModule($this->parent->name); $params = array('show_captcha' => $show_captcha, 'username' => isset($_REQUEST['username']) ? fix_chars($_REQUEST['username']) : '', 'image' => url_GetFromFilePath($this->parent->path . 'images/icons/login.png'), 'message' => $message); $template->restoreXML(); $template->setLocalParams($params); $template->parse(); }
/** * Constructor */ protected function __construct() { global $section; parent::__construct(__FILE__); // register backend if ($section == 'backend' && class_exists('backend')) { $backend = backend::getInstance(); $mailchimp_menu = new backend_MenuItem($this->getLanguageConstant('menu_mailchimp'), url_GetFromFilePath($this->path . 'images/icon.svg'), 'javascript:void(0);', $level = 5); $mailchimp_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_lists'), url_GetFromFilePath($this->path . 'images/lists.svg'), window_Open('mailchimp_lists', 450, $this->getLanguageConstant('title_lists'), true, true, backend_UrlMake($this->name, 'lists')), $level = 5)); $mailchimp_menu->addSeparator(5); $mailchimp_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_settings'), url_GetFromFilePath($this->path . 'images/settings.svg'), window_Open('mailchimp_settings', 450, $this->getLanguageConstant('title_settings'), true, true, backend_UrlMake($this->name, 'settings')), $level = 5)); $backend->addMenu($this->name, $mailchimp_menu); } }
/** * Constructor */ protected function __construct() { global $section; parent::__construct(__FILE__); // register mailer if (class_exists('contact_form')) { $mailer = new Mandrill_Mailer($this->language, $this->settings['api_key']); $contact_form = contact_form::getInstance(); $contact_form->registerMailer('mandrill', $mailer); } // register backend if (class_exists('backend') && $section == 'backend') { $backend = backend::getInstance(); $mandrill_menu = new backend_MenuItem($this->getLanguageConstant('menu_mandrill'), url_GetFromFilePath($this->path . 'images/icon.svg'), window_Open('mandrill_settings', 370, $this->getLanguageConstant('title_settings'), true, true, backend_UrlMake($this->name, 'settings')), $level = 5); $backend->addMenu($this->name, $mandrill_menu); } }
/** * 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); } }
/** * Constructor */ protected function __construct() { global $section; parent::__construct(__FILE__); // register backend if ($section == 'backend' && class_exists('backend')) { $backend = backend::getInstance(); $referrals_menu = new backend_MenuItem($this->getLanguageConstant('menu_affiliates'), url_GetFromFilePath($this->path . 'images/icon.svg'), 'javascript:void(0);', $level = 5); $referrals_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_manage_affiliates'), url_GetFromFilePath($this->path . 'images/affiliates.svg'), window_Open('affiliates', 700, $this->getLanguageConstant('title_affiliates'), true, true, backend_UrlMake($this->name, 'affiliates')), $level = 10)); $referrals_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_referral_urls'), url_GetFromFilePath($this->path . 'images/referrals.svg'), window_Open('referrals', 750, $this->getLanguageConstant('title_referrals'), true, true, backend_UrlMake($this->name, 'referrals')), $level = 4)); $referrals_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_information'), url_GetFromFilePath($this->path . 'images/information.svg'), window_Open('affiliate_information', 400, $this->getLanguageConstant('title_affiliate_information'), true, true, backend_UrlMake($this->name, 'information')), $level = 4)); $backend->addMenu($this->name, $referrals_menu); } if (isset($_REQUEST['affiliate']) && $section != 'backend' && $section != 'backend_module') { $this->createReferral(); } }
/** * 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); } }
/** * 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' => '')); } }
/** * Constructor */ protected function __construct() { global $section; parent::__construct(__FILE__); // 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_google_checkout'), url_GetFromFilePath($this->path . 'images/icon.png'), window_Open('paypal', 650, $this->getLanguageConstant('title_settings'), true, true, backend_UrlMake($this->name, 'settings')), $level = 5)); } } // register payment method if (class_exists('shop')) { require_once "units/google_checkout_payment_method.php"; GoogleCheckout_PaymentMethod::getInstance($this); } }
/** * Constructor */ protected function __construct() { global $section; parent::__construct(__FILE__); // register backend if (class_exists('backend') && class_exists('shop')) { $backend = backend::getInstance(); $method_menu = $backend->getMenu('shop_delivery_methods'); if (!is_null($method_menu)) { $method_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_fedex'), url_GetFromFilePath($this->path . 'images/icon.png'), window_Open('fedex', 350, $this->getLanguageConstant('title_settings'), true, true, backend_UrlMake($this->name, 'settings')), $level = 5)); } } // register delivery method if (class_exists('shop')) { require_once 'units/fedex_delivery_method.php'; FedEx_DeliveryMethod::getInstance($this); } }
/** * 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')); } } }
/** * 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); } }
/** * 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')); } }
/** * 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')); }
/** * 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); } }
/** * 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); } }
/** * Constructor */ protected function __construct() { global $section; parent::__construct(__FILE__); if (class_exists('head_tag')) { $head_tag = head_tag::getInstance(); $head_tag->addTag('script', array('src' => url_GetFromFilePath($this->path . 'include/news_system.js'), 'type' => 'text/javascript')); } // register backend if ($section == 'backend' && class_exists('backend')) { $backend = backend::getInstance(); $news_menu = new backend_MenuItem($this->getLanguageConstant('menu_news'), url_GetFromFilePath($this->path . 'images/icon.svg'), 'javascript:void(0);', 5); $news_menu->addChild(null, new backend_MenuItem($this->getLanguageConstant('menu_add_news'), url_GetFromFilePath($this->path . 'images/add_news.svg'), window_Open('news_add', 490, $this->getLanguageConstant('title_news_add'), true, true, backend_UrlMake($this->name, 'news_add')), 5)); $news_menu->addSeparator(5); $news_menu->addChild(null, new backend_MenuItem($this->getLanguageConstant('menu_manage_news'), url_GetFromFilePath($this->path . 'images/manage_news.svg'), window_Open('news', 520, $this->getLanguageConstant('title_manage_news'), true, true, backend_UrlMake($this->name, 'news')), 5)); $news_menu->addChild(null, new backend_MenuItem($this->getLanguageConstant('menu_manage_groups'), url_GetFromFilePath($this->path . 'images/manage_groups.svg'), window_Open('news_groups', 580, $this->getLanguageConstant('title_manage_groups'), true, true, backend_UrlMake($this->name, 'groups')), 5)); $news_menu->addSeparator(5); $news_menu->addChild(null, new backend_MenuItem($this->getLanguageConstant('menu_news_feeds'), url_GetFromFilePath($this->path . 'images/rss.svg'), window_Open('news_feeds', 700, $this->getLanguageConstant('title_manage_feeds'), true, true, backend_UrlMake($this->name, 'feeds')), 5)); $backend->addMenu($this->name, $news_menu); } else { // if we are not in backend section, create feed links $this->createFeedLinks(); } }
/** * 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'))); } } }
/** * Return absolute URL for file download * * @param resource $item * @return string */ private function _getDownloadURL($item) { return url_GetFromFilePath($this->path . 'files/' . $item->filename); }
/** * Get image URL for payment method * @return string */ public function get_image_url() { return url_GetFromFilePath($this->parent->path . 'images/direct_image.png'); }
/** * Get URL of 100x28 pixel image for delivery method. This image is a * logo of delivery method and is used in forms for selection. * * @return string */ public function getSmallImage() { return url_GetFromFilePath($this->parent->path . 'images/image_small.png'); }
/** * Include script by its id. * * @param integer $script */ private function includeScriptById($script) { if (is_null($this->head_tag)) { trigger_error('Required module "head_tag" is not present!', E_USER_WARNING); return; } // no need to include script two times if (in_array($script, $this->included)) { return; } // get script files $data = $this->script_files[$script]; // add script to the list of included $this->included[] = $script; if (is_array($data)) { // script requires more than one file foreach ($data as $file_name) { switch (pathinfo($file_name, PATHINFO_EXTENSION)) { case 'css': // include css $this->head_tag->addTag('link', array('href' => url_GetFromFilePath($this->path . 'include/' . $file_name), 'type' => 'text/css', 'rel' => 'stylesheet')); break; case 'js': default: // include javascript $this->head_tag->addTag('script', array('src' => url_GetFromFilePath($this->path . 'include/' . $file_name), 'type' => 'text/javascript')); break; } } } else { // include single file $this->head_tag->addTag('script', array('src' => url_GetFromFilePath($this->path . 'include/' . $data), 'type' => 'text/javascript')); } }
/** * 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')); }