function onSubmit(ArgumentList $args, ArgumentList $post) { if ($post->exists('name') && $post->exists('save')) { if ($post->getArgument('fields')) { $fields = explode(',', $post->getArgument('fields')); $config = array(); foreach ($fields as $f) { list($name, $desc) = explode(':', $f); if ($post->exists($name)) { $config[$name] = $post->getArgument($name); } } $vals['config'] = serialize($config); } $fields = explode(',', $post->getArgument('error_codes')); $config = array(); foreach ($fields as $f) { if ($post->exists("e" . $f)) { $config[$f] = $post->getArgument("e" . $f); } } $vals['error_desc'] = serialize($config); $vals['description'] = $post->getArgument('description'); $vals['text'] = $post->getArgument('text'); $this->getStatement()->update('sc_pay_system', $vals, "name='" . $post->getArgument('name') . "'"); } $this->callSelfComponent(); }
function setPosition(ArgumentList $args) { // $this->updateParams(); $id = $args->getInt("id"); $move = $args->getArgument("move"); if ($move == "up") { $this->getStatement()->update('sc_news', array("position=position+1"), "id=" . $id); } if ($move == "down") { $this->getStatement()->update('sc_news', array("position=position-1"), "id=" . $id); } $this->callSelfComponent(); }
function setPosition(ArgumentList $args) { $id = $args->getInt('id'); $move = $args->getArgument('move'); $rs = $this->getStatement()->execute("select * from sc_module where mod_id=" . $id); if ($rs->next()) { if ($move == "up") { $this->getStatement()->up('sc_module', $id, "mod_parent_id='" . $rs->get("mod_parent_id") . "'", 'mod_id', 'mod_position'); } if ($move == "down") { $this->getStatement()->down('sc_module', $id, "mod_parent_id='" . $rs->get("mod_parent_id") . "'", 'mod_id', 'mod_position'); } } //Очистим кеш // $this->getStatement()->delete('sc_cache',"name='ModuleManager::module'"); $this->callSelfComponent(); }
function onRemove(ArgumentList $args) { $q = "delete from sc_users where u_id =" . $args->getArgument("id"); $this->getStatement()->executeDelete($q); $this->callSelfComponent(); }
function onSubmit(ArgumentList $args, ArgumentList $post) { $this->callComponentPage('/search/' . ($post->exists('search') ? urlencode($post->getArgument('search')) . '/' : '') . ($post->exists('type_search') && $post->getArgument('type_search') ? 'type/' . $post->getArgument('type_search') . '/' : '')); }