/** * Constructor */ protected function __construct() { global $section; parent::__construct(__FILE__); // register backend if (class_exists('backend')) { $backend = backend::getInstance(); $feedback_menu = new backend_MenuItem($this->getLanguageConstant('menu_feedback'), url_GetFromFilePath($this->path . 'images/icon.svg'), 'javascript:void(0);', $level = 5); $feedback_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_feedback_show'), url_GetFromFilePath($this->path . 'images/feedback_list.svg'), window_Open('feedback_manage', 730, $this->getLanguageConstant('title_feedback_show'), true, true, backend_UrlMake($this->name, 'show_feedback')), $level = 5)); $backend->addMenu($this->name, $feedback_menu); } }
/** * 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 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 * * @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); } }
/** * Print a form containing all the links within a group */ private function containerGroups() { $container_id = fix_id($_REQUEST['id']); $template = new TemplateHandler('containers_groups.xml', $this->path . 'templates/'); $template->setMappedModule($this->name); $params = array('container' => $container_id, 'form_action' => backend_UrlMake($this->name, 'containers_groups_save'), 'cancel_action' => window_Close('gallery_containers_groups')); $template->registerTagHandler('_container_groups', $this, 'tag_ContainerGroups'); $template->restoreXML(); $template->setLocalParams($params); $template->parse(); }
/** * Show settings form. */ private function showSettings() { $template = new TemplateHandler('settings.xml', $this->path . 'templates/'); $template->setMappedModule($this->name); $params = array('form_action' => backend_UrlMake($this->name, 'settings_save'), 'cancel_action' => window_Close('callbox_settings')); $template->restoreXML(); $template->setLocalParams($params); $template->parse(); }
/** * Show form for changing manufacturer data */ private function changeManufacturer() { $id = fix_id($_REQUEST['id']); $manager = ShopManufacturerManager::getInstance(); $item = $manager->getSingleItem($manager->getFieldNames(), array('id' => $id)); if (!is_object($item)) { return; } $template = new TemplateHandler('manufacturer_change.xml', $this->path . 'templates/'); $template->setMappedModule($this->name); if (class_exists('gallery')) { $gallery = gallery::getInstance(); $template->registerTagHandler('_image_list', $gallery, 'tag_ImageList'); } $params = array('id' => $item->id, 'name' => $item->name, 'web_site' => $item->web_site, 'logo' => $item->logo, 'form_action' => backend_UrlMake($this->name, 'manufacturers', 'save'), 'cancel_action' => window_Close('shop_manufacturer_change')); $template->restoreXML(); $template->setLocalParams($params); $template->parse(); }
/** * Show form for selecting email templates for notifying users. */ private function showTemplateSelection() { if (class_exists('contact_form')) { // get contact form and show settings $contact_form = contact_form::getInstance(); $template = new TemplateHandler('email_templates.xml', $this->parent->path . 'templates/'); $template->setMappedModule($this->parent->name); $template->registerTagHandler('cms:templates', $contact_form, 'tag_TemplateList'); $params = array('form_action' => backend_UrlMake($this->parent->name, 'email_templates_save'), 'cancel_action' => window_Close('system_users_email_templates')); $template->restoreXML(); $template->setLocalParams($params); $template->parse(); } else { // contact form module is not active, show message instead $template = new TemplateHandler('message.xml', $this->parent->path . 'templates/'); $template->setMappedModule($this->parent->name); $params = array('message' => $this->parent->getLanguageConstant('message_no_contact_form'), 'button' => $this->parent->getLanguageConstant('close'), 'action' => window_Close('system_users_email_templates')); $template->restoreXML(); $template->setLocalParams($params); $template->parse(); } }
/** * Show content of a form in editing state for sepected `code` object */ private function changeCode() { $id = fix_id(fix_chars($_REQUEST['id'])); $manager = CodeManager::getInstance(); $item = $manager->getSingleItem($manager->getFieldNames(), array('id' => $id)); $template = new TemplateHandler('change.xml', $this->path . 'templates/'); $template->setMappedModule($this->name); $params = array('id' => $item->id, 'code' => unfix_chars($item->code), 'url' => unfix_chars($item->url), 'form_action' => backend_UrlMake($this->name, 'codes_save'), 'cancel_action' => window_Close('codes_change')); $template->restoreXML(); $template->setLocalParams($params); $template->parse(); }
/** * Change feed data */ private function changeFeed() { if (!isset($_REQUEST['id'])) { return; } $id = fix_id($_REQUEST['id']); $manager = NewsFeedManager::getInstance(); $item = $manager->getSingleItem($manager->getFieldNames(), array('id' => $id)); $template = new TemplateHandler('feed_change.xml', $this->path . 'templates/'); $template->setMappedModule($this->name); $params = array('id' => $item->id, 'group' => $item->group, 'news_count' => $item->news_count, 'title' => $item->title, 'description' => $item->description, 'active' => $item->active, 'form_action' => backend_UrlMake($this->name, 'feed_save'), 'cancel_action' => window_Close('news_feeds_change')); $template->registerTagHandler('_group_list', $this, 'tag_GroupList'); $template->restoreXML(); $template->setLocalParams($params); $template->parse(); }
/** * Show form for setting/changing API key. */ private function setApiKey() { $template = new TemplateHandler('set_api_key.xml', $this->path . 'templates/'); $template->setMappedModule($this->name); $params = array('api_key' => isset($this->settings['api_key']) ? $this->settings['api_key'] : '', 'form_action' => backend_UrlMake($this->name, 'save_api_key'), 'cancel_action' => window_Close('page_speed_set_api_key')); $template->registerTagHandler('_module_list', $this, 'tag_ModuleList'); $template->restoreXML(); $template->setLocalParams($params); $template->parse(); }
/** * Show shop configuration form */ private function showSettings() { $template = new TemplateHandler('settings.xml', $this->path . 'templates/'); $template->setMappedModule($this->name); $params = array('form_action' => backend_UrlMake($this->name, 'settings_save'), 'cancel_action' => window_Close('shop_settings')); if (class_exists('contact_form')) { $contact_form = contact_form::getInstance(); $template->registerTagHandler('cms:template_list', $contact_form, 'tag_TemplateList'); } $template->restoreXML(); $template->setLocalParams($params); $template->parse(); }
/** * Present confirmation dialog before logout */ private function logout() { $template = new TemplateHandler('confirmation.xml', $this->parent->path . 'templates/'); $template->setMappedModule($this->parent->name); $params = array('message' => $this->parent->getLanguageConstant('message_logout'), 'name' => '', 'yes_text' => $this->parent->getLanguageConstant('logout'), 'no_text' => $this->parent->getLanguageConstant('cancel'), 'yes_action' => window_LoadContent('logout_window', backend_UrlMake($this->parent->name, 'logout_commit')), 'no_action' => window_Close('logout_window')); $template->restoreXML(); $template->setLocalParams($params); $template->parse(); }
private function showSettings() { $template = new TemplateHandler('settings.xml', $this->path . 'templates/'); $template->setMappedModule($this->name); $params = array('form_action' => backend_UrlMake($this->name, 'settings_save'), 'cancel_action' => window_Close('tranzila'), 'confirm_url' => url_Make('checkout_completed', 'shop', array('method', 'tranzila')), 'cancel_url' => url_Make('checkout_canceled', 'shop', array('method', 'tranzila'))); $template->restoreXML(); $template->setLocalParams($params); $template->parse(); }
/** * Create admin form */ private function addAdmin() { $template = new TemplateHandler('admins_add.xml', $this->path . 'templates/'); $template->setMappedModule($this->name); $params = array('form_action' => backend_UrlMake($this->name, 'admins_save'), 'cancel_action' => window_Close('chat_admins_new')); $template->restoreXML(); $template->setLocalParams($params); $template->parse(); }
/** * Show form for changing price */ private function changePrice() { $manager = ShopDeliveryMethodPricesManager::getInstance(); $id = fix_id($_REQUEST['id']); $item = $manager->getSingleItem($manager->getFieldNames(), array('id' => $id)); $template = new TemplateHandler('delivery_method_price_change.xml', $this->path . 'templates/'); $params = array('id' => $item->id, 'value' => $item->value, 'method' => $item->method, 'form_action' => backend_UrlMake($this->name, 'delivery_methods', 'save_price'), 'cancel_action' => window_Close('shop_delivery_price_change')); $template->setLocalParams($params); $template->restoreXML(); $template->parse(); }
/** * Show form for changing existing affiliate. */ private function changeAffiliate() { if ($_SESSION['level'] < 10) { die('Access denied!'); } $id = fix_id($_REQUEST['id']); $manager = AffiliatesManager::getInstance(); $item = $manager->getSingleItem($manager->getFieldNames(), array('id' => $id)); if (is_object($item)) { $template = new TemplateHandler('change.xml', $this->path . 'templates/'); $template->setMappedModule($this->name); // connect tag handlers $user_manager = UserManager::getInstance(); $template->registerTagHandler('_user_list', $user_manager, 'tag_UserList'); $params = array('id' => $item->id, 'uid' => $item->uid, 'name' => $item->name, 'user' => $item->user, 'active' => $item->active, 'default' => $item->default, 'form_action' => backend_UrlMake($this->name, 'affiliate_save'), 'cancel_action' => window_Close('affiliates_change')); $template->restoreXML(); $template->setLocalParams($params); $template->parse(); } }
/** * Print a form containing all the links within a group */ private function groupLinks() { $group_id = fix_id(fix_chars($_REQUEST['id'])); $template = new TemplateHandler('groups_links.xml', $this->path . 'templates/'); $template->setMappedModule($this->name); $params = array('group' => $group_id, 'form_action' => backend_UrlMake($this->name, 'groups_links_save'), 'cancel_action' => window_Close('groups_links')); $template->registerTagHandler('_group_links', $this, 'tag_GroupLinks'); $template->restoreXML(); $template->setLocalParams($params); $template->parse(); }
/** * Show form for editing existing field. */ private function editField() { $id = fix_id($_REQUEST['id']); $manager = ContactForm_FormFieldManager::getInstance(); $item = $manager->getSingleItem($manager->getFieldNames(), array('id' => $id)); if (is_object($item)) { $template = new TemplateHandler('fields_change.xml', $this->path . 'templates/'); $template->setMappedModule($this->name); $params = array('id' => $item->id, 'form' => $item->form, 'name' => $item->name, 'type' => $item->type, 'label' => $item->label, 'placeholder' => $item->placeholder, 'min' => $item->min, 'max' => $item->max, 'maxlength' => $item->maxlength, 'value' => $item->value, 'pattern' => $item->pattern, 'disabled' => $item->disabled, 'required' => $item->required, 'autocomplete' => $item->autocomplete, 'form_action' => backend_UrlMake($this->name, 'fields_save'), 'cancel_action' => window_Close('contact_form_fields_edit')); $template->registerTagHandler('cms:field_types', $this, 'tag_FieldTypes'); $template->restoreXML(); $template->setLocalParams($params); $template->parse(); } }
/** * Show form for setting default currency */ private function setDefault() { $template = new TemplateHandler('currency_set_default.xml', $this->path . 'templates/'); $template->setMappedModule($this->name); $params = array('default' => $this->_parent->getDefaultCurrency(), 'form_action' => backend_UrlMake($this->name, 'currencies', 'save_default'), 'cancel_action' => window_Close('shop_currencies_set_default')); $template->registerTagHandler('_currency_list', $this, 'tag_CurrencyList'); $template->restoreXML(); $template->setLocalParams($params); $template->parse(); }
/** * Change tip form */ private function changeTip() { $id = fix_id($_REQUEST['id']); $manager = TipManager::getInstance(); $item = $manager->getSingleItem($manager->getFieldNames(), array('id' => $id)); if (is_object($item)) { $template = new TemplateHandler('change.xml', $this->path . 'templates/'); $template->setMappedModule($this->name); $params = array('id' => $item->id, 'content' => unfix_chars($item->content), 'visible' => $item->visible, 'form_action' => backend_UrlMake($this->name, 'tips_save'), 'cancel_action' => window_Close('tips_change')); $template->restoreXML(); $template->setLocalParams($params); $template->parse(); } }
/** * Show for for changing existing category */ private function changeCategory() { $id = fix_id($_REQUEST['id']); $manager = ShopCategoryManager::getInstance(); $item = $manager->getSingleItem($manager->getFieldNames(), array('id' => $id)); if (is_object($item)) { // create template $template = new TemplateHandler('category_change.xml', $this->path . 'templates/'); $template->setMappedModule($this->name); // register tag handlers $template->registerTagHandler('_category_list', $this, 'tag_CategoryList'); if (class_exists('gallery')) { $gallery = gallery::getInstance(); $template->registerTagHandler('_image_list', $gallery, 'tag_ImageList'); } // prepare parameters $params = array('id' => $item->id, 'parent' => $item->parent, 'image' => $item->image, 'title' => $item->title, 'text_id' => $item->text_id, 'description' => $item->description, 'form_action' => backend_UrlMake($this->name, 'categories', 'save'), 'cancel_action' => window_Close('shop_category_change')); // parse template $template->restoreXML(); $template->setLocalParams($params); $template->parse(); } }
/** * Show form for editing existing size value */ private function changeValue() { $id = fix_id($_REQUEST['id']); $manager = ShopItemSizeValuesManager::getInstance(); $item = $manager->getSingleItem($manager->getFieldNames(), array('id' => $id)); if (is_object($item)) { // create template $template = new TemplateHandler('value_change.xml', $this->path . 'templates/'); $template->setMappedModule($this->_parent->name); // prepare parameters $params = array('id' => $item->id, 'definition' => $item->definition, 'value' => $item->value, 'form_action' => backend_UrlMake($this->name, 'sizes', 'value_save'), 'cancel_action' => window_Close('shop_item_size_values_change')); // parse template $template->restoreXML(); $template->setLocalParams($params); $template->parse(); } }
/** * Show form for changing specified interval. */ private function change_interval() { $id = fix_id($_REQUEST['id']); $manager = IntervalManager::getInstance(); // get interval $item = $manager->getSingleItem($manager->getFieldNames(), array('id' => $id)); if (!is_object($item)) { return; } // show template $template = new TemplateHandler('change.xml', $this->path . 'templates/'); $template->setMappedModule($this->name); $template->registerTagHandler('cms:days', $this, 'tag_Days'); $template->registerTagHandler('cms:times', $this, 'tag_Times'); $params = array('id' => $item->id, 'days' => $item->days, 'enabled' => $item->enabled, 'form_action' => backend_UrlMake($this->name, 'intervals_save'), 'cancel_action' => window_Close('delivery_intervals_change')); $template->restoreXML(); $template->setLocalParams($params); $template->parse(); }
/** * Show form for adding new gallery to specified page */ private function pageItems_AddGallery() { $page_id = fix_id($_REQUEST['page']); $template = new TemplateHandler('page_add_gallery.xml', $this->path . 'templates/'); $template->setMappedModule($this->name); // add tag handler from gallery if (class_exists('gallery')) { $module = gallery::getInstance(); $template->registerTagHandler('_gallery_list', $module, 'tag_GroupList'); } $params = array('page' => $page_id, 'form_action' => backend_UrlMake($this->name, 'page_items_save'), 'cancel_action' => window_Close('user_pages_add_gallery')); $template->restoreXML(); $template->setLocalParams($params); $template->parse(); }
/** * Print form for changing data */ private function changeData() { $id = fix_id(fix_chars($_REQUEST['id'])); $manager = DownloadsManager::getInstance(); $item = $manager->getSingleItem($manager->getFieldNames(), array('id' => $id)); $template = new TemplateHandler('change.xml', $this->path . 'templates/'); $template->setMappedModule($this->name); $params = array('id' => $item->id, 'name' => unfix_chars($item->name), 'description' => $item->description, 'filename' => $item->filename, 'visible' => $item->visible, 'form_action' => backend_UrlMake($this->name, 'save'), 'cancel_action' => window_Close('downloads_change')); $template->restoreXML(); $template->setLocalParams($params); $template->parse(); }
/** * Show settings form */ private function showSettings() { $template = new TemplateHandler('settings.xml', $this->path . 'templates/'); $template->setMappedModule($this->name); $params = array('form_action' => backend_UrlMake($this->name, 'save'), 'cancel_action' => window_Close('page_settings')); $template->registerTagHandler('cms:analytics_versions', $this, 'tag_AnalyticsVersions'); $template->restoreXML(); $template->setLocalParams($params); $template->parse(); }
/** * Print form for changing article group data */ private function changeGroup() { $id = fix_id(fix_chars($_REQUEST['id'])); $manager = ArticleGroupManager::getInstance(); $item = $manager->getSingleItem($manager->getFieldNames(), array('id' => $id)); $template = new TemplateHandler('group_change.xml', $this->path . 'templates/'); $template->setMappedModule($this->name); $params = array('id' => $item->id, 'text_id' => $item->text_id, 'title' => unfix_chars($item->title), 'description' => $item->description, 'form_action' => backend_UrlMake($this->name, 'groups_save'), 'cancel_action' => window_Close('article_groups_change')); $template->restoreXML(); $template->setLocalParams($params); $template->parse(); }
/** * Show form for selecting file for import. */ private function show_import($action) { $template = new TemplateHandler('import.xml', $this->path . 'templates/'); $template->setMappedModule($this->name); // prepare form action switch ($action) { case 'import_english': $form_action = 'import_english_from_file'; break; case 'import': default: $form_action = 'import_from_file'; break; } $params = array('form_action' => backend_UrlMake($this->name, $form_action), 'cancel_action' => window_Close('shop_import_items')); $template->restoreXML(); $template->setLocalParams($params); $template->parse(); }
/** * Show form for editing existing shop item */ private function changeItem() { $id = fix_id($_REQUEST['id']); $manager = ShopItemManager::getInstance(); $item = $manager->getSingleItem($manager->getFieldNames(), array('id' => $id)); if (is_object($item)) { // create template $template = new TemplateHandler('item_change.xml', $this->path . 'templates/'); $template->setMappedModule($this->name); // register tag handlers $category_handler = ShopCategoryHandler::getInstance($this->_parent); $template->registerTagHandler('_category_list', $category_handler, 'tag_CategoryList'); $size_handler = ShopItemSizesHandler::getInstance($this->_parent); $template->registerTagHandler('_size_list', $size_handler, 'tag_SizeList'); $manufacturer_handler = ShopManufacturerHandler::getInstance($this->_parent); $template->registerTagHandler('_manufacturer_list', $manufacturer_handler, 'tag_ManufacturerList'); $delivery_handler = ShopDeliveryMethodsHandler::getInstance($this->_parent); $template->registerTagHandler('_delivery_methods', $delivery_handler, 'tag_DeliveryMethodsList'); $template->registerTagHandler('_item_list', $this, 'tag_ItemList'); // prepare parameters $params = array('id' => $item->id, 'uid' => $item->uid, 'name' => $item->name, 'description' => $item->description, 'gallery' => $item->gallery, 'manufacturer' => $item->manufacturer, 'size_definition' => $item->size_definition, 'author' => $item->author, 'views' => $item->views, 'price' => $item->price, 'colors' => $item->colors, 'tax' => $item->tax, 'weight' => $item->weight, 'votes_up' => $item->votes_up, 'votes_down' => $item->votes_down, 'priority' => $item->priority, 'timestamp' => $item->timestamp, 'visible' => $item->visible, 'deleted' => $item->deleted, 'form_action' => backend_UrlMake($this->name, 'items', 'save'), 'cancel_action' => window_Close('shop_item_change')); // parse template $template->restoreXML(); $template->setLocalParams($params); $template->parse(); } }