public function execute() { if (!$this->getUser()->isAdmin('shop') && !wa()->getUser()->getRights('shop', 'type.%')) { throw new waRightsException('Access denied'); } $profiles = new shopImportexportHelper(waRequest::post('plugin')); $this->response = $profiles->addConfig(); }
public function save() { $raw_profile = waRequest::post('profile'); if (is_array($raw_profile)) { $profile_id = isset($raw_profile['id']) ? intval(intval($raw_profile['id'])) : 0; } else { $profile_id = intval($raw_profile); $raw_profile = array(); } if ($profile_id) { $profiles = new shopImportexportHelper($this->plugin); if ($profile_id < 0) { $profile_id = $profiles->addConfig(ifset($raw_profile['name'], date('c')), ifset($raw_profile['description'], '')); } $profiles->setConfig($raw_profile, $profile_id); } }