function procAjaxboardAdminInsertConfig() { $oModuleController = getController('module'); $config = Context::getRequestVars(); getDestroyXeVars($config); unset($config->module); unset($config->act); if ($config->del_storage_password) { $config->storage_password = ''; unset($config->del_storage_password); } $output = $oModuleController->updateModuleConfig('ajaxboard', $config); if (!$output->toBool()) { return $output; } $this->setMessage('success_updated'); $this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAjaxboardAdminConfig')); }
function procKrzipAdminInsertConfig() { $module_config = Context::getRequestVars(); getDestroyXeVars($module_config); unset($module_config->module); unset($module_config->act); unset($module_config->mid); unset($module_config->vid); $oKrzipController = getController('krzip'); $output = $oKrzipController->updateConfig($module_config); if (!$output->toBool()) { return $output; } $success_return_url = Context::get('success_return_url'); if ($success_return_url) { $return_url = $success_return_url; } else { $return_url = getNotEncodedUrl('', 'module', 'krzip', 'act', 'dispKrzipAdminConfig'); } $this->setMessage('success_registed'); $this->setRedirectUrl($return_url); }
/** * @brief Register extra vars to the module */ function insertModuleExtraVars($module_srl, $obj) { $this->deleteModuleExtraVars($module_srl); getDestroyXeVars($obj); if (!$obj || !count($obj)) { return; } foreach ($obj as $key => $val) { if (is_object($val) || is_array($val)) { continue; } $args = new stdClass(); $args->module_srl = $module_srl; $args->name = trim($key); $args->value = trim($val); if (!$args->name || !$args->value) { continue; } $output = executeQuery('module.insertModuleExtraVars', $args); } Rhymix\Framework\Cache::delete("site_and_module:module_extra_vars:{$module_srl}"); }
/** * @brief Register extra vars to the module */ function insertModuleExtraVars($module_srl, $obj) { $this->deleteModuleExtraVars($module_srl); getDestroyXeVars($obj); if (!$obj || !count($obj)) { return; } foreach ($obj as $key => $val) { if (is_object($val) || is_array($val)) { continue; } $args = new stdClass(); $args->module_srl = $module_srl; $args->name = trim($key); $args->value = trim($val); if (!$args->name || !$args->value) { continue; } $output = executeQuery('module.insertModuleExtraVars', $args); } $oCacheHandler = CacheHandler::getInstance('object', null, true); if ($oCacheHandler->isSupport()) { $object_key = 'module_extra_vars:' . $module_srl; $cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key); $oCacheHandler->delete($cache_key); } }
function getTemplateConfig() { $oModuleModel = getModel('module'); $module_info = $oModuleModel->getModuleInfoByMid(Context::get('mid')); $logged_info = Context::get('logged_info'); $member_srl = $logged_info->member_srl; $lang = new stdClass(); $lang->msg_ajaxboard_delete_document = Context::getLang('msg_ajaxboard_delete_document'); $lang->msg_ajaxboard_delete_comment = Context::getLang('msg_ajaxboard_delete_comment'); $lang->msg_ajaxboard_password_required = Context::getLang('msg_ajaxboard_password_required'); $module_config = $this->getConfig(); $module_config->lang = $lang; $module_config->current_url = Context::get('current_url'); $module_config->request_uri = Context::get('request_uri'); $module_config->current_mid = Context::get('mid'); $module_config->document_srl = Context::get('document_srl'); $module_config->module_srl = $module_info->module_srl; $module_config->member_srl = $member_srl; $module_config->SIO_VERSION = self::SIO_VERSION; getDestroyXeVars($module_config); unset($module_config->layout_srl); unset($module_config->mlayout_srl); unset($module_config->skin); unset($module_config->mskin); unset($module_config->waiting_message); unset($module_config->storage_host); unset($module_config->storage_port); unset($module_config->storage_password); return $module_config; }
function updatePluginVars($plugin_name, $extra_vars) { if (!(is_string($plugin_name) && is_object($extra_vars))) { return new Object(-1, 'msg_invalid_request'); } getDestroyXeVars($extra_vars); $oAjaxboardModel = getModel('ajaxboard'); $plugin_info = $oAjaxboardModel->getPluginInfo($plugin_name); $plugin_vars = $plugin_info->xml_info->extra_vars; $hash_id = md5('plugin_name:' . trim((string) $plugin_name)); foreach ($plugin_vars as $key => $val) { if ($val->type == 'image') { $img = $extra_vars->{$val->name}; $del = $extra_vars->{'del_' . $val->name}; unset($extra_vars->{'del_' . $val->name}); if ($del == 'Y') { FileHandler::removeFile($val->value); unset($extra_vars->{$val->name}); continue; } if (!$img['tmp_name'] && $val->value) { $extra_vars->{$val->name} = $val->value; continue; } $img_path = './files/attach/images/ajaxboard/' . $hash_id; $img_file = $img_path . '/' . $img['name']; if (!(is_uploaded_file($img['tmp_name']) && checkUploadedFile($img['tmp_name']) && preg_match('/\\.(jpg|jpeg|gif|png)$/i', $img['name']) && FileHandler::makeDir($img_path) && move_uploaded_file($img['tmp_name'], $img_file))) { unset($extra_vars->{$val->name}); continue; } FileHandler::removeFile($val->value); $extra_vars->{$val->name} = $img_file; } if ($val->type == 'module_srl') { $module_srls = array(); if ($extra_vars->{$val->name}) { $module_srls = explode(',', $extra_vars->{$val->name}); } foreach ($module_srls as $key => $module_srl) { $module_srls[$key] = (int) $module_srl; } $extra_vars->{$val->name} = $module_srls; } } $args = new stdClass(); $args->plugin_name = $plugin_name; $args->extra_vars = array(); foreach ($extra_vars as $key => $val) { $params = new stdClass(); $params->name = trim($key); $params->value = $val; $args->extra_vars[$key] = $params; } return $this->updatePluginInfo($plugin_name, $args); }