本文整理汇总了PHP中AForm类的典型用法代码示例。如果您正苦于以下问题:PHP AForm类的具体用法?PHP AForm怎么用?PHP AForm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AForm类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
public function main()
{
//init controller data
$this->extensions->hk_InitData($this, __FUNCTION__);
$this->document->setTitle($this->language->get('heading_title'));
$this->document->initBreadcrumb();
$this->document->addBreadcrumb(array('href' => $this->html->getSecureURL('index/home'), 'text' => $this->language->get('text_home'), 'separator' => FALSE));
$this->document->addBreadcrumb(array('href' => $this->html->getSecureURL('tool/message_manager'), 'text' => $this->language->get('heading_title'), 'separator' => ' :: '));
$grid_settings = array('table_id' => 'message_grid', 'url' => $this->html->getSecureURL('listing_grid/message_grid'), 'editurl' => $this->html->getSecureURL('listing_grid/message_grid/update'), 'update_field' => $this->html->getSecureURL('listing_grid/message_grid/update_field'), 'sortname' => 'status', 'actions' => array(), 'columns_search' => false, 'sortable' => true, 'multiaction_options' => array('delete' => $this->language->get('text_delete_selected')));
$grid_settings['colNames'] = array($this->language->get('column_status'), $this->language->get('column_title'), $this->language->get('column_create_date'), $this->language->get('column_action'));
$grid_settings['colModel'] = array(array('name' => 'status', 'index' => 'status', 'width' => 50, 'align' => 'center', 'sorttype' => 'string'), array('name' => 'title', 'index' => 'title', 'width' => 250, 'align' => 'left', 'sorttype' => 'string'), array('name' => 'create_date', 'index' => 'create_date', 'width' => 70, 'align' => 'center', 'sorttype' => 'string'), array('name' => 'action', 'index' => 'action', 'width' => 70, 'align' => 'center', 'sorttype' => 'string'));
$form = new AForm('ff');
$grid = $this->dispatch('common/listing_grid', array($grid_settings));
$this->view->assign('listing_grid', $grid->dispatchGetOutput());
$this->view->assign('popup_action', $this->html->getSecureURL('listing_grid/message_grid/update'));
$this->view->assign('notifier', $this->html->getSecureURL('listing_grid/message_grid/getNotify'));
$this->view->assign('status', $this->language->get('text_status'));
$this->view->assign('status_field', $form->getFieldHtml(array('type' => 'input', 'name' => 'msg_status', 'id' => 'msg_status', 'attr' => 'disabled readonly ')));
$this->view->assign('create_date', $this->language->get('text_date'));
$this->view->assign('create_date_field', $form->getFieldHtml(array('type' => 'input', 'name' => 'msg_create_date', 'id' => 'msg_create_date', 'attr' => 'disabled readonly ')));
$this->view->assign('repeats', $this->language->get('text_repeats'));
$this->view->assign('repeat_field', $form->getFieldHtml(array('type' => 'input', 'name' => 'msg_repeat', 'id' => 'msg_repeat', 'attr' => 'disabled readonly ')));
$this->view->assign('delete', $this->language->get('text_delete'));
$this->view->assign('close', $this->language->get('text_close'));
$this->view->assign('confirm', $this->language->get('text_confirm'));
$this->view->batchAssign($this->language->getASet());
$this->view->assign('help_url', $this->gen_help_url());
$this->processTemplate('pages/tool/message_manager.tpl');
//update controller data
$this->extensions->hk_UpdateData($this, __FUNCTION__);
}
示例2: main
public function main()
{
//init controller data
$this->extensions->hk_InitData($this, __FUNCTION__);
$this->document->setTitle($this->language->get('heading_title'));
$this->document->initBreadcrumb(array('href' => $this->html->getSecureURL('index/home'), 'text' => $this->language->get('text_home'), 'separator' => FALSE));
$this->document->addBreadcrumb(array('href' => $this->html->getSecureURL('tool/cache'), 'text' => $this->language->get('heading_title'), 'separator' => ' :: ', 'current' => true));
$this->data['sections'] = array(array('id' => 'configuration', 'text' => $this->language->get('text_configuration'), 'description' => $this->language->get('desc_configuration'), 'keywords' => 'settings,store,stores,attribute,attributes,length_class,contents,tax_class,order_status,stock_status,weight_class,storefront_menu,tables'), array('id' => 'layout', 'text' => $this->language->get('text_layouts_blocks'), 'description' => $this->language->get('desc_layouts_blocks'), 'keywords' => 'layout'), array('id' => 'flexyforms', 'text' => $this->language->get('text_flexyforms'), 'description' => $this->language->get('desc_flexyforms'), 'keywords' => 'forms'), array('id' => 'translation', 'text' => $this->language->get('text_translations'), 'description' => $this->language->get('desc_translations'), 'keywords' => 'lang'), array('id' => 'image', 'text' => $this->language->get('text_images'), 'description' => $this->language->get('desc_images'), 'keywords' => 'image,resources'), array('id' => 'product', 'text' => $this->language->get('text_products'), 'description' => $this->language->get('desc_products'), 'keywords' => 'product'), array('id' => 'category', 'text' => $this->language->get('text_categories'), 'description' => $this->language->get('desc_categories'), 'keywords' => 'category'), array('id' => 'manufacturer', 'text' => $this->language->get('text_manufacturers'), 'description' => $this->language->get('desc_manufacturers'), 'keywords' => 'manufacturer'), array('id' => 'localisation', 'text' => $this->language->get('text_localisations'), 'description' => $this->language->get('desc_localisations'), 'keywords' => 'currency,country,zone,language'), array('id' => 'error_log', 'text' => $this->language->get('text_error_log'), 'description' => $this->language->get('desc_error_log'), 'keywords' => 'error_log'));
$form = new AForm('ST');
$form->setForm(array('form_name' => 'cacheFrm'));
$this->data['form']['form_open'] = $form->getFieldHtml(array('type' => 'form', 'name' => 'cacheFrm', 'action' => $this->html->getSecureURL('tool/cache/delete')));
$this->data['form']['submit'] = $form->getFieldHtml(array('type' => 'button', 'name' => 'submit', 'text' => $this->language->get('text_clear_cache'), 'style' => 'button1'));
if (isset($this->error['warning'])) {
$this->data['error_warning'] = $this->error['warning'];
} else {
$this->data['error_warning'] = '';
}
if (isset($this->session->data['success'])) {
$this->data['success'] = $this->session->data['success'];
unset($this->session->data['success']);
} else {
$this->data['success'] = '';
}
$this->view->batchAssign($this->data);
$this->view->assign('help_url', $this->gen_help_url());
$this->processTemplate('pages/tool/cache.tpl');
//update controller data
$this->extensions->hk_UpdateData($this, __FUNCTION__);
}
示例3: main
public function main()
{
$this->loadModel('tool/developer_tools');
$this->loadLanguage('developer_tools/developer_tools');
$prj_id = func_get_arg(0);
$prj_config = $this->model_tool_developer_tools->getProjectConfig($prj_id);
$this->data['text_layout_xml_tab'] = $this->language->get('text_layout_xml_tab');
$this->data['text_select_template'] = $this->language->get('text_select_template');
$this->data['filepath'] = DIR_EXT . $prj_config['extension_txt_id'] . '/layout.xml';
$this->data['relative_path'] = 'extensions/' . $prj_config['extension_txt_id'] . '/layout.xml';
$exist = file_exists($this->data['filepath']) ? true : false;
if ($exist) {
$this->data['text_view_layout_xml'] = $this->language->get('text_view_layout_xml');
}
$result = $this->db->query("SELECT DISTINCT template_id\n\t\t\t\t\t\t\t\t\tFROM " . DB_PREFIX . "layouts");
foreach ($result->rows as $row) {
$templates[$row['template_id']] = $row['template_id'];
}
$form = new AForm('ST');
$form->setForm(array('form_name' => 'extLayoutFrm', 'update' => ''));
$this->data['form']['id'] = 'extLayoutFrm';
$this->data['form']['form_open'] = $form->getFieldHtml(array('type' => 'form', 'name' => 'extLayoutFrm', 'action' => $this->data['action']));
$this->data['form']['submit'] = $form->getFieldHtml(array('type' => 'button', 'name' => 'submit', 'text' => $this->language->get('text_save_layout_xml'), 'style' => 'button1'));
$this->data['form']['template'] = $form->getFieldHtml(array('type' => 'selectbox', 'name' => 'template_id', 'options' => $templates, 'value' => $prj_config['extension_txt_id']));
$this->data['xml_build_url'] = $this->html->getSecureUrl('tool/developer_tools_other/savelayoutxml', '&prj_id=' . $prj_id);
$this->data['text_save_layout_xml'] = $this->language->get('text_save_layout_xml');
$this->view->batchAssign($this->data);
$this->processTemplate('responses/tool/developer_tools_other.tpl');
}
示例4: main
public function main()
{
//init controller data
$this->extensions->hk_InitData($this, __FUNCTION__);
if (!$this->customer->isLogged()) {
$this->session->data['redirect'] = $this->html->getSecureURL('account/newsletter');
$this->redirect($this->html->getSecureURL('account/login'));
}
$this->document->setTitle($this->language->get('heading_title'));
if ($this->request->is_POST()) {
$this->loadModel('account/customer');
$this->model_account_customer->editNewsletter($this->request->post['newsletter']);
$this->session->data['success'] = $this->language->get('text_success');
$this->redirect($this->html->getURL('account/account'));
}
$this->document->resetBreadcrumbs();
$this->document->addBreadcrumb(array('href' => $this->html->getURL('index/home'), 'text' => $this->language->get('text_home'), 'separator' => FALSE));
$this->document->addBreadcrumb(array('href' => $this->html->getURL('account/account'), 'text' => $this->language->get('text_account'), 'separator' => $this->language->get('text_separator')));
$this->document->addBreadcrumb(array('href' => $this->html->getURL('account/newsletter'), 'text' => $this->language->get('text_newsletter'), 'separator' => $this->language->get('text_separator')));
$form = new AForm();
$form->setForm(array('form_name' => 'newsFrm'));
$this->data['form']['form_open'] = $form->getFieldHtml(array('type' => 'form', 'name' => 'newsFrm', 'action' => $this->html->getSecureURL('account/newsletter')));
$this->data['form']['newsletter'] = $form->getFieldHtml(array('type' => 'radio', 'name' => 'newsletter', 'value' => $this->customer->getNewsletter(), 'options' => array('1' => $this->language->get('text_yes'), '0' => $this->language->get('text_no'))));
$this->data['form']['continue'] = $form->getFieldHtml(array('type' => 'submit', 'icon' => 'fa fa-check', 'name' => $this->language->get('button_continue')));
$this->data['back'] = $this->html->getURL('account/account');
$back = HtmlElementFactory::create(array('type' => 'button', 'name' => 'back', 'text' => $this->language->get('button_back'), 'icon' => 'fa fa-arrow-left', 'style' => 'button'));
$this->data['form']['back'] = $back;
$this->view->batchAssign($this->data);
$this->processTemplate('pages/account/newsletter.tpl');
//init controller data
$this->extensions->hk_UpdateData($this, __FUNCTION__);
}
示例5: main
public function main()
{
//init controller data
$this->extensions->hk_InitData($this, __FUNCTION__);
$this->document->setTitle($this->language->get('heading_title'));
$this->document->initBreadcrumb();
$this->document->addBreadcrumb(array('href' => $this->html->getSecureURL('index/home'), 'text' => $this->language->get('text_home'), 'separator' => FALSE));
$this->document->addBreadcrumb(array('href' => $this->html->getSecureURL('tool/datasets_manager'), 'text' => $this->language->get('heading_title'), 'separator' => ' :: ', 'current' => true));
$grid_settings = array('table_id' => 'dataset_grid', 'url' => $this->html->getSecureURL('listing_grid/datasets_grid'), 'editurl' => $this->html->getSecureURL('listing_grid/datasets_grid/update'), 'update_field' => $this->html->getSecureURL('listing_grid/datasets_grid/update_field'), 'sortname' => 'dataset_id', 'actions' => array('view' => array('text' => $this->language->get('text_show'), 'href' => $this->html->getSecureURL('listing_grid/datasets_grid/info', '&dataset_id=%ID%'))), 'columns_search' => false, 'sortable' => true, 'multiselect' => 'false', 'grid_ready' => 'grid_ready();');
$grid_settings['colNames'] = array($this->language->get('column_id'), $this->language->get('column_name'), $this->language->get('column_key'));
$grid_settings['colModel'] = array(array('name' => 'dataset_id', 'index' => 'dataset_id', 'width' => 30, 'align' => 'center', 'sorttype' => 'string'), array('name' => 'dataset_name', 'index' => 'dataset_name', 'width' => 450, 'align' => 'left', 'sorttype' => 'string'), array('name' => 'dataset_key', 'index' => 'dataset_key', 'width' => 150, 'align' => 'left', 'sorttype' => 'string'));
$form = new AForm('ds');
$grid = $this->dispatch('common/listing_grid', array($grid_settings));
$this->view->assign('listing_grid', $grid->dispatchGetOutput());
$this->view->assign('popup_action', $this->html->getSecureURL('listing_grid/datasets_grid/info'));
$this->view->assign('popup_title', $this->language->get('text_popup_title'));
$this->view->assign('date_added', $this->language->get('text_date'));
$this->view->assign('create_date_field', $form->getFieldHtml(array('type' => 'input', 'name' => 'msg_create_date', 'id' => 'msg_create_date', 'attr' => 'readonly=true')));
$this->view->assign('repeats', $this->language->get('text_repeats'));
$this->view->assign('repeat_field', $form->getFieldHtml(array('type' => 'input', 'name' => 'msg_repeat', 'id' => 'msg_repeat', 'attr' => 'readonly=true')));
//$this->view->assign ( 'delete', $this->language->get ( 'text_delete' ) );
$this->view->assign('confirm', $this->language->get('text_confirm'));
$this->view->batchAssign($this->language->getASet());
$this->view->assign('help_url', $this->gen_help_url());
$this->processTemplate('pages/tool/datasets_manager.tpl');
//update controller data
$this->extensions->hk_UpdateData($this, __FUNCTION__);
}
示例6: main
public function main()
{
$this->data = array();
$run_level = $this->request->get['runlevel'];
if (isset($run_level)) {
if (!in_array((int) $run_level, array(1, 2, 3, 4, 5))) {
$this->redirect(HTTP_SERVER . 'index.php?rt=activation' . '&admin_path=' . $this->request->post['admin_path']);
}
if (!$this->session->data['install_step_data'] && (int) $run_level == 1) {
if (filesize(DIR_ABANTECART . 'system/config.php')) {
$this->redirect(HTTP_SERVER . 'index.php?rt=activation');
} else {
$this->redirect(HTTP_SERVER . 'index.php?rt=license');
}
}
echo $this->runlevel((int) $run_level);
return null;
}
if ($this->request->is_POST() && $this->_validate()) {
$this->session->data['install_step_data'] = $this->request->post;
$this->redirect(HTTP_SERVER . 'index.php?rt=install&runlevel=1');
}
$this->data['error'] = $this->error;
$this->data['action'] = HTTP_SERVER . 'index.php?rt=install';
$fields = array('db_driver', 'db_host', 'db_user', 'db_password', 'db_name', 'db_prefix', 'username', 'password', 'password_confirm', 'email', 'admin_path');
$defaults = array('', 'localhost', '', '', '', 'abc_', 'admin', '', '', '', '');
$place_holder = array('Select Database Driver', 'Enter Database Hostname', 'Enter Database Username', 'Enter Password, if any', 'Enter Database Name', 'Add prefix to database tables', 'Enter new admin username', 'Enter Secret Admin Password', 'Repeat the password', 'Provide valid email of administrator', 'Enter your secret admin key');
foreach ($fields as $k => $field) {
if (isset($this->request->post[$field])) {
$this->data[$field] = $this->request->post[$field];
} else {
$this->data[$field] = $defaults[$k];
}
}
$form = new AForm('ST');
$form->setForm(array('form_name' => 'form', 'update' => ''));
$this->data['form']['id'] = 'form';
$this->data['form']['form_open'] = $form->getFieldHtml(array('type' => 'form', 'name' => 'editFrm', 'action' => $this->data['action']));
foreach ($fields as $k => $field) {
if ($field != 'db_driver') {
$this->data['form'][$field] = $form->getFieldHtml(array('type' => in_array($field, array('password', 'password_confirm')) ? 'password' : 'input', 'name' => $field, 'value' => $this->data[$field], 'placeholder' => $place_holder[$k], 'required' => in_array($field, array('db_host', 'db_user', 'db_name', 'username', 'password', 'password_confirm', 'email', 'admin_path'))));
} else {
$options = array();
//regular mysql is not supported on PHP 5.5.+
if (extension_loaded('mysql') && version_compare(phpversion(), '5.5.0', '<') == TRUE) {
$options['mysql'] = 'MySQL';
}
if (extension_loaded('mysqli')) {
$options['amysqli'] = 'MySQLi';
}
$this->data['form'][$field] = $form->getFieldHtml(array('type' => 'selectbox', 'name' => $field, 'value' => $this->data[$field], 'options' => $options, 'required' => true));
}
}
$this->view->assign('back', HTTP_SERVER . 'index.php?rt=settings');
$this->addChild('common/header', 'header', 'common/header.tpl');
$this->addChild('common/footer', 'footer', 'common/footer.tpl');
$this->view->batchAssign($this->data);
$this->processTemplate('pages/install.tpl');
}
示例7: main
public function main()
{
//init controller data
$this->extensions->hk_InitData($this, __FUNCTION__);
$this->loadLanguage('catalog/product');
$this->document->setTitle($this->language->get('heading_title'));
$this->loadModel('catalog/product');
$this->loadModel('tool/image');
if (isset($this->request->get['product_id'])) {
$product_info = $this->model_catalog_product->getProduct($this->request->get['product_id']);
if (!$product_info) {
$this->session->data['warning'] = $this->language->get('error_product_not_found');
$this->redirect($this->html->getSecureURL('catalog/product'));
}
}
if ($this->request->server['REQUEST_METHOD'] == 'POST') {
$this->model_catalog_product->updateProductImages($this->request->get['product_id'], $this->request->post);
$this->session->data['success'] = $this->language->get('text_success');
$this->redirect($this->html->getSecureURL('catalog/product_images', '&product_id=' . $this->request->get['product_id']));
}
$this->data['product_description'] = $this->model_catalog_product->getProductDescriptions($this->request->get['product_id']);
$this->view->assign('error_warning', $this->error['warning']);
$this->view->assign('success', $this->session->data['success']);
if (isset($this->session->data['success'])) {
unset($this->session->data['success']);
}
$this->document->initBreadcrumb(array('href' => $this->html->getSecureURL('index/home'), 'text' => $this->language->get('text_home'), 'separator' => FALSE));
$this->document->addBreadcrumb(array('href' => $this->html->getSecureURL('catalog/product'), 'text' => $this->language->get('heading_title'), 'separator' => ' :: '));
$this->document->addBreadcrumb(array('href' => $this->html->getSecureURL('catalog/product/update', '&product_id=' . $this->request->get['product_id']), 'text' => $this->language->get('text_edit') . ' ' . $this->language->get('text_product') . ' - ' . $this->data['product_description'][$this->session->data['content_language_id']]['name'], 'separator' => ' :: '));
$this->document->addBreadcrumb(array('href' => $this->html->getSecureURL('catalog/product_images', '&product_id=' . $this->request->get['product_id']), 'text' => $this->language->get('tab_media'), 'separator' => ' :: '));
$this->data['no_image'] = $this->model_tool_image->resize('no_image.jpg', 100, 100);
$this->data['active'] = 'images';
//load tabs controller
$tabs_obj = $this->dispatch('pages/catalog/product_tabs', array($this->data));
$this->data['product_tabs'] = $tabs_obj->dispatchGetOutput();
unset($tabs_obj);
$this->data['button_add_image'] = $this->html->buildButton(array('text' => $this->language->get('button_add_image'), 'style' => 'button1'));
$this->data['action'] = $this->html->getSecureURL('catalog/product_images', '&product_id=' . $this->request->get['product_id']);
$this->data['form_title'] = $this->language->get('text_edit') . ' ' . $this->language->get('text_product');
$this->data['update'] = '';
$form = new AForm('HS');
$form->setForm(array('form_name' => 'productFrm', 'update' => $this->data['update']));
$this->data['form']['id'] = 'productFrm';
$this->data['form']['form_open'] = $form->getFieldHtml(array('type' => 'form', 'name' => 'productFrm', 'action' => $this->data['action']));
$this->data['form']['submit'] = $form->getFieldHtml(array('type' => 'button', 'name' => 'submit', 'text' => $this->language->get('button_save'), 'style' => 'button1'));
$this->data['form']['cancel'] = $form->getFieldHtml(array('type' => 'button', 'name' => 'cancel', 'text' => $this->language->get('button_cancel'), 'style' => 'button2'));
$this->view->batchAssign($this->data);
$this->view->assign('help_url', $this->gen_help_url('product_media'));
$this->addChild('pages/catalog/product_summary', 'summary_form', 'pages/catalog/product_summary.tpl');
$this->addChild('responses/common/resource_library/get_resources_html', 'resources_html', 'responses/common/resource_library_scripts.tpl');
$resources_scripts = $this->dispatch('responses/common/resource_library/get_resources_scripts', array('object_name' => 'products', 'object_id' => $this->request->get['product_id'], 'types' => array('image', 'audio', 'video', 'pdf')));
$this->view->assign('resources_scripts', $resources_scripts->dispatchGetOutput());
$this->processTemplate('pages/catalog/product_images.tpl');
//update controller data
$this->extensions->hk_UpdateData($this, __FUNCTION__);
}
示例8: main
public function main()
{
$this->loadLanguage('blocks/newsletter_signup');
$form = new AForm();
$this->data['form_open'] = $form->getFieldHtml(array('type' => 'form', 'name' => 'subscribeFrm', 'method' => 'get', 'action' => $this->html->getSecureURL('account/subscriber', '', true)));
$this->data['heading_title'] = $this->language->get('heading_title');
$this->data['text_signup'] = $this->language->get('text_signup');
$this->data['text_sign_in'] = $this->language->get('text_sign_in');
$this->data['text_subscribe'] = $this->language->get('text_subscribe');
$this->data['form_fields']['rt'] = 'account/subscriber';
$this->view->batchAssign($this->data);
$this->processTemplate();
}
示例9: main
public function main()
{
//init controller data
$this->extensions->hk_InitData($this, __FUNCTION__);
$grid_settings = array('table_id' => 'report_sales_grid', 'url' => $this->html->getSecureURL('listing_grid/report_sale'), 'sortname' => 'date_end', 'columns_search' => false, 'multiselect' => 'false');
$form = new AForm();
$form->setForm(array('form_name' => 'report_sales_grid_search'));
$this->data['grid_search_form'] = array();
$this->data['grid_search_form']['id'] = 'report_sales_grid_search';
$this->data['grid_search_form']['form_open'] = $form->getFieldHtml(array('type' => 'form', 'name' => 'report_sales_grid_search', 'action' => ''));
$this->data['grid_search_form']['submit'] = $form->getFieldHtml(array('type' => 'button', 'name' => 'submit', 'text' => $this->language->get('button_go'), 'style' => 'button1'));
$this->data['grid_search_form']['reset'] = $form->getFieldHtml(array('type' => 'button', 'name' => 'reset', 'text' => $this->language->get('button_reset'), 'style' => 'button2'));
$this->view->assign('js_date_format', format4Datepicker($this->language->get('date_format_short')));
$this->data['grid_search_form']['fields']['date_start'] = $form->getFieldHtml(array('type' => 'input', 'name' => 'date_start', 'default' => dateInt2Display(strtotime('-7 day'))));
$this->data['grid_search_form']['fields']['date_end'] = $form->getFieldHtml(array('type' => 'input', 'name' => 'date_end', 'default' => dateInt2Display(time())));
$groups = array();
$groups['year'] = $this->language->get('text_year');
$groups['month'] = $this->language->get('text_month');
$groups['week'] = $this->language->get('text_week');
$groups['day'] = $this->language->get('text_day');
$this->data['grid_search_form']['fields']['status'] = $form->getFieldHtml(array('type' => 'selectbox', 'name' => 'group', 'options' => $groups, 'value' => "week"));
$grid_settings['search_form'] = true;
$grid_settings['colNames'] = array($this->language->get('column_date_start'), $this->language->get('column_date_end'), $this->language->get('column_orders'), $this->language->get('column_total'));
$grid_settings['colModel'] = array(array('name' => 'date_start', 'index' => 'date_start', 'width' => 100, 'align' => 'center', 'sorttype' => 'string'), array('name' => 'date_end', 'index' => 'date_end', 'width' => 100, 'align' => 'center', 'sorttype' => 'string'), array('name' => 'orders', 'index' => 'orders', 'width' => 100, 'align' => 'center', 'sorttype' => 'string'), array('name' => 'total', 'index' => 'total', 'width' => 110, 'align' => 'right'));
$grid = $this->dispatch('common/listing_grid', array($grid_settings));
$this->view->assign('listing_grid', $grid->dispatchGetOutput());
$this->view->assign('search_form', $this->data['grid_search_form']);
$this->document->setTitle($this->language->get('heading_title'));
$this->document->initBreadcrumb(array('href' => $this->html->getSecureURL('index/home'), 'text' => $this->language->get('text_home'), 'separator' => FALSE));
$this->document->addBreadcrumb(array('href' => $this->html->getSecureURL('report/viewed'), 'text' => $this->language->get('heading_title'), 'separator' => ' :: '));
$this->document->addScript(RDIR_TEMPLATE . 'javascript/jquery/ui/jquery.ui.datepicker.js');
$this->processTemplate('pages/report/sale.tpl');
//update controller data
$this->extensions->hk_UpdateData($this, __FUNCTION__);
}
示例10: download
public function download()
{
//init controller data
$this->extensions->hk_InitData($this, __FUNCTION__);
if ($this->user->canAccess('tool/files')) {
$filename = str_replace(array('../', '..\\', '\\', '/'), '', $this->request->get['filename']);
if ($this->request->get['attribute_type'] == 'field') {
$this->loadModel('tool/file_uploads');
$attribute_data = $this->model_tool_file_uploads->getField($this->request->get['attribute_id']);
} elseif (strpos($this->request->get['attribute_type'], 'AForm:') === 0) {
// for aform fields
$form_info = explode(':', $this->request->get['attribute_type']);
$aform = new AForm('ST');
$aform->loadFromDb($form_info[1]);
$attribute_data = $aform->getField($form_info[2]);
} elseif ($this->request->get['order_option_id']) {
$this->loadModel('sale/order');
$attribute_data = $this->model_sale_order->getOrderOption($this->request->get['order_option_id']);
$attribute_data['settings'] = unserialize($attribute_data['settings']);
} else {
$am = new AAttribute($this->request->get['attribute_type']);
$attribute_data = $am->getAttribute($this->request->get['attribute_id']);
}
if (has_value($attribute_data['settings']['directory'])) {
$file = DIR_APP_SECTION . 'system/uploads/' . $attribute_data['settings']['directory'] . '/' . $filename;
} else {
$file = DIR_APP_SECTION . 'system/uploads/' . $filename;
}
if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/x-gzip');
header('Content-Disposition: attachment; filename=' . $filename);
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
ob_end_clean();
flush();
readfile($file);
exit;
} else {
echo 'Error: File ' . $file . ' does not exists!';
exit;
}
} else {
return $this->dispatch('error/permission');
}
}
示例11: main
public function main()
{
//init controller data
$this->extensions->hk_InitData($this, __FUNCTION__);
$this->document->setTitle($this->language->get('heading_title'));
$this->loadModel('setting/setting');
if ($this->request->is_POST() && $this->_validate()) {
$this->model_setting_setting->editSetting('sub_total', $this->request->post);
$this->session->data['success'] = $this->language->get('text_success');
$this->redirect($this->html->getSecureURL('total/sub_total'));
}
if (isset($this->error['warning'])) {
$this->data['error_warning'] = $this->error['warning'];
} else {
$this->data['error_warning'] = '';
}
$this->data['success'] = $this->session->data['success'];
if (isset($this->session->data['success'])) {
unset($this->session->data['success']);
}
$this->document->initBreadcrumb(array('href' => $this->html->getSecureURL('index/home'), 'text' => $this->language->get('text_home'), 'separator' => FALSE));
$this->document->addBreadcrumb(array('href' => $this->html->getSecureURL('extension/total'), 'text' => $this->language->get('text_total'), 'separator' => ' :: '));
$this->document->addBreadcrumb(array('href' => $this->html->getSecureURL('total/sub_total'), 'text' => $this->language->get('heading_title'), 'separator' => ' :: ', 'current' => true));
foreach ($this->fields as $f) {
if (isset($this->request->post[$f])) {
$this->data[$f] = $this->request->post[$f];
} else {
$this->data[$f] = $this->config->get($f);
}
}
$this->data['action'] = $this->html->getSecureURL('total/sub_total');
$this->data['cancel'] = $this->html->getSecureURL('extension/total');
$this->data['heading_title'] = $this->language->get('text_edit') . ' ' . $this->language->get('text_total');
$this->data['form_title'] = $this->language->get('heading_title');
$this->data['update'] = $this->html->getSecureURL('listing_grid/total/update_field', '&id=sub_total');
$form = new AForm('HS');
$form->setForm(array('form_name' => 'editFrm', 'update' => $this->data['update']));
$this->data['form']['form_open'] = $form->getFieldHtml(array('type' => 'form', 'name' => 'editFrm', 'action' => $this->data['action'], 'attr' => 'data-confirm-exit="true" class="aform form-horizontal"'));
$this->data['form']['submit'] = $form->getFieldHtml(array('type' => 'button', 'name' => 'submit', 'text' => $this->language->get('button_save')));
$this->data['form']['cancel'] = $form->getFieldHtml(array('type' => 'button', 'name' => 'cancel', 'text' => $this->language->get('button_cancel')));
$this->data['form']['fields']['status'] = $form->getFieldHtml(array('type' => 'checkbox', 'name' => 'sub_total_status', 'value' => $this->data['sub_total_status'], 'style' => 'btn_switch status_switch'));
$this->loadLanguage('extension/extensions');
$options = array('subtotal' => $this->language->get('text_subtotal'), 'shipping' => $this->language->get('text_shipping'), 'fee' => $this->language->get('text_fee'), 'discount' => $this->language->get('text_discount'), 'total' => $this->language->get('text_total'), 'tax' => $this->language->get('text_tax'));
$this->data['form']['fields']['total_type'] = $form->getFieldHtml(array('type' => 'selectbox', 'name' => 'sub_total_total_type', 'options' => $options, 'value' => $this->data['sub_total_total_type']));
$this->data['form']['fields']['sort_order'] = $form->getFieldHtml(array('type' => 'input', 'name' => 'sub_total_sort_order', 'value' => $this->data['sub_total_sort_order']));
$this->data['form']['fields']['calculation_order'] = $form->getFieldHtml(array('type' => 'input', 'name' => 'sub_total_calculation_order', 'value' => $this->data['sub_total_calculation_order']));
$this->view->assign('help_url', $this->gen_help_url('edit_sub_total'));
$this->view->batchAssign($this->data);
$this->processTemplate('pages/total/form.tpl');
//update controller data
$this->extensions->hk_UpdateData($this, __FUNCTION__);
}
示例12: _getForm
private function _getForm()
{
if (isset($this->error['warning'])) {
$this->data['error_warning'] = $this->error['warning'];
} else {
$this->data['error_warning'] = '';
}
$this->data['error'] = $this->error;
$this->data['cancel'] = $this->html->getSecureURL('localisation/language_definitions');
if (!isset($this->request->get['language_definition_id'])) {
$this->data['action'] = $this->html->getSecureURL($this->rt . '/update', '&target=' . $this->request->get['target']);
$this->data['heading_title'] = $this->language->get('text_insert') . ' ' . $this->language->get('text_definition');
$this->data['update'] = '';
$form = new AForm('ST');
$this->data['language_definition_id'] = (int) $this->request->get['language_definition_id'];
$this->data['check_url'] = $this->html->getSecureURL('listing_grid/language_definitions/checkdefinition');
} else {
$this->data['action'] = $this->html->getSecureURL($this->rt . '/update', '&language_definition_id=' . $this->request->get['language_definition_id'] . '&target=' . $this->request->get['target']);
$this->data['heading_title'] = $this->language->get('text_edit') . ' ' . $this->language->get('text_definition');
$this->data['update'] = $this->html->getSecureURL('listing_grid/language_definitions/update_field', '&id=' . $this->request->get['language_definition_id']);
$form = new AForm('HS');
}
$dispatch = $this->dispatch('responses/common/form_collector', array('form_id' => 'definitionQFrm', 'target' => $this->request->get['target']));
$this->data['form_collector'] = $dispatch->dispatchGetOutput();
$this->document->addBreadcrumb(array('href' => $this->data['action'], 'text' => $this->data['heading_title'], 'separator' => ' :: '));
$form->setForm(array('form_name' => 'definitionQFrm', 'update' => $this->data['update']));
$this->data['form']['id'] = 'definitionQFrm';
$this->data['form']['form_open'] = $form->getFieldHtml(array('type' => 'form', 'name' => 'definitionQFrm', 'action' => $this->data['action']));
//build the rest of the form and data
$ret_data = $this->model_localisation_language_definitions->buildFormData($this->request, $this->data, $form);
if ($ret_data['redirect_params']) {
$this->redirect($this->data['action'] . $ret_data['redirect_params']);
}
$this->view->assign('form_language_switch', $this->html->getContentLanguageFlags());
$this->view->assign('ajax_wrapper_id', $this->request->get['target']);
$this->view->assign('ajax_reload_url', $this->html->getSecureURL($this->rt . '/update', '&language_definition_id=' . $this->request->get['language_definition_id'] . '&target=' . $this->request->get['target']));
$this->view->assign('help_url', $this->gen_help_url('language_definition_edit'));
$this->view->batchAssign($this->data);
$this->view->setTemplate('responses/localisation/language_definitions_form.tpl');
$this->view->render();
$output['html'] = $this->view->getOutput();
$output['title'] = $this->data['heading_title'];
$this->load->library('json');
$this->response->setOutput(AJson::encode($output));
}
示例13: main
public function main()
{
$this->load->model('checkout/order');
$order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']);
$data['action'] = '';
$form = new AForm();
$form->setForm(array('form_name' => 'checkout'));
$data['form']['form_open'] = $form->getFieldHtml(array('type' => 'form', 'name' => 'checkout', 'action' => 'https://www.liqpay.com/?do=clickNbuy'));
$xml = '<response>';
$xml .= ' <version>1.2</version>';
$xml .= ' <result_url>' . $this->html->getSecureURL('checkout/success') . '</result_url>';
$xml .= ' <server_url>' . $this->html->getSecureURL('extension/liqpay/callback') . '</server_url>';
$xml .= ' <merchant_id>' . $this->config->get('default_liqpay_merchant') . '</merchant_id>';
$xml .= ' <order_id>' . $this->session->data['order_id'] . '</order_id>';
$xml .= ' <amount>' . $this->currency->format($order_info['total'], $order_info['currency'], $order_info['value'], FALSE) . '</amount>';
$xml .= ' <currency>' . $order_info['currency'] . '</currency>';
$xml .= ' <description>' . $this->config->get('store_name') . ' ' . $order_info['payment_firstname'] . ' ' . $order_info['payment_address_1'] . ' ' . $order_info['payment_address_2'] . ' ' . $order_info['payment_city'] . ' ' . $order_info['email'] . '</description>';
$xml .= ' <sender_phone></sender_phone>';
$xml .= ' <pay_way>' . $this->config->get('default_liqpay_type') . '</pay_way>';
$xml .= '</response>';
$data['form']['xml'] = $form->getFieldHtml(array('type' => 'hidden', 'name' => 'xml', 'value' => base64_encode($xml)));
$data['form']['signature'] = $form->getFieldHtml(array('type' => 'hidden', 'name' => 'signature', 'value' => base64_encode(sha1($this->config->get('default_liqpay_signature') . $xml . $this->config->get('default_liqpay_signature'), TRUE))));
$back = $this->request->get['rt'] != 'checkout/guest_step_3' ? $this->html->getSecureURL('checkout/payment') : $this->html->getSecureURL('checkout/guest_step_2');
$data['form']['back'] = $form->getFieldHtml(array('type' => 'button', 'name' => 'back', 'text' => $this->language->get('button_back'), 'style' => 'button', 'href' => $back));
$data['form']['submit'] = $form->getFieldHtml(array('type' => 'submit', 'name' => $this->language->get('button_confirm')));
$this->view->batchAssign($data);
$this->processTemplate('responses/default_liqpay.tpl');
}
示例14: main
public function main()
{
$action = func_get_arg(0);
//init controller data
$this->extensions->hk_InitData($this, __FUNCTION__);
$this->loadLanguage('checkout/payment');
if (!$this->config->get('coupon_status')) {
return null;
}
$this->data['coupon_status'] = $this->config->get('coupon_status');
$entereted_cpn = isset($this->request->post['coupon']) ? $this->request->post['coupon'] : $this->session->data['coupon'];
$form = new AForm();
$form->setForm(array('form_name' => 'coupon'));
$this->data['form_open'] = $form->getFieldHtml(array('type' => 'form', 'name' => 'coupon', 'action' => $action));
$this->data['coupon'] = $form->getFieldHtml(array('type' => 'input', 'name' => 'coupon', 'value' => $entereted_cpn));
$this->data['submit'] = $form->getFieldHtml(array('type' => 'submit', 'name' => $this->language->get('button_coupon')));
$this->view->batchAssign($this->data);
$this->processTemplate('blocks/coupon_form.tpl');
//update controller data
$this->extensions->hk_UpdateData($this, __FUNCTION__);
}
示例15: main
public function main()
{
$this->loadModel('tool/developer_tools');
$this->loadLanguage('developer_tools/developer_tools');
$prj_id = $this->session->data['dev_tools_prj_id'];
$prj_config = $this->model_tool_developer_tools->getProjectConfig($prj_id);
$this->data['text_layout_xml_title'] = $this->language->get('text_layout_xml_title');
$this->data['text_select_template'] = $this->language->get('text_select_template');
$this->data['filepath'] = DIR_EXT . $prj_config['extension_txt_id'] . '/layout.xml';
if (!is_file($this->data['filepath']) || !is_readable($this->data['filepath'])) {
$this->data['filepath'] = null;
}
$this->data['relative_path'] = 'extensions/' . $prj_config['extension_txt_id'] . '/layout.xml';
$this->document->initBreadcrumb(array('href' => $this->html->getSecureURL('index/home'), 'text' => $this->language->get('text_home'), 'separator' => false));
$this->document->addBreadcrumb(array('href' => $this->html->getSecureURL('tool/developer_tools'), 'text' => $this->language->get('developer_tools_name'), 'separator' => ' :: ', 'current' => true));
//load tabs controller
$tabs_obj = $this->dispatch('pages/tool/developer_tools_tabs', array('project'));
$this->data['dev_tabs'] = $tabs_obj->dispatchGetOutput();
$tabs_obj = $this->dispatch('pages/tool/developer_tools_tabs/prjtabs', array('other'));
$this->data['prj_tabs'] = $tabs_obj->dispatchGetOutput();
$exist = file_exists($this->data['filepath']) ? true : false;
if ($exist) {
$this->data['text_view_layout_xml'] = $this->language->get('text_view_layout_xml');
}
$result = $this->db->query("SELECT DISTINCT template_id\n\t\t\t\t\t\t\t\t\tFROM " . $this->db->table("layouts"));
foreach ($result->rows as $row) {
$templates[$row['template_id']] = $row['template_id'];
}
$form = new AForm('ST');
$form->setForm(array('form_name' => 'extLayoutFrm', 'update' => ''));
$this->data['form']['id'] = 'extLayoutFrm';
$this->data['form']['form_open'] = $form->getFieldHtml(array('type' => 'form', 'name' => 'extLayoutFrm', 'action' => $this->data['action']));
$this->data['form']['submit'] = $form->getFieldHtml(array('type' => 'button', 'name' => 'submit', 'text' => $this->language->get('developer_tools_text_save_layout_xml'), 'style' => 'button1'));
$this->data['form']['template'] = $form->getFieldHtml(array('type' => 'selectbox', 'name' => 'template_id', 'options' => $templates, 'value' => $prj_config['extension_txt_id']));
$this->data['xml_build_url'] = $this->html->getSecureUrl('r/tool/developer_tools_other/savelayoutxml', '&prj_id=' . $prj_id);
$this->data['text_save_layout_xml'] = $this->language->get('text_save_layout_xml');
$this->data['info'] = $this->language->get('developer_tools_info_about_layouts');
$this->view->batchAssign($this->data);
$this->processTemplate('pages/tool/developer_tools_other.tpl');
}