diff --git a/admin-dev/themes/template/webservice/form.tpl b/admin-dev/themes/template/webservice/form.tpl new file mode 100644 index 000000000..9b6411862 --- /dev/null +++ b/admin-dev/themes/template/webservice/form.tpl @@ -0,0 +1,44 @@ +{extends file="helper/form/form.tpl"} +{block name="defaultForm"} +{$custom_form} + +{/block} diff --git a/admin-dev/tabs/AdminWebservice.php b/controllers/admin/AdminWebserviceController.php similarity index 70% rename from admin-dev/tabs/AdminWebservice.php rename to controllers/admin/AdminWebserviceController.php index 890c9f36c..042649ac5 100755 --- a/admin-dev/tabs/AdminWebservice.php +++ b/controllers/admin/AdminWebserviceController.php @@ -25,10 +25,10 @@ * International Registered Trademark & Property of PrestaShop SA */ -include_once(dirname(__FILE__).'/../../classes/AdminTab.php'); - -class AdminWebservice extends AdminTab +class AdminWebserviceController extends AdminController { + // this will be filled later + public $fields_form = array('webservice form'); public function __construct() { @@ -46,7 +46,7 @@ class AdminWebservice extends AdminTab ); if (file_exists(_PS_ROOT_DIR_.'/.htaccess')) - $this->optionsList = array( + $this->options = array( 'general' => array( 'title' => $this->l('Configuration'), 'fields' => array( @@ -76,47 +76,49 @@ class AdminWebservice extends AdminTab public function checkForWarning() { - $warnings = array(); if (!file_exists(_PS_ROOT_DIR_.'/.htaccess')) - $warnings[] = $this->l('In order to enable the PrestaShop Webservice, please generate the .htaccess file via the "Generators" tab (in the "Tools" tab).'); + $this->warnings[] = $this->l('In order to enable the PrestaShop Webservice, please generate the .htaccess file via the "Generators" tab (in the "Tools" tab).'); if (strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') === false) - $warnings[] = $this->l('To avoid operating problems, please use an Apache server.'); + $this->warnings[] = $this->l('To avoid operating problems, please use an Apache server.'); { if (function_exists('apache_get_modules')) { $apache_modules = apache_get_modules(); if (!in_array('mod_auth_basic', $apache_modules)) - $warnings[] = $this->l('Please activate the Apache module \'mod_auth_basic\' to allow authentication of PrestaShop webservice.'); + $this->warnings[] = $this->l('Please activate the Apache module \'mod_auth_basic\' to allow authentication of PrestaShop webservice.'); if (!in_array('mod_rewrite', $apache_modules)) - $warnings[] = $this->l('Please activate the Apache module \'mod_rewrite\' to allow using the PrestaShop webservice.'); + $this->warnings[] = $this->l('Please activate the Apache module \'mod_rewrite\' to allow using the PrestaShop webservice.'); } else { - $warnings[] = $this->l('We could not check if basic authentication and rewrite extensions are activated. Please manually check if they are activated in order to use the PrestaShop webservice.'); + $this->warnings[] = $this->l('We could not check if basic authentication and rewrite extensions are activated. Please manually check if they are activated in order to use the PrestaShop webservice.'); } } if (!extension_loaded('SimpleXML')) - $warnings[] = $this->l('Please activate the PHP extension \'SimpleXML\' to allow testing of PrestaShop webservice.'); + $this->warnings[] = $this->l('Please activate the PHP extension \'SimpleXML\' to allow testing of PrestaShop webservice.'); if (!configuration::get('PS_SSL_ENABLED')) - $warnings[] = $this->l('If possible, it is preferable to use SSL (https) for webservice calls, as it avoids the security issues of type "man in the middle".'); + $this->warnings[] = $this->l('If possible, it is preferable to use SSL (https) for webservice calls, as it avoids the security issues of type "man in the middle".'); - $this->displayWarning($warnings); foreach ($this->_list as $k => $item) if ($item['is_module'] && $item['class_name'] && $item['module_name'] && ($instance = Module::getInstanceByName($item['module_name'])) && !$instance->useNormalPermissionBehaviour()) unset($this->_list[$k]); - parent::displayList(); + $this->initList(); } - public function displayForm($isMainTab = true) + /** @todo : to fill $this->fields_form in order to generate + * the form automatically.. + * + */ + public function initForm($isMainTab = true) { - parent::displayForm(); + $content = ''; if (!($obj = $this->loadObject(true))) return; - echo ' + $content = '