Ejemplo n.º 1
0
 public function main()
 {
     //init controller data
     $this->extensions->hk_InitData($this, __FUNCTION__);
     $this->loadLanguage('common/header');
     $menu = new AMenu('admin', 'menu');
     $documentation = $menu->getMenuItem('documentation');
     $support = $menu->getMenuItem('support');
     $mp = $menu->getMenuItem('marketplace');
     $this->view->assign('doc_menu', $documentation);
     $this->view->assign('doc_menu_text', $this->language->get($documentation['item_text']));
     $this->view->assign('support_menu', $support);
     $this->view->assign('support_menu_text', $this->language->get($support['item_text']));
     $this->view->assign('mp_menu', $mp);
     $this->view->assign('mp_menu_text', $this->language->get($mp['item_text']));
     $this->view->assign('text_footer_left', sprintf($this->language->get('text_footer_left'), date('Y')));
     $this->view->assign('text_footer', sprintf($this->language->get('text_footer'), date('Y')) . VERSION);
     if (!$this->user->isLogged() || !isset($this->request->get['token']) || !isset($this->session->data['token']) || $this->request->get['token'] != $this->session->data['token']) {
         $this->view->assign('logged', '');
         $this->view->assign('home', $this->html->getSecureURL('index/login', '', true));
     } else {
         $this->view->assign('logged', sprintf($this->language->get('text_logged'), $this->user->getUserName()));
         $this->view->assign('avatar', $this->user->getAvatar());
         $this->view->assign('username', $this->user->getUserName());
         $this->view->assign('last_login', sprintf($this->language->get('text_last_login'), $this->user->getLastLogin()));
         $this->view->assign('account_edit', $this->html->getSecureURL('index/edit_details', '', true));
     }
     //10 new orders and customers
     $this->loadModel('sale/order');
     $this->loadModel('sale/customer');
     $filter = array('sort' => 'o.date_added', 'order' => 'DESC', 'start' => 0, 'limit' => 10);
     $top_orders = $this->model_sale_order->getOrders($filter);
     foreach ($top_orders as $indx => $order) {
         $top_orders[$indx]['url'] = $this->html->getSecureURL('sale/order/details', '&order_id=' . $order['order_id']);
         $top_orders[$indx]['total'] = $this->currency->format($order['total'], $this->config->get('config_currency'));
     }
     $this->view->assign('top_orders', $top_orders);
     $filter = array('sort' => 'c.date_added', 'order' => 'DESC', 'start' => 0, 'limit' => 10);
     $top_customers = $this->model_sale_customer->getCustomers($filter);
     foreach ($top_customers as $indx => $customer) {
         $top_customers[$indx]['url'] = $this->html->getSecureURL('sale/customer/update', '&customer_id=' . $customer['customer_id']);
     }
     $this->view->assign('top_customers', $top_customers);
     $this->view->assign('new_orders', $this->language->get('new_orders'));
     $this->view->assign('recent_customers', $this->language->get('recent_customers'));
     $this->processTemplate('common/footer.tpl');
     //update controller data
     $this->extensions->hk_UpdateData($this, __FUNCTION__);
 }
Ejemplo n.º 2
0
 public function main()
 {
     //init controller data
     $this->extensions->hk_InitData($this, __FUNCTION__);
     $this->loadLanguage('common/header');
     $menu = new AMenu('admin', 'menu');
     $documentation = $menu->getMenuItem('documentation');
     $documentation = '<a onclick="' . $documentation['item_url'] . '">' . $this->language->get($documentation['item_text']) . '</a>';
     $support = $menu->getMenuItem('support');
     $support = '<a onclick="' . $support['item_url'] . '">' . $this->language->get($support['item_text']) . '</a>';
     $this->view->assign('text_footer_left', sprintf($this->language->get('text_footer_left'), date('Y')));
     $this->view->assign('text_footer', sprintf($this->language->get('text_footer'), date('Y')) . VERSION);
     $this->view->assign('text_footer_right', $documentation . $support);
     $this->processTemplate('common/footer.tpl');
     //update controller data
     $this->extensions->hk_UpdateData($this, __FUNCTION__);
 }
