public function main() { //init controller data $this->extensions->hk_InitData($this, __FUNCTION__); $this->document->setTitle($this->language->get('heading_title')); $this->document->resetBreadcrumbs(); $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/error_log'), 'text' => $this->language->get('heading_title'), 'separator' => ' :: ', 'current' => true)); $this->view->assign('current_url', $this->html->currentURL()); //load all RL types to be listed $rm = new AResourceManager(); $this->view->assign('types', $rm->getResourceTypes()); $latest_limit = 13; $resources_scripts = $this->dispatch('responses/common/resource_library/get_resources_scripts', array(null, null, null, null, 'mode' => 'list_all', 'page' => 1, 'limit' => $latest_limit, 'sort' => 'date_added', 'order' => 'DESC')); $this->view->assign('latest_limit', $latest_limit); $this->view->assign('rl_types_url', $this->html->getSecureURL('r/tool/rl_manager/update')); $this->view->assign('resources_scripts', $resources_scripts->dispatchGetOutput()); $this->view->assign('form_language_switch', $this->html->getContentLanguageSwitcher()); $this->processTemplate('pages/tool/rl_manager.tpl'); //update controller data $this->extensions->hk_UpdateData($this, __FUNCTION__); }
public function get_resources_scripts() { /** * @var string $object_name - name of RL-object for assistance of resources, for ex. products, categories, etc * @var int $object_id - id of object * @var array $types - array with RL-types (image, audio,video,archive etc) * @var bool $onload - sign of call function after js-script load * @var string $mode - mode of RL */ list($object_name, $object_id, $types, $onload, $mode) = func_get_args(); //init controller data $this->extensions->hk_InitData($this, __FUNCTION__); $this->data['onload'] = is_bool($onload) ? $onload : true; //sign of call js-function on page load. default true. $rm = new AResourceManager(); $this->data['types'] = $rm->getResourceTypes(); if ($types) { $types = (array) $types; foreach ($this->data['types'] as $key => $type) { if (!in_array($type['type_name'], $types)) { unset($this->data['types'][$key]); } } } $this->session->data['rl_types'] = $this->data['types']; $this->data['default_type'] = reset($this->data['types']); $this->data['object_name'] = $object_name; $this->data['object_id'] = $object_id; $this->data['mode'] = $mode; $params = '&mode=' . $mode . '&object_name=' . $object_name . '&object_id=' . $object_id; $this->data['rl_resource_library'] = $this->html->getSecureURL('common/resource_library', $params); $this->data['rl_resources'] = $this->html->getSecureURL('common/resource_library/resources', $params); $this->data['rl_resource_single'] = $this->html->getSecureURL('common/resource_library/get_resource_details', $params); $this->data['rl_delete'] = $this->html->getSecureURL('common/resource_library/delete'); $this->data['rl_unmap'] = $this->html->getSecureURL('common/resource_library/unmap', $params); $this->data['rl_map'] = $this->html->getSecureURL('common/resource_library/map', $params); $this->data['rl_download'] = $this->html->getSecureURL('common/resource_library/get_resource_preview'); $this->data['rl_upload'] = $this->html->getSecureURL('common/resource_library/upload', $params); $this->view->batchAssign($this->data); $this->processTemplate('responses/common/resource_library_scripts.tpl'); }
public function getMediaListingSubForm() { //init controller data $this->extensions->hk_InitData($this, __FUNCTION__); $this->loadLanguage('design/blocks'); $custom_block_id = (int) $this->request->get['custom_block_id']; $lm = new ALayoutManager(); if (!$custom_block_id) { $form = new AForm('ST'); } else { $form = new AForm('HS'); $content = $lm->getBlockDescriptions($custom_block_id); $content = $content[$this->language->getContentLanguageID()]['content']; $content = unserialize($content); } $form->setForm(array('form_name' => 'BlockFrm')); $rl = new AResourceManager(); $types = $rl->getResourceTypes(); $resource_types[''] = $this->language->get('text_select'); foreach ($types as $type) { $resource_types[$type['type_name']] = $type['type_name']; } $view = new AView($this->registry, 0); $view->batchAssign(array('entry_media_resource_type' => $this->language->get('entry_resource_type'), 'media_resource_type' => $form->getFieldHtml(array('type' => 'selectbox', 'name' => 'resource_type', 'value' => (string) $content['resource_type'], 'options' => $resource_types, 'style' => 'no-save', 'help_url' => $this->gen_help_url('block_resource_type'))), 'entry_media_resource_limit' => $this->language->get('entry_limit'), 'media_resource_limit' => $form->getFieldHtml(array('type' => 'input', 'name' => 'limit', 'value' => $content['limit'], 'style' => 'no-save', 'help_url' => $this->gen_help_url('block_limit'))))); $this->data['response'] = $view->fetch('responses/design/block_media_listing_subform.tpl'); //update controller data $this->extensions->hk_UpdateData($this, __FUNCTION__); $this->response->setOutput($this->data['response']); }
public function get_resources_scripts() { list($object_name, $object_id, $types, $onload, $mode) = func_get_args(); //init controller data $this->extensions->hk_InitData($this, __FUNCTION__); $this->data['onload'] = is_bool($onload) ? $onload : true; //sign of call js-function on page load. default true. $rm = new AResourceManager(); $this->data['types'] = $rm->getResourceTypes(); if ($types) { $types = (array) $types; foreach ($this->data['types'] as $key => $type) { if (!in_array($type['type_name'], $types)) { unset($this->data['types'][$key]); } } } $this->session->data['rl_types'] = $this->data['types']; $this->data['default_type'] = reset($this->data['types']); $this->data['object_name'] = $object_name; $this->data['object_id'] = $object_id; $this->data['mode'] = $mode; $params = '&mode=' . $mode . '&object_name=' . $object_name . '&object_id=' . $object_id; $this->data['rl_resource_library'] = $this->html->getSecureURL('common/resource_library', $params); $this->data['rl_resources'] = $this->html->getSecureURL('common/resource_library/resources', $params); $this->data['rl_resource_single'] = $this->html->getSecureURL('common/resource_library/get_resource_details', $params); $this->data['rl_delete'] = $this->html->getSecureURL('common/resource_library/delete'); $this->data['rl_unmap'] = $this->html->getSecureURL('common/resource_library/unmap', $params); $this->data['rl_map'] = $this->html->getSecureURL('common/resource_library/map', $params); $this->data['rl_download'] = $this->html->getSecureURL('common/resource_library/get_resource_preview'); $this->data['rl_upload'] = $this->html->getSecureURL('common/resource_library/upload', $params); $this->view->batchAssign($this->data); $this->processTemplate('responses/common/resource_library_scripts.tpl'); }
public function get_resources_scripts() { list($object_name, $object_id, $types, $mode) = func_get_args(); $rm = new AResourceManager(); $this->data['types'] = $rm->getResourceTypes(); if (!empty($types)) { foreach ($this->data['types'] as $key => $type) { if (!in_array($type['type_name'], (array) $types)) { unset($this->data['types'][$key]); } } } $this->session->data['rl_types'] = $this->data['types']; $this->data['mode'] = preg_replace('/[^a-z]/', '', $mode); $this->data['default_type'] = reset($this->data['types']); $this->data['object_name'] = $object_name; $this->data['object_id'] = $object_id; $params = '&object_name=' . $object_name . '&object_id=' . $object_id . '&mode=' . $mode; $this->data['rl_resource_library'] = $this->html->getSecureURL('common/resource_library', $params); $this->data['rl_resources'] = $this->html->getSecureURL('common/resource_library/resources', $params); $this->data['rl_resource_single'] = $this->html->getSecureURL('common/resource_library/get_resource_details', $params); $this->data['rl_delete'] = $this->html->getSecureURL('common/resource_library/delete'); $this->data['rl_unmap'] = $this->html->getSecureURL('common/resource_library/unmap', $params); $this->view->batchAssign($this->data); $this->processTemplate('responses/common/resource_library_scripts.tpl'); }