Ejemplo n.º 3
0
 public function main()
 {
     //init controller data
     $this->extensions->hk_InitData($this, __FUNCTION__);
     $this->loadLanguage('common/header');
     $menu = new AMenu('admin', 'menu');
     $documentation = $menu->getMenuItem('documentation');
     $support = $menu->getMenuItem('support');
     $mp = $menu->getMenuItem('marketplace');
     $this->view->assign('doc_menu', $documentation);
     $this->view->assign('doc_menu_text', $this->language->get($documentation['item_text']));
     $this->view->assign('support_menu', $support);
     $this->view->assign('support_menu_text', $this->language->get($support['item_text']));
     $this->view->assign('mp_menu', $mp);
     $this->view->assign('mp_menu_text', $this->language->get($mp['item_text']));
     $this->view->assign('new_orders', $this->language->get('new_orders'));
     $this->view->assign('recent_customers', $this->language->get('recent_customers'));
     $this->view->assign('text_footer_left', sprintf($this->language->get('text_footer_left'), date('Y')));
     $this->view->assign('text_footer', sprintf($this->language->get('text_footer'), date('Y')) . VERSION);
     if (!$this->user->isLogged() || !isset($this->request->get['token']) || !isset($this->session->data['token']) || $this->request->get['token'] != $this->session->data['token']) {
         $this->view->assign('logged', '');
         $this->view->assign('home', $this->html->getSecureURL('index/login', '', true));
     } else {
         $this->view->assign('logged', sprintf($this->language->get('text_logged'), $this->user->getUserName()));
         $this->view->assign('avatar', $this->user->getAvatar());
         $this->view->assign('username', $this->user->getUserName());
         if ($this->user->getLastLogin()) {
             $this->view->assign('last_login', sprintf($this->language->get('text_last_login'), $this->user->getLastLogin()));
         } else {
             $this->view->assign('last_login', sprintf($this->language->get('text_welcome'), $this->user->getUserName()));
         }
         $this->view->assign('account_edit', $this->html->getSecureURL('index/edit_details', '', true));
     }
     $this->processTemplate('common/footer.tpl');
     //update controller data
     $this->extensions->hk_UpdateData($this, __FUNCTION__);
 }
<?php

/*------------------------------------------------------------------------------
  $Id$

  AbanteCart, Ideal OpenSource Ecommerce Solution
  http://www.AbanteCart.com

  Copyright © 2015 Belavier Commerce LLC

  This source file is subject to Open Software License (OSL 3.0)
  License details is bundled with this package in the file LICENSE.txt.
  It is also available at this URL:
  <http://www.opensource.org/licenses/OSL-3.0>

 UPGRADE NOTE:
   Do not edit or add to this file if you wish to upgrade AbanteCart to newer
   versions in the future. If you wish to customize AbanteCart for your
   needs please refer to http://www.AbanteCart.com for more information.
------------------------------------------------------------------------------*/
if (!defined('DIR_CORE')) {
    header('Location: static_pages/');
}
//delete menu item
$menu = new AMenu("admin");
$menu->deleteMenuItem("developer_tools");
Ejemplo n.º 5
0
   needs please refer to http://www.AbanteCart.com for more information.
------------------------------------------------------------------------------*/
if (!defined('DIR_CORE')) {
    header('Location: static_pages/');
}
// add new menu item
$rm = new AResourceManager();
$rm->setType('image');
$language_id = $this->language->getContentLanguageID();
$data = array();
$data['resource_code'] = '<i class="fa fa-picture-o"></i>&nbsp;';
$data['name'] = array($language_id => 'Menu Icon Banner Manager');
$data['title'] = array($language_id => '');
$data['description'] = array($language_id => '');
$resource_id = $rm->addResource($data);
$menu = new AMenu("admin");
$menu->insertMenuItem(array("item_id" => "banner_manager", "parent_id" => "design", "item_text" => "banner_manager_name", "item_url" => "extension/banner_manager", "item_icon_rl_id" => $resource_id, "item_type" => "extension", "sort_order" => "6"));
$data = array();
$data['resource_code'] = '<i class="fa fa-reply-all"></i>&nbsp;';
$data['name'] = array($language_id => 'Menu Icon Banner Manager Stat');
$data['title'] = array($language_id => '');
$data['description'] = array($language_id => '');
$resource_id = $rm->addResource($data);
$menu->insertMenuItem(array("item_id" => "banner_manager_stat", "parent_id" => "reports", "item_text" => "banner_manager_name_stat", "item_url" => "extension/banner_manager_stat", "item_icon_rl_id" => $resource_id, "item_type" => "extension", "sort_order" => "4"));
$sql = "SELECT block_id FROM " . $this->db->table('blocks') . " WHERE block_txt_id='banner_block'";
$result = $this->db->query($sql);
if (!$result->num_rows) {
    $this->db->query("INSERT INTO " . $this->db->table('blocks') . " (`block_txt_id`, `controller`, `date_added`)\n\t\t\t\t\t  VALUES ('banner_block', 'blocks/banner_block', NOW() );");
    $block_id = $this->db->getLastId();
    $sql = "INSERT INTO " . $this->db->table('block_templates') . " (`block_id`, `parent_block_id`, `template`, `date_added`)\n\t\t\tVALUES\n\t\t(" . $block_id . ", 1, 'blocks/banner_block_header.tpl', NOW() ),\n\t\t(" . $block_id . ", 2, 'blocks/banner_block_content.tpl', NOW() ),\n\t\t(" . $block_id . ", 3, 'blocks/banner_block.tpl', NOW() ),\n\t\t(" . $block_id . ", 4, 'blocks/banner_block_content.tpl', NOW() ),\n\t\t(" . $block_id . ", 5, 'blocks/banner_block_content.tpl', NOW() ),\n\t\t(" . $block_id . ", 6, 'blocks/banner_block.tpl', NOW() ),\n\t\t(" . $block_id . ", 7, 'blocks/banner_block_content.tpl', NOW() ),\n\t\t(" . $block_id . ", 8, 'blocks/banner_block_header.tpl', NOW() )";
    $this->db->query($sql);
Ejemplo n.º 6
0
<?php

/*------------------------------------------------------------------------------
  $Id$

  AbanteCart, Ideal OpenSource Ecommerce Solution
  http://www.AbanteCart.com

  Copyright © 2011-2014 Belavier Commerce LLC

  This source file is subject to Open Software License (OSL 3.0)
  License details is bundled with this package in the file LICENSE.txt.
  It is also available at this URL:
  <http://www.opensource.org/licenses/OSL-3.0>

 UPGRADE NOTE:
   Do not edit or add to this file if you wish to upgrade AbanteCart to newer
   versions in the future. If you wish to customize AbanteCart for your
   needs please refer to http://www.AbanteCart.com for more information.
------------------------------------------------------------------------------*/
if (!defined('DIR_CORE')) {
    header('Location: static_pages/');
}
//delete menu item
$menu = new AMenu("admin");
$menu->deleteMenuItem("banner_manager");
$menu->deleteMenuItem("banner_manager_stat");
Ejemplo n.º 7
0
<?php

/*------------------------------------------------------------------------------
  $Id$

  AbanteCart, Ideal OpenSource Ecommerce Solution
  http://www.AbanteCart.com

  Copyright © 2011-2015 Belavier Commerce LLC

  This source file is subject to Open Software License (OSL 3.0)
  Lincence details is bundled with this package in the file LICENSE.txt.
  It is also available at this URL:
  <http://www.opensource.org/licenses/OSL-3.0>

 UPGRADE NOTE:
   Do not edit or add to this file if you wish to upgrade AbanteCart to newer
   versions in the future. If you wish to customize AbanteCart for your
   needs please refer to http://www.AbanteCart.com for more information.
------------------------------------------------------------------------------*/
if (!defined('DIR_CORE')) {
    header('Location: static_pages/');
}
//delete menu item
$menu = new AMenu("admin");
$menu->deleteMenuItem("forms_manager");
Ejemplo n.º 8
0
 public function main()
 {
     //use to init controller data
     $this->extensions->hk_InitData($this, __FUNCTION__);
     $this->load->helper('html');
     $this->view->assign('breadcrumbs', $this->document->getBreadcrumbs());
     if ($this->request->is_POST() && isset($this->request->post['language_code'])) {
         unset($this->session->data['content_language']);
         $this->session->data['language'] = $this->request->post['language_code'];
         $this->cache->delete('admin_menu');
         if (!empty($this->request->post['redirect'])) {
             $this->redirect($this->request->post['redirect']);
         } else {
             $this->redirect($this->html->getURL('index/home'));
         }
     }
     $this->view->assign('language_code', $this->session->data['language']);
     $this->view->assign('languages', array());
     $this->view->assign('languages', $this->language->getActiveLanguages());
     $this->view->assign('content_language_id', $this->language->getContentLanguageID());
     $this->view->assign('language_settings', $this->html->getSecureURL('localisation/language'));
     $this->view->assign('new_messages', $this->messages->getShortList());
     $this->view->assign('messages_link', $this->html->getSecureURL('tool/message_manager'));
     $this->view->assign('action', $this->html->getSecureURL('index/home'));
     $this->view->assign('search_action', $this->html->getSecureURL('tool/global_search'));
     //redirect after language change
     if (!$this->request->get['rt'] || $this->request->get['rt'] == 'index/home') {
         $this->view->assign('redirect', $this->html->getSecureURL('index/home'));
         $this->view->assign('home_page', true);
     } else {
         $this->view->assign('home_page', false);
         $this->view->assign('redirect', HTTPS_SERVER . '?' . $_SERVER['QUERY_STRING']);
     }
     if (!$this->user->isLogged() || !isset($this->request->get['token']) || !isset($this->session->data['token']) || $this->request->get['token'] != $this->session->data['token']) {
         $this->view->assign('logged', '');
         $this->view->assign('home', $this->html->getSecureURL('index/login', '', true));
     } else {
         $this->view->assign('home', $this->html->getSecureURL('index/home', '', true));
         $this->view->assign('logged', sprintf($this->language->get('text_logged'), $this->user->getUserName()));
         $this->view->assign('avatar', $this->user->getAvatar());
         $this->view->assign('username', $this->user->getUserName());
         $this->view->assign('last_login', sprintf($this->language->get('text_last_login'), $this->user->getLastLogin()));
         $this->view->assign('account_edit', $this->html->getSecureURL('index/edit_details', '', true));
         $stores = array();
         $this->loadModel('setting/store');
         $results = $this->model_setting_store->getStores();
         foreach ($results as $result) {
             $stores[] = array('name' => $result['name'], 'href' => $result['config_url']);
         }
         $this->view->assign('stores', $stores);
         $this->view->assign('logout', $this->html->getSecureURL('index/logout'));
         $this->view->assign('store', HTTP_CATALOG);
         // add dynamic menu based on dataset scheme
         $this->addChild('common/menu', 'menu', 'common/menu.tpl');
         //Get surrent menu item
         $menu = new AMenu('admin');
         $current_menu = $menu->getMenuByRT($this->request->get['rt']);
         if ($current_menu['item_icon_rl_id']) {
             $rm = new AResourceManager();
             $rm->setType('image');
             $resource = $rm->getResource($current_menu['item_icon_rl_id']);
             $current_menu['icon'] = $resource['resource_code'];
         }
         unset($current_menu['item_icon_rl_id']);
         $this->view->assign('current_menu', $current_menu);
     }
     if ($this->user->isLogged()) {
         $ant_message = $this->messages->getANTMessage();
         $this->view->assign('ant', $ant_message['html']);
         $this->view->assign('mark_read_url', $this->html->getSecureURL('common/common/antMessageRead', '&message_id=' . $ant_message['id']));
         $this->view->assign('ant_viewed', $ant_message['viewed']);
     }
     $this->view->assign('config_voicecontrol', $this->config->get('config_voicecontrol'));
     $this->view->assign('voicecontrol_setting_url', $this->html->getSecureURL('setting/setting/system'));
     $this->view->assign('command_lookup_url', $this->html->getSecureURL('common/action_commands'));
     $this->view->assign('search_suggest_url', $this->html->getSecureURL('listing_grid/global_search_result/suggest'));
     $this->view->assign('search_everywhere', $this->language->get('search_everywhere'));
     $this->view->assign('text_all_matches', $this->language->get('text_all_matches'));
     $this->view->assign('dialog_title', $this->language->get('text_quick_edit_form'));
     $this->view->assign('button_go', $this->html->buildButton(array('name' => 'searchform_go', 'text' => $this->language->get('button_go'), 'style' => 'button5')));
     //check if install dir existing. warn
     if (file_exists(DIR_ROOT . '/install')) {
         $this->messages->saveWarning($this->language->get('text_install_warning_subject'), $this->language->get('text_install_warning'));
     }
     //backwards compatability from 1.2.1. Can remove this check in the future.
     if (!defined('ENCRYPTION_KEY')) {
         $cmbody = "To be compatible with v" . VERSION . " add below line to configuration file: <br>\n" . DIR_ROOT . '/system/config.php';
         $cmbody .= "<br>\n" . "define('ENCRYPTION_KEY', '" . $this->config->get('encryption_key') . "');\n";
         $this->messages->saveWarning('Compatibility warning for v' . VERSION, $cmbody);
     }
     //prepare quick stats
     $this->loadModel('tool/online_now');
     $online_new = $this->model_tool_online_now->getTotalTodayOnline('new');
     $online_registered = $this->model_tool_online_now->getTotalTodayOnline('registered');
     $this->view->assign('online_new', $online_new);
     $this->view->assign('online_registered', $online_registered);
     $this->loadModel('report/sale');
     $data = array('filter' => array('date_start' => dateISO2Display(date('Y-m-d', time()), $this->language->get('date_format_short')), 'date_end' => dateISO2Display(date('Y-m-d', time()), $this->language->get('date_format_short'))));
     $today_orders = $this->model_report_sale->getSaleReportSummary($data);
     $today_order_count = $today_orders['orders'];
     $today_sales_amount = $this->currency->format($today_orders['total_amount'], $this->config->get('config_currency'));
     $this->view->assign('today_order_count', $today_order_count);
     $this->view->assign('today_sales_amount', $today_sales_amount);
     $this->loadModel('sale/customer');
     $filter = array('date_added' => date('Y-m-d', time()));
     $today_customer_count = $this->model_sale_customer->getTotalCustomers(array('filter' => $filter));
     $this->view->assign('today_customer_count', $today_customer_count);
     $this->loadModel('catalog/review');
     $today_review_count = $this->model_catalog_review->getTotalToday();
     $this->view->assign('today_review_count', $today_review_count);
     $this->processTemplate('common/header.tpl');
     //use to update data before render
     $this->extensions->hk_UpdateData($this, __FUNCTION__);
 }
Ejemplo n.º 9
0
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = AMenu::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
 private function _command_open($request)
 {
     //some menu text
     $this->load->language('common/header');
     //return format (array): url =>, title =>, confirmation => (true, false)
     $result = array();
     //remove junk words
     $request = preg_replace('/menu|tab|page/', '', $request);
     $request = trim($request);
     //look for page in the menu matching
     $menu = new AMenu('admin');
     $menu_arr = $menu->getMenuItems();
     if (count($menu_arr)) {
         foreach ($menu_arr as $section_menu) {
             $sub_res = array();
             if (is_array($section_menu)) {
                 foreach ($section_menu as $menu) {
                     //load language for prospect controller
                     //Check that filename has proper name with no other special characters.
                     if (preg_match("/[\\W]+/", str_replace('/', '_', $menu['item_url']))) {
                         $title = $this->language->get($menu['item_text']);
                     } else {
                         $this->load->language($menu['item_url'], 'silent');
                         $title = $this->language->get($menu['item_text']) . " / " . $this->language->get('heading_title');
                     }
                     if (preg_match("/{$request}/iu", $title)) {
                         $sub_res["title"] = $title;
                         $sub_res["url"] = $this->html->getSecureURL($menu['item_url']);
                         $sub_res["confirmation"] = false;
                         $result[] = $sub_res;
                     }
                 }
             }
         }
     }
     return $result;
 }
<?php

/*------------------------------------------------------------------------------
  $Id$

  AbanteCart, Ideal OpenSource Ecommerce Solution
  http://www.AbanteCart.com

  Copyright © 2011 Belavier Commerce LLC

  This source file is subject to Open Software License (OSL 3.0)
  License details is bundled with this package in the file LICENSE.txt.
  It is also available at this URL:
  <http://www.opensource.org/licenses/OSL-3.0>

 UPGRADE NOTE:
   Do not edit or add to this file if you wish to upgrade AbanteCart to newer
   versions in the future. If you wish to customize AbanteCart for your
   needs please refer to http://www.AbanteCart.com for more information.
------------------------------------------------------------------------------*/
if (!defined('DIR_CORE')) {
    header('Location: static_pages/');
}
// add new menu item
$menu = new AMenu("admin");
$menu->insertMenuItem(array("item_id" => "developer_tools", "parent_id" => "system", "item_text" => "developer_tools_name", "item_url" => "tool/developer_tools", "item_type" => "extension", "sort_order" => "20"));
Ejemplo n.º 12
0
  <http://www.opensource.org/licenses/OSL-3.0>

 UPGRADE NOTE:
   Do not edit or add to this file if you wish to upgrade AbanteCart to newer
   versions in the future. If you wish to customize AbanteCart for your
   needs please refer to http://www.AbanteCart.com for more information.
------------------------------------------------------------------------------*/
if (!defined('DIR_CORE')) {
    header('Location: static_pages/');
}
// add new menu item
$rm = new AResourceManager();
$rm->setType('image');
$language_id = $this->language->getContentLanguageID();
$data = array();
$data['resource_code'] = '<i class="fa fa-list"></i>&nbsp;';
$data['name'] = array($language_id => 'Menu Icon Forms Manager');
$data['title'] = array($language_id => '');
$data['description'] = array($language_id => '');
$resource_id = $rm->addResource($data);
$menu = new AMenu("admin");
$menu->insertMenuItem(array("item_id" => "forms_manager", "parent_id" => "design", "item_text" => "forms_manager_name", "item_url" => "tool/forms_manager", "item_icon_rl_id" => $resource_id, "item_type" => "extension", "sort_order" => "7"));
$sql = "SELECT block_id\n\t\tFROM " . $this->db->table('blocks') . "\n\t\tWHERE block_txt_id='custom_form_block'";
$result = $this->db->query($sql);
if (!$result->num_rows) {
    $this->db->query("INSERT INTO " . $this->db->table('blocks') . " (`block_txt_id`, `controller`, `date_added`)\n\t\t\t\t\t  VALUES ('custom_form_block', 'blocks/custom_form_block', NOW() );");
    $block_id = $this->db->getLastId();
    $sql = "\n\t\tINSERT INTO " . $this->db->table('block_templates') . "\n\t\t\t(`block_id`, `parent_block_id`, `template`, `date_added`)\n\t\tVALUES\n\t\t\t(" . $block_id . ", 1, 'blocks/custom_form_block_header.tpl', NOW() ),\n\t\t\t(" . $block_id . ", 2, 'blocks/custom_form_block_content.tpl', NOW() ),\n\t\t\t(" . $block_id . ", 3, 'blocks/custom_form_block.tpl', NOW() ),\n\t\t\t(" . $block_id . ", 4, 'blocks/custom_form_block_content.tpl', NOW() ),\n\t\t\t(" . $block_id . ", 5, 'blocks/custom_form_block_content.tpl', NOW() ),\n\t\t\t(" . $block_id . ", 6, 'blocks/custom_form_block.tpl', NOW() ),\n\t\t\t(" . $block_id . ", 7, 'blocks/custom_form_block_content.tpl', NOW() ),\n\t\t\t(" . $block_id . ", 8, 'blocks/custom_form_block_header.tpl', NOW() )";
    $this->db->query($sql);
    $this->cache->delete('layout.blocks');
}