mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-29 08:09:58 +09:00
Merge branch 'develop' into pr/member-phone-number
This commit is contained in:
commit
8f64e7c6b9
200 changed files with 2025 additions and 1785 deletions
|
|
@ -305,7 +305,7 @@ class addonAdminModel extends addon
|
|||
$val->options = array($val->options);
|
||||
}
|
||||
|
||||
for($i = 0, $c = count($val->options); $i < $c; $i++)
|
||||
for($i = 0, $c = countobj($val->options); $i < $c; $i++)
|
||||
{
|
||||
$obj->options[$i] = new stdClass();
|
||||
$obj->options[$i]->title = $val->options[$i]->title->body;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ class addon extends ModuleObject
|
|||
/**
|
||||
* Implement if additional tasks are necessary when installing
|
||||
*
|
||||
* @return Object
|
||||
* @return void
|
||||
*/
|
||||
function moduleInstall()
|
||||
{
|
||||
|
|
@ -21,7 +21,6 @@ class addon extends ModuleObject
|
|||
$oAddonController->doInsert('member_extra_info', 0, 'site', 'Y');
|
||||
$oAddonController->doInsert('resize_image', 0, 'site', 'Y');
|
||||
$oAddonController->makeCacheFile(0);
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -53,7 +52,7 @@ class addon extends ModuleObject
|
|||
/**
|
||||
* Execute update
|
||||
*
|
||||
* @return Object
|
||||
* @return void
|
||||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
|
|
@ -88,8 +87,6 @@ class addon extends ModuleObject
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new Object(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ class adminAdminController extends admin
|
|||
return $output;
|
||||
}
|
||||
|
||||
Rhymix\Framework\Cache::delete('admin_menu_langs:' . Context::getLangType());
|
||||
Rhymix\Framework\Storage::deleteDirectory(\RX_BASEDIR . 'files/cache/menu/admin_lang/');
|
||||
|
||||
$this->setRedirectUrl(Context::get('error_return_url'));
|
||||
|
|
@ -157,8 +158,8 @@ class adminAdminController extends admin
|
|||
}
|
||||
|
||||
// create a DesignInfo file
|
||||
$output = $this->updateDefaultDesignInfo($vars);
|
||||
return $this->setRedirectUrl(Context::get('error_return_url'), $output);
|
||||
$this->updateDefaultDesignInfo($vars);
|
||||
$this->setRedirectUrl(Context::get('error_return_url'));
|
||||
}
|
||||
|
||||
public function updateDefaultDesignInfo($vars)
|
||||
|
|
@ -208,8 +209,6 @@ class adminAdminController extends admin
|
|||
}
|
||||
|
||||
$this->makeDefaultDesignFile($designInfo, $vars->site_srl);
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
function makeDefaultDesignFile($designInfo, $site_srl = 0)
|
||||
|
|
@ -286,7 +285,7 @@ class adminAdminController extends admin
|
|||
|
||||
/**
|
||||
* Cleanning favorite
|
||||
* @return Object
|
||||
* @return object|void
|
||||
*/
|
||||
function cleanFavorite()
|
||||
{
|
||||
|
|
@ -300,7 +299,7 @@ class adminAdminController extends admin
|
|||
$favoriteList = $output->get('favoriteList');
|
||||
if(!$favoriteList)
|
||||
{
|
||||
return new Object();
|
||||
return;
|
||||
}
|
||||
|
||||
$deleteTargets = array();
|
||||
|
|
@ -318,7 +317,7 @@ class adminAdminController extends admin
|
|||
|
||||
if(!count($deleteTargets))
|
||||
{
|
||||
return new Object();
|
||||
return;
|
||||
}
|
||||
|
||||
$args = new stdClass();
|
||||
|
|
@ -328,8 +327,6 @@ class adminAdminController extends admin
|
|||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -495,7 +492,7 @@ class adminAdminController extends admin
|
|||
}
|
||||
else
|
||||
{
|
||||
return new Object(-1, 'fail_to_delete');
|
||||
return $this->setError('fail_to_delete');
|
||||
}
|
||||
$this->setMessage('success_deleted');
|
||||
}
|
||||
|
|
@ -519,7 +516,7 @@ class adminAdminController extends admin
|
|||
Rhymix\Framework\Config::set('use_sso', $vars->use_sso === 'Y');
|
||||
if (!Rhymix\Framework\Config::save())
|
||||
{
|
||||
return new Object(-1, 'msg_failed_to_save_config');
|
||||
return $this->setError('msg_failed_to_save_config');
|
||||
}
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
|
|
@ -539,19 +536,19 @@ class adminAdminController extends admin
|
|||
// Validate the mail sender's information.
|
||||
if (!$vars->mail_default_name)
|
||||
{
|
||||
return new Object(-1, 'msg_advanced_mailer_sender_name_is_empty');
|
||||
return $this->setError('msg_advanced_mailer_sender_name_is_empty');
|
||||
}
|
||||
if (!$vars->mail_default_from)
|
||||
{
|
||||
return new Object(-1, 'msg_advanced_mailer_sender_email_is_empty');
|
||||
return $this->setError('msg_advanced_mailer_sender_email_is_empty');
|
||||
}
|
||||
if (!Mail::isVaildMailAddress($vars->mail_default_from))
|
||||
{
|
||||
return new Object(-1, 'msg_advanced_mailer_sender_email_is_invalid');
|
||||
return $this->setError('msg_advanced_mailer_sender_email_is_invalid');
|
||||
}
|
||||
if ($vars->mail_default_reply_to && !Mail::isVaildMailAddress($vars->mail_default_reply_to))
|
||||
{
|
||||
return new Object(-1, 'msg_advanced_mailer_reply_to_is_invalid');
|
||||
return $this->setError('msg_advanced_mailer_reply_to_is_invalid');
|
||||
}
|
||||
|
||||
// Validate the mail driver.
|
||||
|
|
@ -559,7 +556,7 @@ class adminAdminController extends admin
|
|||
$mail_driver = $vars->mail_driver;
|
||||
if (!array_key_exists($mail_driver, $mail_drivers))
|
||||
{
|
||||
return new Object(-1, 'msg_advanced_mailer_sending_method_is_invalid');
|
||||
return $this->setError('msg_advanced_mailer_sending_method_is_invalid');
|
||||
}
|
||||
|
||||
// Validate the mail driver settings.
|
||||
|
|
@ -569,7 +566,7 @@ class adminAdminController extends admin
|
|||
$conf_value = $vars->{'mail_' . $mail_driver . '_' . $conf_name} ?: null;
|
||||
if (!$conf_value)
|
||||
{
|
||||
return new Object(-1, 'msg_advanced_mailer_smtp_host_is_invalid');
|
||||
return $this->setError('msg_advanced_mailer_smtp_host_is_invalid');
|
||||
}
|
||||
$mail_driver_config[$conf_name] = $conf_value;
|
||||
}
|
||||
|
|
@ -579,7 +576,7 @@ class adminAdminController extends admin
|
|||
$sms_driver = $vars->sms_driver;
|
||||
if (!array_key_exists($sms_driver, $sms_drivers))
|
||||
{
|
||||
return new Object(-1, 'msg_advanced_mailer_sending_method_is_invalid');
|
||||
return $this->setError('msg_advanced_mailer_sending_method_is_invalid');
|
||||
}
|
||||
|
||||
// Validate the SMS driver settings.
|
||||
|
|
@ -589,7 +586,7 @@ class adminAdminController extends admin
|
|||
$conf_value = $vars->{'sms_' . $sms_driver . '_' . $conf_name} ?: null;
|
||||
if (!$conf_value)
|
||||
{
|
||||
return new Object(-1, 'msg_advanced_mailer_smtp_host_is_invalid');
|
||||
return $this->setError('msg_advanced_mailer_smtp_host_is_invalid');
|
||||
}
|
||||
$sms_driver_config[$conf_name] = $conf_value;
|
||||
}
|
||||
|
|
@ -628,7 +625,7 @@ class adminAdminController extends admin
|
|||
Rhymix\Framework\Config::set("sms.allow_split.lms", toBool($vars->allow_split_lms));
|
||||
if (!Rhymix\Framework\Config::save())
|
||||
{
|
||||
return new Object(-1, 'msg_failed_to_save_config');
|
||||
return $this->setError('msg_failed_to_save_config');
|
||||
}
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
|
|
@ -683,7 +680,7 @@ class adminAdminController extends admin
|
|||
return $item !== '';
|
||||
}));
|
||||
if (!Rhymix\Framework\Filters\IpFilter::validateRanges($allowed_ip)) {
|
||||
return new Object(-1, 'msg_invalid_ip');
|
||||
return $this->setError('msg_invalid_ip');
|
||||
}
|
||||
|
||||
$denied_ip = array_map('trim', preg_split('/[\r\n]/', $vars->admin_denied_ip));
|
||||
|
|
@ -691,13 +688,13 @@ class adminAdminController extends admin
|
|||
return $item !== '';
|
||||
}));
|
||||
if (!Rhymix\Framework\Filters\IpFilter::validateRanges($denied_ip)) {
|
||||
return new Object(-1, 'msg_invalid_ip');
|
||||
return $this->setError('msg_invalid_ip');
|
||||
}
|
||||
|
||||
$oMemberAdminModel = getAdminModel('member');
|
||||
if (!$oMemberAdminModel->getMemberAdminIPCheck($allowed_ip, $denied_ip))
|
||||
{
|
||||
return new Object(-1, 'msg_current_ip_will_be_denied');
|
||||
return $this->setError('msg_current_ip_will_be_denied');
|
||||
}
|
||||
|
||||
Rhymix\Framework\Config::set('admin.allow', array_values($allowed_ip));
|
||||
|
|
@ -706,7 +703,7 @@ class adminAdminController extends admin
|
|||
// Save
|
||||
if (!Rhymix\Framework\Config::save())
|
||||
{
|
||||
return new Object(-1, 'msg_failed_to_save_config');
|
||||
return $this->setError('msg_failed_to_save_config');
|
||||
}
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
|
|
@ -745,7 +742,7 @@ class adminAdminController extends admin
|
|||
}
|
||||
if (!Rhymix\Framework\Cache::getDriverInstance($vars->object_cache_type, $cache_servers))
|
||||
{
|
||||
return new Object(-1, 'msg_cache_handler_not_supported');
|
||||
return $this->setError('msg_cache_handler_not_supported');
|
||||
}
|
||||
Rhymix\Framework\Config::set('cache', array(
|
||||
'type' => $vars->object_cache_type,
|
||||
|
|
@ -769,6 +766,7 @@ class adminAdminController extends admin
|
|||
// Mobile view
|
||||
Rhymix\Framework\Config::set('mobile.enabled', $vars->use_mobile_view === 'Y');
|
||||
Rhymix\Framework\Config::set('mobile.tablets', $vars->tablets_as_mobile === 'Y');
|
||||
Rhymix\Framework\Config::set('mobile.viewport', utf8_trim($vars->mobile_viewport));
|
||||
if (Rhymix\Framework\Config::get('use_mobile_view') !== null)
|
||||
{
|
||||
Rhymix\Framework\Config::set('use_mobile_view', $vars->use_mobile_view === 'Y');
|
||||
|
|
@ -799,7 +797,7 @@ class adminAdminController extends admin
|
|||
// Save
|
||||
if (!Rhymix\Framework\Config::save())
|
||||
{
|
||||
return new Object(-1, 'msg_failed_to_save_config');
|
||||
return $this->setError('msg_failed_to_save_config');
|
||||
}
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
|
|
@ -837,15 +835,15 @@ class adminAdminController extends admin
|
|||
), $log_filename);
|
||||
if (file_exists(RX_BASEDIR . $log_filename_today) && !is_writable(RX_BASEDIR . $log_filename_today))
|
||||
{
|
||||
return new Object(-1, 'msg_debug_log_filename_not_writable');
|
||||
return $this->setError('msg_debug_log_filename_not_writable');
|
||||
}
|
||||
if (!file_exists(dirname(RX_BASEDIR . $log_filename)) && !FileHandler::makeDir(dirname(RX_BASEDIR . $log_filename)))
|
||||
{
|
||||
return new Object(-1, 'msg_debug_log_filename_not_writable');
|
||||
return $this->setError('msg_debug_log_filename_not_writable');
|
||||
}
|
||||
if (!is_writable(dirname(RX_BASEDIR . $log_filename)))
|
||||
{
|
||||
return new Object(-1, 'msg_debug_log_filename_not_writable');
|
||||
return $this->setError('msg_debug_log_filename_not_writable');
|
||||
}
|
||||
Rhymix\Framework\Config::set('debug.log_filename', $log_filename);
|
||||
|
||||
|
|
@ -855,14 +853,14 @@ class adminAdminController extends admin
|
|||
return $item !== '';
|
||||
}));
|
||||
if (!Rhymix\Framework\Filters\IpFilter::validateRanges($allowed_ip)) {
|
||||
return new Object(-1, 'msg_invalid_ip');
|
||||
return $this->setError('msg_invalid_ip');
|
||||
}
|
||||
Rhymix\Framework\Config::set('debug.allow', array_values($allowed_ip));
|
||||
|
||||
// Save
|
||||
if (!Rhymix\Framework\Config::save())
|
||||
{
|
||||
return new Object(-1, 'msg_failed_to_save_config');
|
||||
return $this->setError('msg_failed_to_save_config');
|
||||
}
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
|
|
@ -894,7 +892,7 @@ class adminAdminController extends admin
|
|||
// Save
|
||||
if (!Rhymix\Framework\Config::save())
|
||||
{
|
||||
return new Object(-1, 'msg_failed_to_save_config');
|
||||
return $this->setError('msg_failed_to_save_config');
|
||||
}
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
|
|
@ -915,7 +913,7 @@ class adminAdminController extends admin
|
|||
|
||||
if (!Rhymix\Framework\Filters\IpFilter::validateRanges($allowed_ip))
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_ip');
|
||||
return $this->setError('msg_invalid_ip');
|
||||
}
|
||||
|
||||
Rhymix\Framework\Config::set('lock.locked', $vars->sitelock_locked === 'Y');
|
||||
|
|
@ -924,7 +922,7 @@ class adminAdminController extends admin
|
|||
Rhymix\Framework\Config::set('lock.allow', array_values($allowed_ip));
|
||||
if (!Rhymix\Framework\Config::save())
|
||||
{
|
||||
return new Object(-1, 'msg_failed_to_save_config');
|
||||
return $this->setError('msg_failed_to_save_config');
|
||||
}
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
|
|
@ -945,7 +943,7 @@ class adminAdminController extends admin
|
|||
$domain_info = getModel('module')->getSiteInfo($domain_srl);
|
||||
if ($domain_info->domain_srl != $domain_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_domain_not_found');
|
||||
return $this->setError('msg_domain_not_found');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -954,7 +952,7 @@ class adminAdminController extends admin
|
|||
$vars->subtitle = utf8_trim($vars->subtitle);
|
||||
if ($vars->title === '')
|
||||
{
|
||||
return new Object(-1, 'msg_site_title_is_empty');
|
||||
return $this->setError('msg_site_title_is_empty');
|
||||
}
|
||||
|
||||
// Validate the domain.
|
||||
|
|
@ -972,12 +970,12 @@ class adminAdminController extends admin
|
|||
}
|
||||
if (!$vars->domain)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_domain');
|
||||
return $this->setError('msg_invalid_domain');
|
||||
}
|
||||
$existing_domain = getModel('module')->getSiteInfoByDomain($vars->domain);
|
||||
if ($existing_domain && $existing_domain->domain == $vars->domain && (!$domain_info || $existing_domain->domain_srl != $domain_info->domain_srl))
|
||||
{
|
||||
return new Object(-1, 'msg_domain_already_exists');
|
||||
return $this->setError('msg_domain_already_exists');
|
||||
}
|
||||
|
||||
// Validate the ports.
|
||||
|
|
@ -991,11 +989,11 @@ class adminAdminController extends admin
|
|||
}
|
||||
if ($vars->http_port !== 0 && ($vars->http_port < 1 || $vars->http_port > 65535 || $vars->http_port == 443))
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_http_port');
|
||||
return $this->setError('msg_invalid_http_port');
|
||||
}
|
||||
if ($vars->https_port !== 0 && ($vars->https_port < 1 || $vars->https_port > 65535 || $vars->https_port == 80))
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_https_port');
|
||||
return $this->setError('msg_invalid_https_port');
|
||||
}
|
||||
|
||||
// Validate the security setting.
|
||||
|
|
@ -1009,7 +1007,7 @@ class adminAdminController extends admin
|
|||
$module_info = getModel('module')->getModuleInfoByModuleSrl(intval($vars->index_module_srl));
|
||||
if (!$module_info || $module_info->module_srl != $vars->index_module_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_index_module_srl');
|
||||
return $this->setError('msg_invalid_index_module_srl');
|
||||
}
|
||||
|
||||
// Validate the index document setting.
|
||||
|
|
@ -1018,11 +1016,11 @@ class adminAdminController extends admin
|
|||
$oDocument = getModel('document')->getDocument($vars->index_document_srl);
|
||||
if (!$oDocument || !$oDocument->isExists())
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_index_document_srl');
|
||||
return $this->setError('msg_invalid_index_document_srl');
|
||||
}
|
||||
if (intval($oDocument->get('module_srl')) !== intval($vars->index_module_srl))
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_index_document_srl_module_srl');
|
||||
return $this->setError('msg_invalid_index_document_srl_module_srl');
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -1034,14 +1032,14 @@ class adminAdminController extends admin
|
|||
$enabled_lang = Rhymix\Framework\Config::get('locale.enabled_lang');
|
||||
if (!in_array($vars->default_lang, $enabled_lang))
|
||||
{
|
||||
return new Object(-1, 'msg_lang_is_not_enabled');
|
||||
return $this->setError('msg_lang_is_not_enabled');
|
||||
}
|
||||
|
||||
// Validate the default time zone.
|
||||
$timezone_list = Rhymix\Framework\DateTime::getTimezoneList();
|
||||
if (!isset($timezone_list[$vars->default_timezone]))
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_timezone');
|
||||
return $this->setError('msg_invalid_timezone');
|
||||
}
|
||||
|
||||
// Clean up the header and footer scripts.
|
||||
|
|
@ -1164,16 +1162,16 @@ class adminAdminController extends admin
|
|||
$domain_srl = strval(Context::get('domain_srl'));
|
||||
if ($domain_srl === '')
|
||||
{
|
||||
return new Object(-1, 'msg_domain_not_found');
|
||||
return $this->setError('msg_domain_not_found');
|
||||
}
|
||||
$domain_info = getModel('module')->getSiteInfo($domain_srl);
|
||||
if ($domain_info->domain_srl != $domain_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_domain_not_found');
|
||||
return $this->setError('msg_domain_not_found');
|
||||
}
|
||||
if ($domain_info->is_default_domain === 'Y')
|
||||
{
|
||||
return new Object(-1, 'msg_cannot_delete_default_domain');
|
||||
return $this->setError('msg_cannot_delete_default_domain');
|
||||
}
|
||||
|
||||
// Delete the domain.
|
||||
|
|
@ -1206,19 +1204,19 @@ class adminAdminController extends admin
|
|||
{
|
||||
if (!($conn = @ftp_connect($vars->ftp_host, $vars->ftp_port, 3)))
|
||||
{
|
||||
return new Object(-1, 'msg_ftp_not_connected');
|
||||
return $this->setError('msg_ftp_not_connected');
|
||||
}
|
||||
if (!@ftp_login($conn, $vars->ftp_user, $vars->ftp_pass))
|
||||
{
|
||||
return new Object(-1, 'msg_ftp_invalid_auth_info');
|
||||
return $this->setError('msg_ftp_invalid_auth_info');
|
||||
}
|
||||
if (!@ftp_pasv($conn, $vars->ftp_pasv === 'Y'))
|
||||
{
|
||||
return new Object(-1, 'msg_ftp_cannot_set_passive_mode');
|
||||
return $this->setError('msg_ftp_cannot_set_passive_mode');
|
||||
}
|
||||
if (!@ftp_chdir($conn, $vars->ftp_path))
|
||||
{
|
||||
return new Object(-1, 'msg_ftp_invalid_path');
|
||||
return $this->setError('msg_ftp_invalid_path');
|
||||
}
|
||||
ftp_close($conn);
|
||||
}
|
||||
|
|
@ -1226,23 +1224,23 @@ class adminAdminController extends admin
|
|||
{
|
||||
if (!function_exists('ssh2_connect'))
|
||||
{
|
||||
return new Object(-1, 'disable_sftp_support');
|
||||
return $this->setError('disable_sftp_support');
|
||||
}
|
||||
if (!($conn = ssh2_connect($vars->ftp_host, $vars->ftp_port)))
|
||||
{
|
||||
return new Object(-1, 'msg_ftp_not_connected');
|
||||
return $this->setError('msg_ftp_not_connected');
|
||||
}
|
||||
if (!@ssh2_auth_password($conn, $vars->ftp_user, $vars->ftp_pass))
|
||||
{
|
||||
return new Object(-1, 'msg_ftp_invalid_auth_info');
|
||||
return $this->setError('msg_ftp_invalid_auth_info');
|
||||
}
|
||||
if (!@($sftp = ssh2_sftp($conn)))
|
||||
{
|
||||
return new Object(-1, 'msg_ftp_sftp_error');
|
||||
return $this->setError('msg_ftp_sftp_error');
|
||||
}
|
||||
if (!@ssh2_sftp_stat($sftp, $vars->ftp_path . 'common/defaults/config.php'))
|
||||
{
|
||||
return new Object(-1, 'msg_ftp_invalid_path');
|
||||
return $this->setError('msg_ftp_invalid_path');
|
||||
}
|
||||
unset($sftp, $conn);
|
||||
}
|
||||
|
|
@ -1257,7 +1255,7 @@ class adminAdminController extends admin
|
|||
Rhymix\Framework\Config::set('ftp.sftp', $vars->ftp_sftp === 'Y');
|
||||
if (!Rhymix\Framework\Config::save())
|
||||
{
|
||||
return new Object(-1, 'msg_failed_to_save_config');
|
||||
return $this->setError('msg_failed_to_save_config');
|
||||
}
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
|
|
@ -1278,7 +1276,7 @@ class adminAdminController extends admin
|
|||
Rhymix\Framework\Config::set('ftp.sftp', false);
|
||||
if (!Rhymix\Framework\Config::save())
|
||||
{
|
||||
return new Object(-1, 'msg_failed_to_save_config');
|
||||
return $this->setError('msg_failed_to_save_config');
|
||||
}
|
||||
|
||||
$this->setMessage('success_deleted');
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class adminAdminModel extends admin
|
|||
$connection = ssh2_connect($ftp_info->ftp_host, $ftp_info->ftp_port);
|
||||
if(!ssh2_auth_password($connection, $ftp_info->ftp_user, $ftp_info->ftp_password))
|
||||
{
|
||||
return new Object(-1, 'msg_ftp_invalid_auth_info');
|
||||
return $this->setError('msg_ftp_invalid_auth_info');
|
||||
}
|
||||
$sftp = ssh2_sftp($connection);
|
||||
|
||||
|
|
@ -112,14 +112,14 @@ class adminAdminModel extends admin
|
|||
$connection = ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port);
|
||||
if(!$connection)
|
||||
{
|
||||
return new Object(-1, sprintf(lang('msg_ftp_not_connected'), 'host'));
|
||||
return $this->setError('msg_ftp_not_connected', 'host');
|
||||
}
|
||||
|
||||
$login_result = @ftp_login($connection, $ftp_info->ftp_user, $ftp_info->ftp_password);
|
||||
if(!$login_result)
|
||||
{
|
||||
ftp_close($connection);
|
||||
return new Object(-1, 'msg_ftp_invalid_auth_info');
|
||||
return $this->setError('msg_ftp_invalid_auth_info');
|
||||
}
|
||||
|
||||
// create temp file
|
||||
|
|
@ -182,7 +182,7 @@ class adminAdminModel extends admin
|
|||
|
||||
if(!$ftp_info->ftp_user || !$ftp_info->ftp_password)
|
||||
{
|
||||
return new Object(1, 'msg_ftp_invalid_auth_info');
|
||||
return new BaseObject(1, 'msg_ftp_invalid_auth_info');
|
||||
}
|
||||
|
||||
if(!$ftp_info->ftp_host)
|
||||
|
|
@ -199,7 +199,7 @@ class adminAdminModel extends admin
|
|||
{
|
||||
if(!function_exists('ssh2_sftp'))
|
||||
{
|
||||
return new Object(-1, 'disable_sftp_support');
|
||||
return $this->setError('disable_sftp_support');
|
||||
}
|
||||
return $this->getSFTPPath();
|
||||
}
|
||||
|
|
@ -216,12 +216,12 @@ class adminAdminModel extends admin
|
|||
$oFTP = new ftp();
|
||||
if(!$oFTP->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port))
|
||||
{
|
||||
return new Object(1, sprintf(lang('msg_ftp_not_connected'), 'host'));
|
||||
return new BaseObject(1, sprintf(lang('msg_ftp_not_connected'), 'host'));
|
||||
}
|
||||
|
||||
if(!$oFTP->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password))
|
||||
{
|
||||
return new Object(1, 'msg_ftp_invalid_auth_info');
|
||||
return new BaseObject(1, 'msg_ftp_invalid_auth_info');
|
||||
}
|
||||
|
||||
// create temp file
|
||||
|
|
@ -286,7 +286,7 @@ class adminAdminModel extends admin
|
|||
$connection = ssh2_connect($ftp_info->ftp_host, $ftp_info->ftp_port);
|
||||
if(!ssh2_auth_password($connection, $ftp_info->ftp_user, $ftp_info->ftp_password))
|
||||
{
|
||||
return new Object(-1, 'msg_ftp_invalid_auth_info');
|
||||
return $this->setError('msg_ftp_invalid_auth_info');
|
||||
}
|
||||
|
||||
$sftp = ssh2_sftp($connection);
|
||||
|
|
@ -294,7 +294,7 @@ class adminAdminModel extends admin
|
|||
$dh = @opendir($curpwd);
|
||||
if(!$dh)
|
||||
{
|
||||
return new Object(-1, 'msg_ftp_invalid_path');
|
||||
return $this->setError('msg_ftp_invalid_path');
|
||||
}
|
||||
$list = array();
|
||||
while(($file = readdir($dh)) !== FALSE)
|
||||
|
|
@ -325,7 +325,7 @@ class adminAdminModel extends admin
|
|||
$ftp_info = Context::getRequestVars();
|
||||
if(!$ftp_info->ftp_user || !$ftp_info->ftp_password)
|
||||
{
|
||||
return new Object(-1, 'msg_ftp_invalid_auth_info');
|
||||
return $this->setError('msg_ftp_invalid_auth_info');
|
||||
}
|
||||
|
||||
$this->pwd = $ftp_info->ftp_root_path;
|
||||
|
|
@ -344,7 +344,7 @@ class adminAdminModel extends admin
|
|||
{
|
||||
if(!function_exists('ssh2_sftp'))
|
||||
{
|
||||
return new Object(-1, 'disable_sftp_support');
|
||||
return $this->setError('disable_sftp_support');
|
||||
}
|
||||
return $this->getSFTPList();
|
||||
}
|
||||
|
|
@ -359,7 +359,7 @@ class adminAdminModel extends admin
|
|||
}
|
||||
else
|
||||
{
|
||||
return new Object(-1, 'msg_ftp_invalid_auth_info');
|
||||
return $this->setError('msg_ftp_invalid_auth_info');
|
||||
}
|
||||
}
|
||||
$list = array();
|
||||
|
|
@ -380,7 +380,7 @@ class adminAdminModel extends admin
|
|||
}
|
||||
else
|
||||
{
|
||||
return new Object(-1, 'msg_ftp_no_directory');
|
||||
return $this->setError('msg_ftp_no_directory');
|
||||
}
|
||||
$this->add('list', $list);
|
||||
}
|
||||
|
|
@ -624,38 +624,33 @@ class adminAdminModel extends admin
|
|||
*/
|
||||
function getAdminMenuLang()
|
||||
{
|
||||
$currentLang = Context::getLangType();
|
||||
$cacheFile = sprintf('./files/cache/menu/admin_lang/adminMenu.%s.lang.php', $currentLang);
|
||||
|
||||
// Update if no cache file exists or it is older than xml file
|
||||
if(!is_readable($cacheFile))
|
||||
static $lang = null;
|
||||
|
||||
if ($lang === null)
|
||||
{
|
||||
$lang = new stdClass();
|
||||
$lang = Rhymix\Framework\Cache::get('admin_menu_langs:' . Context::getLangType());
|
||||
}
|
||||
if ($lang === null)
|
||||
{
|
||||
$lang = array();
|
||||
$oModuleModel = getModel('module');
|
||||
$installed_module_list = $oModuleModel->getModulesXmlInfo();
|
||||
|
||||
$this->gnbLangBuffer = '<?php $lang = new stdClass();';
|
||||
foreach($installed_module_list AS $key => $value)
|
||||
foreach($installed_module_list as $key => $value)
|
||||
{
|
||||
$moduleActionInfo = $oModuleModel->getModuleActionXml($value->module);
|
||||
if(is_object($moduleActionInfo->menu))
|
||||
{
|
||||
foreach($moduleActionInfo->menu AS $key2 => $value2)
|
||||
foreach($moduleActionInfo->menu as $key2 => $value2)
|
||||
{
|
||||
$lang->menu_gnb_sub[$key2] = $value2->title;
|
||||
$this->gnbLangBuffer .=sprintf('$lang->menu_gnb_sub[\'%s\'] = \'%s\';', $key2, $value2->title);
|
||||
$lang[$key2] = $value2->title;
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->gnbLangBuffer .= ' ?>';
|
||||
FileHandler::writeFile($cacheFile, $this->gnbLangBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
include $cacheFile;
|
||||
|
||||
Rhymix\Framework\Cache::set('admin_menu_langs:' . Context::getLangType(), $lang, 0, true);
|
||||
}
|
||||
|
||||
return $lang->menu_gnb_sub;
|
||||
return $lang;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -675,7 +670,7 @@ class adminAdminModel extends admin
|
|||
}
|
||||
if(!$output->data)
|
||||
{
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
if($isGetModuleInfo && is_array($output->data))
|
||||
|
|
@ -689,7 +684,7 @@ class adminAdminModel extends admin
|
|||
}
|
||||
}
|
||||
|
||||
$returnObject = new Object();
|
||||
$returnObject = new BaseObject();
|
||||
$returnObject->add('favoriteList', $output->data);
|
||||
return $returnObject;
|
||||
}
|
||||
|
|
@ -711,7 +706,7 @@ class adminAdminModel extends admin
|
|||
return $output;
|
||||
}
|
||||
|
||||
$returnObject = new Object();
|
||||
$returnObject = new BaseObject();
|
||||
if($output->data)
|
||||
{
|
||||
$returnObject->add('result', TRUE);
|
||||
|
|
|
|||
|
|
@ -565,6 +565,7 @@ class adminAdminView extends admin
|
|||
Context::set('use_rewrite', Rhymix\Framework\Config::get('use_rewrite'));
|
||||
Context::set('use_mobile_view', (config('mobile.enabled') !== null ? config('mobile.enabled') : config('use_mobile_view')) ? true : false);
|
||||
Context::set('tablets_as_mobile', config('mobile.tablets') ? true : false);
|
||||
Context::set('mobile_viewport', config('mobile.viewport') ?: 'width=device-width, initial-scale=1.0, user-scalable=yes');
|
||||
Context::set('use_ssl', Rhymix\Framework\Config::get('url.ssl'));
|
||||
Context::set('delay_session', Rhymix\Framework\Config::get('session.delay'));
|
||||
Context::set('use_session_keys', Rhymix\Framework\Config::get('session.use_keys'));
|
||||
|
|
@ -661,7 +662,7 @@ class adminAdminView extends admin
|
|||
$domain_info = getModel('module')->getSiteInfo($domain_srl);
|
||||
if ($domain_info->domain_srl != $domain_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_domain_not_found');
|
||||
return $this->setError('msg_domain_not_found');
|
||||
}
|
||||
}
|
||||
Context::set('domain_info', $domain_info);
|
||||
|
|
|
|||
|
|
@ -20,11 +20,11 @@ class admin extends ModuleObject
|
|||
|
||||
/**
|
||||
* Install admin module
|
||||
* @return Object
|
||||
* @return void
|
||||
*/
|
||||
function moduleInstall()
|
||||
{
|
||||
return new Object();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -44,7 +44,7 @@ class admin extends ModuleObject
|
|||
|
||||
/**
|
||||
* Update module
|
||||
* @return Object
|
||||
* @return void
|
||||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
|
|
@ -68,7 +68,6 @@ class admin extends ModuleObject
|
|||
}
|
||||
}
|
||||
}
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -248,6 +248,8 @@ $lang->timezone = 'Time Zone';
|
|||
$lang->use_mobile_view = 'Enable Mobile View';
|
||||
$lang->about_use_mobile_view = 'Show mobile page when visitors access with mobile devices.';
|
||||
$lang->tablets_as_mobile = 'Treat Tablets as Mobile';
|
||||
$lang->mobile_viewport = 'Mobile viewport Setting';
|
||||
$lang->about_mobile_viewport = 'The settings entered above will be output in a <meta name="viewport"> tag for mobile visitors.';
|
||||
$lang->thumbnail_target = 'Extract Thumbnail From';
|
||||
$lang->thumbnail_target_all = 'All images';
|
||||
$lang->thumbnail_target_attachment = 'Attached images only';
|
||||
|
|
|
|||
|
|
@ -244,6 +244,8 @@ $lang->timezone = '표준 시간대';
|
|||
$lang->use_mobile_view = '모바일 뷰 사용';
|
||||
$lang->about_use_mobile_view = '모바일 기기로 접속시 모바일 페이지를 보여줍니다.';
|
||||
$lang->tablets_as_mobile = '태블릿도 모바일 취급';
|
||||
$lang->mobile_viewport = '모바일 viewport 설정';
|
||||
$lang->about_mobile_viewport = '모바일 접속시 여기 입력한 내용이 <meta name="viewport"> 태그로 출력됩니다.';
|
||||
$lang->thumbnail_target = '썸네일 생성 대상';
|
||||
$lang->thumbnail_target_all = '모든 이미지 (외부 이미지 포함)';
|
||||
$lang->thumbnail_target_attachment = '첨부된 이미지';
|
||||
|
|
|
|||
|
|
@ -80,6 +80,13 @@
|
|||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label" for="mobile_viewport">{$lang->mobile_viewport}</label>
|
||||
<div class="x_controls">
|
||||
<input type="text" name="mobile_viewport" id="mobile_viewport" value="{$mobile_viewport}" style="min-width: 80%" />
|
||||
<p class="x_help-block">{$lang->about_mobile_viewport}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->use_db_session}</label>
|
||||
<div class="x_controls">
|
||||
|
|
|
|||
|
|
@ -14,11 +14,11 @@ class adminlogging extends ModuleObject
|
|||
|
||||
/**
|
||||
* Install adminlogging module
|
||||
* @return Object
|
||||
* @return void
|
||||
*/
|
||||
function moduleInstall()
|
||||
{
|
||||
return new Object();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -32,11 +32,11 @@ class adminlogging extends ModuleObject
|
|||
|
||||
/**
|
||||
* Update module
|
||||
* @return Object
|
||||
* @return void
|
||||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
return new Object();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
{
|
||||
if ($method !== 'default' && !isset($sending_methods[$method]))
|
||||
{
|
||||
return new Object(-1, 'msg_advanced_mailer_sending_method_is_invalid');
|
||||
return $this->setError('msg_advanced_mailer_sending_method_is_invalid');
|
||||
}
|
||||
if ($method !== 'default')
|
||||
{
|
||||
|
|
@ -69,9 +69,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
{
|
||||
if (!Rhymix\Framework\Config::get("mail.$method.$conf_name"))
|
||||
{
|
||||
return new Object(-1, sprintf(
|
||||
Context::getLang('msg_advanced_mailer_sending_method_is_not_configured'),
|
||||
Context::getLang('cmd_advanced_mailer_sending_method_' . $method)));
|
||||
return $this->setError('msg_advanced_mailer_sending_method_is_not_configured', lang('cmd_advanced_mailer_sending_method_' . $method));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -157,11 +155,11 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$clear_before_days = intval(Context::get('clear_before_days'));
|
||||
if (!in_array($status, array('success', 'error')))
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
if ($clear_before_days < 0)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$obj = new stdClass();
|
||||
|
|
@ -188,11 +186,11 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$clear_before_days = intval(Context::get('clear_before_days'));
|
||||
if (!in_array($status, array('success', 'error')))
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
if ($clear_before_days < 0)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$obj = new stdClass();
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
$total_count = $count->data->count;
|
||||
$total_page = max(1, ceil($total_count / 20));
|
||||
|
||||
$output = new Object();
|
||||
$output = new stdClass;
|
||||
$output->total_count = $total_count;
|
||||
$output->total_page = $total_page;
|
||||
$output->page = $page;
|
||||
|
|
|
|||
|
|
@ -208,7 +208,6 @@ class Advanced_Mailer extends ModuleObject
|
|||
public function moduleInstall()
|
||||
{
|
||||
$this->registerTriggers();
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -242,7 +241,6 @@ class Advanced_Mailer extends ModuleObject
|
|||
public function moduleUpdate()
|
||||
{
|
||||
$this->registerTriggers();
|
||||
return new Object(0, 'success_updated');
|
||||
}
|
||||
|
||||
public function recompileCache()
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ class autoinstallAdminController extends autoinstall
|
|||
$this->checkInstalled();
|
||||
|
||||
$oAdminController = getAdminController('admin');
|
||||
$output = $oAdminController->cleanFavorite();
|
||||
$oAdminController->cleanFavorite();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -404,7 +404,7 @@ class autoinstallAdminController extends autoinstall
|
|||
|
||||
$this->setMessage('success_deleted', 'update');
|
||||
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -354,7 +354,7 @@ class autoinstallAdminModel extends autoinstall
|
|||
$packageSrl = Context::get('package_srl');
|
||||
if(!$packageSrl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$package = $this->getInstallInfo($packageSrl);
|
||||
|
|
@ -389,12 +389,12 @@ class autoinstallAdminModel extends autoinstall
|
|||
|
||||
if($directModuleInstall==FALSE)
|
||||
{
|
||||
$output = new Object(-1, 'msg_direct_inall_invalid');
|
||||
$output = new BaseObject(-1, 'msg_direct_inall_invalid');
|
||||
$output->add('path', $arrUnwritableDir);
|
||||
return $output;
|
||||
}
|
||||
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
public function isWritableDir($path)
|
||||
|
|
@ -414,11 +414,11 @@ class autoinstallAdminModel extends autoinstall
|
|||
|
||||
if(FileHandler::isWritableDir($check_path)==FALSE)
|
||||
{
|
||||
$output = new Object(-1, 'msg_unwritable_directory');
|
||||
$output = new BaseObject(-1, 'msg_unwritable_directory');
|
||||
$output->add('path', FileHandler::getRealPath($check_path));
|
||||
return $output;
|
||||
}
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -156,8 +156,6 @@ class autoinstall extends ModuleObject
|
|||
{
|
||||
$oDB->addColumn('autoinstall_packages', 'have_instance', 'char', '1', 'N', TRUE);
|
||||
}
|
||||
|
||||
return new Object(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -156,15 +156,15 @@ class ModuleInstaller
|
|||
$oModule = getModule($target_name, "class");
|
||||
if(!$oModule)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
}
|
||||
if(!method_exists($oModule, "moduleUninstall"))
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
}
|
||||
|
||||
$output = $oModule->moduleUninstall();
|
||||
if($output instanceof Object && !$output->toBool())
|
||||
if($output instanceof BaseObject && !$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -181,7 +181,7 @@ class ModuleInstaller
|
|||
$oDB->dropTable($filename);
|
||||
}
|
||||
}
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -241,7 +241,7 @@ class ModuleInstaller
|
|||
$this->installModule();
|
||||
|
||||
FileHandler::removeDir($this->temp_dir);
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -359,12 +359,12 @@ class SFTPModuleInstaller extends ModuleInstaller
|
|||
{
|
||||
if(!function_exists('ssh2_connect'))
|
||||
{
|
||||
return new Object(-1, 'msg_sftp_not_supported');
|
||||
return new BaseObject(-1, 'msg_sftp_not_supported');
|
||||
}
|
||||
|
||||
if(!$this->ftp_info->ftp_user || !$this->ftp_info->sftp || $this->ftp_info->sftp != 'Y')
|
||||
{
|
||||
return new Object(-1, 'msg_ftp_invalid_auth_info');
|
||||
return new BaseObject(-1, 'msg_ftp_invalid_auth_info');
|
||||
}
|
||||
|
||||
if($this->ftp_info->ftp_host)
|
||||
|
|
@ -378,11 +378,11 @@ class SFTPModuleInstaller extends ModuleInstaller
|
|||
$this->connection = ssh2_connect($ftp_host, $this->ftp_info->ftp_port);
|
||||
if(!@ssh2_auth_password($this->connection, $this->ftp_info->ftp_user, $this->ftp_password))
|
||||
{
|
||||
return new Object(-1, 'msg_ftp_invalid_auth_info');
|
||||
return new BaseObject(-1, 'msg_ftp_invalid_auth_info');
|
||||
}
|
||||
$_SESSION['ftp_password'] = $this->ftp_password;
|
||||
$this->sftp = ssh2_sftp($this->connection);
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -411,9 +411,9 @@ class SFTPModuleInstaller extends ModuleInstaller
|
|||
|
||||
if(!@ssh2_sftp_unlink($this->sftp, $target_path))
|
||||
{
|
||||
return new Object(-1, sprintf(lang('msg_delete_file_failed'), $path));
|
||||
return new BaseObject(-1, sprintf(lang('msg_delete_file_failed'), $path));
|
||||
}
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -432,9 +432,9 @@ class SFTPModuleInstaller extends ModuleInstaller
|
|||
|
||||
if(!@ssh2_sftp_rmdir($this->sftp, $target_path))
|
||||
{
|
||||
return new Object(-1, sprintf(lang('msg_delete_dir_failed'), $path));
|
||||
return new BaseObject(-1, sprintf(lang('msg_delete_dir_failed'), $path));
|
||||
}
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -447,7 +447,7 @@ class SFTPModuleInstaller extends ModuleInstaller
|
|||
{
|
||||
if(!$this->ftp_password)
|
||||
{
|
||||
return new Object(-1, 'msg_ftp_password_input');
|
||||
return new BaseObject(-1, 'msg_ftp_password_input');
|
||||
}
|
||||
|
||||
$output = $this->_connect();
|
||||
|
|
@ -477,7 +477,7 @@ class SFTPModuleInstaller extends ModuleInstaller
|
|||
ssh2_scp_send($this->connection, FileHandler::getRealPath($this->download_path . "/" . $org_file), $target_dir . "/" . $file);
|
||||
}
|
||||
}
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -532,14 +532,14 @@ class PHPFTPModuleInstaller extends ModuleInstaller
|
|||
$this->connection = ftp_connect($ftp_host, $this->ftp_info->ftp_port);
|
||||
if(!$this->connection)
|
||||
{
|
||||
return new Object(-1, sprintf(lang('msg_ftp_not_connected'), 'host'));
|
||||
return new BaseObject(-1, sprintf(lang('msg_ftp_not_connected'), 'host'));
|
||||
}
|
||||
|
||||
$login_result = @ftp_login($this->connection, $this->ftp_info->ftp_user, $this->ftp_password);
|
||||
if(!$login_result)
|
||||
{
|
||||
$this->_close();
|
||||
return new Object(-1, 'msg_ftp_invalid_auth_info');
|
||||
return new BaseObject(-1, 'msg_ftp_invalid_auth_info');
|
||||
}
|
||||
|
||||
$_SESSION['ftp_password'] = $this->ftp_password;
|
||||
|
|
@ -547,7 +547,7 @@ class PHPFTPModuleInstaller extends ModuleInstaller
|
|||
{
|
||||
ftp_pasv($this->connection, TRUE);
|
||||
}
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -566,9 +566,9 @@ class PHPFTPModuleInstaller extends ModuleInstaller
|
|||
|
||||
if(!@ftp_delete($this->connection, $target_path))
|
||||
{
|
||||
return new Object(-1, "failed to delete file " . $path);
|
||||
return new BaseObject(-1, "failed to delete file " . $path);
|
||||
}
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -587,9 +587,9 @@ class PHPFTPModuleInstaller extends ModuleInstaller
|
|||
|
||||
if(!@ftp_rmdir($this->connection, $target_path))
|
||||
{
|
||||
return new Object(-1, "failed to delete directory " . $path);
|
||||
return new BaseObject(-1, "failed to delete directory " . $path);
|
||||
}
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -612,7 +612,7 @@ class PHPFTPModuleInstaller extends ModuleInstaller
|
|||
{
|
||||
if(!$this->ftp_password)
|
||||
{
|
||||
return new Object(-1, 'msg_ftp_password_input');
|
||||
return new BaseObject(-1, 'msg_ftp_password_input');
|
||||
}
|
||||
|
||||
$output = $this->_connect();
|
||||
|
|
@ -662,7 +662,7 @@ class PHPFTPModuleInstaller extends ModuleInstaller
|
|||
{
|
||||
if(!@ftp_mkdir($this->connection, $ftp_path))
|
||||
{
|
||||
return new Object(-1, "msg_make_directory_failed");
|
||||
return new BaseObject(-1, "msg_make_directory_failed");
|
||||
}
|
||||
|
||||
if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN')
|
||||
|
|
@ -671,14 +671,14 @@ class PHPFTPModuleInstaller extends ModuleInstaller
|
|||
{
|
||||
if(!ftp_chmod($this->connection, 0755, $ftp_path))
|
||||
{
|
||||
return new Object(-1, "msg_permission_adjust_failed");
|
||||
return new BaseObject(-1, "msg_permission_adjust_failed");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!ftp_site($this->connection, "CHMOD 755 " . $ftp_path))
|
||||
{
|
||||
return new Object(-1, "msg_permission_adjust_failed");
|
||||
return new BaseObject(-1, "msg_permission_adjust_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -686,12 +686,12 @@ class PHPFTPModuleInstaller extends ModuleInstaller
|
|||
}
|
||||
if(!ftp_put($this->connection, $target_dir . '/' . $file, FileHandler::getRealPath($this->download_path . "/" . $org_file), FTP_BINARY))
|
||||
{
|
||||
return new Object(-1, "msg_ftp_upload_failed");
|
||||
return new BaseObject(-1, "msg_ftp_upload_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->_close();
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -745,15 +745,15 @@ class FTPModuleInstaller extends ModuleInstaller
|
|||
$this->oFtp = new ftp();
|
||||
if(!$this->oFtp->ftp_connect($ftp_host, $this->ftp_info->ftp_port))
|
||||
{
|
||||
return new Object(-1, sprintf(lang('msg_ftp_not_connected'), 'host'));
|
||||
return new BaseObject(-1, sprintf(lang('msg_ftp_not_connected'), 'host'));
|
||||
}
|
||||
if(!$this->oFtp->ftp_login($this->ftp_info->ftp_user, $this->ftp_password))
|
||||
{
|
||||
$this->_close();
|
||||
return new Object(-1, 'msg_ftp_invalid_auth_info');
|
||||
return new BaseObject(-1, 'msg_ftp_invalid_auth_info');
|
||||
}
|
||||
$_SESSION['ftp_password'] = $this->ftp_password;
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -772,9 +772,9 @@ class FTPModuleInstaller extends ModuleInstaller
|
|||
|
||||
if(!$this->oFtp->ftp_delete($target_path))
|
||||
{
|
||||
return new Object(-1, sprintf(lang('msg_delete_file_failed'), $path));
|
||||
return new BaseObject(-1, sprintf(lang('msg_delete_file_failed'), $path));
|
||||
}
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -792,9 +792,9 @@ class FTPModuleInstaller extends ModuleInstaller
|
|||
|
||||
if(!$this->oFtp->ftp_rmdir($target_path))
|
||||
{
|
||||
return new Object(-1, sprintf(lang('msg_delete_dir_failed'), $path));
|
||||
return new BaseObject(-1, sprintf(lang('msg_delete_dir_failed'), $path));
|
||||
}
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -817,7 +817,7 @@ class FTPModuleInstaller extends ModuleInstaller
|
|||
{
|
||||
if(!$this->ftp_password)
|
||||
{
|
||||
return new Object(-1, 'msg_ftp_password_input');
|
||||
return new BaseObject(-1, 'msg_ftp_password_input');
|
||||
}
|
||||
|
||||
$output = $this->_connect();
|
||||
|
|
@ -864,7 +864,7 @@ class FTPModuleInstaller extends ModuleInstaller
|
|||
|
||||
$this->_close();
|
||||
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -892,7 +892,7 @@ class DirectModuleInstaller extends ModuleInstaller
|
|||
*/
|
||||
function _connect()
|
||||
{
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -911,9 +911,9 @@ class DirectModuleInstaller extends ModuleInstaller
|
|||
|
||||
if(!FileHandler::removeFile($target_path))
|
||||
{
|
||||
return new Object(-1, sprintf(lang('msg_delete_file_failed'), $path));
|
||||
return new BaseObject(-1, sprintf(lang('msg_delete_file_failed'), $path));
|
||||
}
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -931,7 +931,7 @@ class DirectModuleInstaller extends ModuleInstaller
|
|||
|
||||
FileHandler::removeDir($target_path);
|
||||
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -989,7 +989,7 @@ class DirectModuleInstaller extends ModuleInstaller
|
|||
|
||||
$this->_close();
|
||||
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ class boardAdminController extends board {
|
|||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
if($module_info->mid != $mid)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$module_info->hide_category = Context::get('hide_category') == 'Y' ? 'Y' : 'N';
|
||||
|
|
|
|||
|
|
@ -75,8 +75,6 @@ class board extends ModuleObject
|
|||
$oModuleController->updateSite($site_args);
|
||||
}
|
||||
}
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -113,14 +111,12 @@ class board extends ModuleObject
|
|||
{
|
||||
$oModuleController->insertTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after');
|
||||
}
|
||||
|
||||
return new Object(0, 'success_updated');
|
||||
}
|
||||
|
||||
function moduleUninstall()
|
||||
{
|
||||
$output = executeQueryArray("board.getAllBoard");
|
||||
if(!$output->data) return new Object();
|
||||
if(!$output->data) return new BaseObject();
|
||||
@set_time_limit(0);
|
||||
|
||||
$oModuleController = getController('module');
|
||||
|
|
@ -130,6 +126,6 @@ class board extends ModuleObject
|
|||
$oModuleController->deleteModule($board->module_srl);
|
||||
}
|
||||
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class boardController extends board
|
|||
// check grant
|
||||
if(!$this->grant->write_document)
|
||||
{
|
||||
return new Object(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
// setup variables
|
||||
|
|
@ -35,7 +35,7 @@ class boardController extends board
|
|||
// Return error if content is empty.
|
||||
if (is_empty_html_content($obj->content))
|
||||
{
|
||||
return new Object(-1, 'msg_empty_content');
|
||||
return $this->setError('msg_empty_content');
|
||||
}
|
||||
|
||||
// unset document style if not manager
|
||||
|
|
@ -100,14 +100,14 @@ class boardController extends board
|
|||
{
|
||||
if(!$oDocument->isGranted())
|
||||
{
|
||||
return new Object(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
// Protect admin document
|
||||
$member_info = getModel('member')->getMemberInfoByMemberSrl($oDocument->get('member_srl'));
|
||||
if($member_info->is_admin == 'Y' && $logged_info->is_admin != 'Y')
|
||||
{
|
||||
return new Object(-1, 'msg_admin_document_no_modify');
|
||||
return $this->setError('msg_admin_document_no_modify');
|
||||
}
|
||||
|
||||
// if document status is temp
|
||||
|
|
@ -131,7 +131,7 @@ class boardController extends board
|
|||
{
|
||||
if($oDocument->get('comment_count') > 0 && !$this->grant->manager)
|
||||
{
|
||||
return new Object(-1, 'msg_protect_update_content');
|
||||
return $this->setError('msg_protect_update_content');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -140,7 +140,7 @@ class boardController extends board
|
|||
{
|
||||
if($oDocument->get('regdate') < date('YmdHis', strtotime('-' . $this->module_info->protect_document_regdate . ' day')))
|
||||
{
|
||||
return new Object(-1, sprintf(lang('msg_protect_regdate_document'), $this->module_info->protect_document_regdate));
|
||||
return $this->setError(sprintf(lang('msg_protect_regdate_document'), $this->module_info->protect_document_regdate));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -228,7 +228,7 @@ class boardController extends board
|
|||
$logged_info = Context::get('logged_info');
|
||||
if(!$update_id)
|
||||
{
|
||||
return new Object(-1, 'msg_no_update_id');
|
||||
return $this->setError('msg_no_update_id');
|
||||
}
|
||||
|
||||
$oDocumentModel = getModel('document');
|
||||
|
|
@ -240,13 +240,13 @@ class boardController extends board
|
|||
$Exists_log = $oDocumentModel->getUpdateLogAdminisExists($update_log->document_srl);
|
||||
if($Exists_log === true)
|
||||
{
|
||||
return new Object(-1, 'msg_admin_update_log');
|
||||
return $this->setError('msg_admin_update_log');
|
||||
}
|
||||
}
|
||||
|
||||
if(!$update_log)
|
||||
{
|
||||
return new Object(-1, 'msg_no_update_log');
|
||||
return $this->setError('msg_no_update_log');
|
||||
}
|
||||
|
||||
$oDocument = $oDocumentModel->getDocument($update_log->document_srl);
|
||||
|
|
@ -275,7 +275,7 @@ class boardController extends board
|
|||
// if the document is not existed
|
||||
if(!$document_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_document');
|
||||
return $this->setError('msg_invalid_document');
|
||||
}
|
||||
|
||||
$oDocumentModel = &getModel('document');
|
||||
|
|
@ -285,7 +285,7 @@ class boardController extends board
|
|||
{
|
||||
if($oDocument->get('comment_count') > 0 && $this->grant->manager == false)
|
||||
{
|
||||
return new Object(-1, 'msg_protect_delete_content');
|
||||
return $this->setError('msg_protect_delete_content');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -295,7 +295,7 @@ class boardController extends board
|
|||
{
|
||||
$format = lang('msg_protect_regdate_document');
|
||||
$massage = sprintf($format, $this->module_info->protect_document_regdate);
|
||||
return new Object(-1, $massage);
|
||||
return $this->setError($massage);
|
||||
}
|
||||
}
|
||||
// generate document module controller object
|
||||
|
|
@ -349,7 +349,7 @@ class boardController extends board
|
|||
// check grant
|
||||
if(!$this->grant->write_comment)
|
||||
{
|
||||
return new Object(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
|
|
@ -378,7 +378,7 @@ class boardController extends board
|
|||
$oDocument = $oDocumentModel->getDocument($obj->document_srl);
|
||||
if(!$oDocument->isExists())
|
||||
{
|
||||
return new Object(-1,'msg_not_founded');
|
||||
return $this->setError('msg_not_founded');
|
||||
}
|
||||
|
||||
// For anonymous use, remove writer's information and notifying information
|
||||
|
|
@ -416,7 +416,7 @@ class boardController extends board
|
|||
$childs = $oCommentModel->getChildComments($obj->comment_srl);
|
||||
if(count($childs) > 0)
|
||||
{
|
||||
return new Object(-1, 'msg_board_update_protect_comment');
|
||||
return $this->setError('msg_board_update_protect_comment');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -426,7 +426,7 @@ class boardController extends board
|
|||
|
||||
if($member_info->is_admin == 'Y' && $logged_info->is_admin != 'Y')
|
||||
{
|
||||
return new Object(-1, 'msg_admin_comment_no_modify');
|
||||
return $this->setError('msg_admin_comment_no_modify');
|
||||
}
|
||||
|
||||
// INSERT if comment_srl does not exist.
|
||||
|
|
@ -441,7 +441,7 @@ class boardController extends board
|
|||
$parent_comment = $oCommentModel->getComment($obj->parent_srl);
|
||||
if(!$parent_comment->comment_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
if($parent_comment->isSecret() && $this->module_info->secret === 'Y')
|
||||
{
|
||||
|
|
@ -470,13 +470,13 @@ class boardController extends board
|
|||
{
|
||||
$format = lang('msg_protect_regdate_comment');
|
||||
$massage = sprintf($format, $this->module_info->protect_document_regdate);
|
||||
return new Object(-1, $massage);
|
||||
return $this->setError($massage);
|
||||
}
|
||||
}
|
||||
// check the grant
|
||||
if(!$comment->isGranted())
|
||||
{
|
||||
return new Object(-1,'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
$obj->parent_srl = $comment->parent_srl;
|
||||
$output = $oCommentController->updateComment($obj, $this->grant->manager);
|
||||
|
|
@ -510,7 +510,7 @@ class boardController extends board
|
|||
|
||||
if(!$comment_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$oCommentModel = getModel('comment');
|
||||
|
|
@ -520,7 +520,7 @@ class boardController extends board
|
|||
$childs = $oCommentModel->getChildComments($comment_srl);
|
||||
if(count($childs) > 0)
|
||||
{
|
||||
return new Object(-1, 'msg_board_delete_protect_comment');
|
||||
return $this->setError('msg_board_delete_protect_comment');
|
||||
}
|
||||
}
|
||||
$comment = $oCommentModel->getComment($comment_srl, $this->grant->manager);
|
||||
|
|
@ -530,7 +530,7 @@ class boardController extends board
|
|||
{
|
||||
$format = lang('msg_protect_regdate_comment');
|
||||
$massage = sprintf($format, $this->module_info->protect_document_regdate);
|
||||
return new Object(-1, $massage);
|
||||
return $this->setError($massage);
|
||||
}
|
||||
}
|
||||
// generate comment controller object
|
||||
|
|
@ -642,13 +642,13 @@ class boardController extends board
|
|||
$oComment = $oCommentModel->getComment($comment_srl);
|
||||
if(!$oComment->isExists())
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// compare the comment password and the user input password
|
||||
if(!$oMemberModel->isValidPassword($oComment->get('password'),$password))
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_password');
|
||||
return $this->setError('msg_invalid_password');
|
||||
}
|
||||
|
||||
$oComment->setGrantForSession();
|
||||
|
|
@ -658,13 +658,13 @@ class boardController extends board
|
|||
$oDocument = $oDocumentModel->getDocument($document_srl);
|
||||
if(!$oDocument->isExists())
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// compare the document password and the user input password
|
||||
if(!$oMemberModel->isValidPassword($oDocument->get('password'),$password))
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_password');
|
||||
return $this->setError('msg_invalid_password');
|
||||
}
|
||||
|
||||
$oDocument->setGrantForSession();
|
||||
|
|
@ -681,7 +681,7 @@ class boardController extends board
|
|||
|
||||
if(!$member_srl || !$mid)
|
||||
{
|
||||
return new Object();
|
||||
return;
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
|
@ -693,7 +693,7 @@ class boardController extends board
|
|||
|
||||
if($cur_module_info->module != 'board')
|
||||
{
|
||||
return new Object();
|
||||
return;
|
||||
}
|
||||
|
||||
// get the member information
|
||||
|
|
@ -707,15 +707,13 @@ class boardController extends board
|
|||
|
||||
if(!$member_info->user_id)
|
||||
{
|
||||
return new Object();
|
||||
return;
|
||||
}
|
||||
|
||||
//search
|
||||
$url = getUrl('','mid',$mid,'search_target','nick_name','search_keyword',$member_info->nick_name);
|
||||
$oMemberController = getController('member');
|
||||
$oMemberController->addMemberPopupMenu($url, 'cmd_view_own_document', '');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) NAVER <http://www.navercorp.com> */
|
||||
|
||||
require_once(_XE_PATH_.'modules/board/board.view.php');
|
||||
|
||||
class boardMobile extends boardView
|
||||
{
|
||||
function init()
|
||||
|
|
@ -87,36 +85,12 @@ class boardMobile extends boardView
|
|||
Context::addJsFilter($this->module_path.'tpl/filter', 'input_password.xml');
|
||||
}
|
||||
|
||||
function dispBoardCategory()
|
||||
{
|
||||
$this->dispBoardCategoryList();
|
||||
$category_list = Context::get('category_list');
|
||||
$this->setTemplateFile('category.html');
|
||||
}
|
||||
|
||||
function getBoardCommentPage()
|
||||
{
|
||||
$document_srl = Context::get('document_srl');
|
||||
$oDocumentModel =& getModel('document');
|
||||
if(!$document_srl)
|
||||
{
|
||||
return new Object(-1, "msg_invalid_request");
|
||||
}
|
||||
|
||||
if($this->grant->view == false || ($this->module_info->consultation == 'Y' && !$this->grant->manager && !$this->grant->consultation_read))
|
||||
{
|
||||
return new Object(-1, "msg_not_permitted");
|
||||
}
|
||||
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl);
|
||||
if(!$oDocument->isExists())
|
||||
{
|
||||
return new Object(-1, "msg_invalid_request");
|
||||
}
|
||||
Context::set('oDocument', $oDocument);
|
||||
$oTemplate = TemplateHandler::getInstance();
|
||||
$html = $oTemplate->compile($this->getTemplatePath(), "comment.html");
|
||||
$this->add("html", $html);
|
||||
{
|
||||
$this->dispBoardCommentPage();
|
||||
$oTemplate = TemplateHandler::getInstance();
|
||||
$html = $oTemplate->compile($this->getTemplatePath(), 'comment.html');
|
||||
$this->add('html', $html);
|
||||
}
|
||||
|
||||
function dispBoardMessage($msg_code)
|
||||
|
|
|
|||
|
|
@ -351,8 +351,6 @@ class boardView extends board
|
|||
* add javascript filters
|
||||
**/
|
||||
Context::addJsFilter($this->module_path.'tpl/filter', 'insert_comment.xml');
|
||||
|
||||
// return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -642,6 +640,43 @@ class boardView extends board
|
|||
$this->setTemplateFile('tag_list');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief display category list
|
||||
*/
|
||||
function dispBoardCategory()
|
||||
{
|
||||
$this->dispBoardCategoryList();
|
||||
$this->setTemplateFile('category.html');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief display comment page
|
||||
*/
|
||||
function dispBoardCommentPage()
|
||||
{
|
||||
$document_srl = Context::get('document_srl');
|
||||
if(!$document_srl)
|
||||
{
|
||||
return $this->setError("msg_invalid_request");
|
||||
}
|
||||
|
||||
if($this->grant->view == false || ($this->module_info->consultation == 'Y' && !$this->grant->manager && !$this->grant->consultation_read))
|
||||
{
|
||||
return $this->setError("msg_not_permitted");
|
||||
}
|
||||
|
||||
$oDocument = getModel('document')->getDocument($document_srl);
|
||||
if(!$oDocument->isExists())
|
||||
{
|
||||
return $this->setError("msg_invalid_request");
|
||||
}
|
||||
Context::set('oDocument', $oDocument);
|
||||
|
||||
$this->setLayoutPath('./common/tpl');
|
||||
$this->setLayoutFile('default_layout');
|
||||
$this->setTemplateFile('comment.html');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief display document write form
|
||||
**/
|
||||
|
|
@ -730,20 +765,20 @@ class boardView extends board
|
|||
{
|
||||
$format = lang('msg_protect_regdate_document');
|
||||
$massage = sprintf($format, $this->module_info->protect_document_regdate);
|
||||
return new Object(-1, $massage);
|
||||
return $this->setError($massage);
|
||||
}
|
||||
}
|
||||
if($this->module_info->protect_content == "Y" || $this->module_info->protect_update_content == 'Y')
|
||||
{
|
||||
if($oDocument->get('comment_count') > 0 && $this->grant->manager == false)
|
||||
{
|
||||
return new Object(-1, 'msg_protect_update_content');
|
||||
return $this->setError('msg_protect_update_content');
|
||||
}
|
||||
}
|
||||
}
|
||||
if($member_info->is_admin == 'Y' && $logged_info->is_admin != 'Y')
|
||||
{
|
||||
return new Object(-1, 'msg_admin_document_no_modify');
|
||||
return $this->setError('msg_admin_document_no_modify');
|
||||
}
|
||||
|
||||
// if the document is not granted, then back to the password input form
|
||||
|
|
@ -857,7 +892,7 @@ class boardView extends board
|
|||
{
|
||||
$format = lang('msg_protect_regdate_document');
|
||||
$massage = sprintf($format, $this->module_info->protect_document_regdate);
|
||||
return new Object(-1, $massage);
|
||||
return $this->setError($massage);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -865,7 +900,7 @@ class boardView extends board
|
|||
{
|
||||
if($oDocument->get('comment_count')>0 && $this->grant->manager == false)
|
||||
{
|
||||
return new Object(-1,'msg_protect_delete_content');
|
||||
return $this->setError('msg_protect_delete_content');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -942,7 +977,7 @@ class boardView extends board
|
|||
// if the parent comment is not existed
|
||||
if(!$parent_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// get the comment
|
||||
|
|
@ -1004,7 +1039,7 @@ class boardView extends board
|
|||
// if the comment is not existed
|
||||
if(!$comment_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// get comment information
|
||||
|
|
@ -1019,7 +1054,7 @@ class boardView extends board
|
|||
{
|
||||
$format = lang('msg_protect_regdate_comment');
|
||||
$massage = sprintf($format, $this->module_info->protect_document_regdate);
|
||||
return new Object(-1, $massage);
|
||||
return $this->setError($massage);
|
||||
}
|
||||
}
|
||||
if($this->module_info->protect_update_comment === 'Y' && $this->grant->manager == false)
|
||||
|
|
@ -1027,13 +1062,13 @@ class boardView extends board
|
|||
$childs = $oCommentModel->getChildComments($comment_srl);
|
||||
if(count($childs) > 0)
|
||||
{
|
||||
return new Object(-1, 'msg_board_update_protect_comment');
|
||||
return $this->setError('msg_board_update_protect_comment');
|
||||
}
|
||||
}
|
||||
|
||||
if($member_info->is_admin == 'Y' && $logged_info->is_admin != 'Y')
|
||||
{
|
||||
return new Object(-1, 'msg_admin_comment_no_modify');
|
||||
return $this->setError('msg_admin_comment_no_modify');
|
||||
}
|
||||
|
||||
// if the comment is not exited, alert an error message
|
||||
|
|
@ -1087,7 +1122,7 @@ class boardView extends board
|
|||
{
|
||||
$format = lang('msg_protect_regdate_comment');
|
||||
$massage = sprintf($format, $this->module_info->protect_document_regdate);
|
||||
return new Object(-1, $massage);
|
||||
return $this->setError($massage);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1097,7 +1132,7 @@ class boardView extends board
|
|||
$childs = $oCommentModel->getChildComments($comment_srl);
|
||||
if(count($childs) > 0)
|
||||
{
|
||||
return new Object(-1, 'msg_board_delete_protect_comment');
|
||||
return $this->setError('msg_board_delete_protect_comment');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1177,7 +1212,7 @@ class boardView extends board
|
|||
|
||||
if($this->grant->update_view !== true)
|
||||
{
|
||||
return new Object(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
$updatelog = $oDocumentModel->getDocumentUpdateLog($document_srl);
|
||||
|
|
@ -1197,7 +1232,7 @@ class boardView extends board
|
|||
|
||||
if($this->grant->update_view !== true)
|
||||
{
|
||||
return new Object(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
$update_log = $oDocumentModel->getUpdateLog($update_id);
|
||||
|
|
@ -1233,7 +1268,7 @@ class boardView extends board
|
|||
{
|
||||
iF($this->grant->vote_log_view !== true)
|
||||
{
|
||||
return new Object(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
$oMemberModel = getModel('member');
|
||||
|
|
@ -1254,7 +1289,7 @@ class boardView extends board
|
|||
}
|
||||
else
|
||||
{
|
||||
return new Object(-1, 'msg_not_target');
|
||||
return $this->setError('msg_not_target');
|
||||
}
|
||||
|
||||
$output = executeQueryArray($queryId, $args);
|
||||
|
|
|
|||
|
|
@ -75,7 +75,8 @@
|
|||
<action name="dispBoardContentCommentList" type="view" permission="view" standalone="false" />
|
||||
<action name="dispBoardContentFileList" type="view" permission="view" standalone="false" />
|
||||
<action name="dispBoardTagList" type="view" permission="list" standalone="false" />
|
||||
<action name="dispBoardCategory" type="mobile" permission="list" standalone="false" />
|
||||
<action name="dispBoardCategory" type="view" permission="list" standalone="false" />
|
||||
<action name="dispBoardCommentPage" type="view" permission="view" standalone="false" />
|
||||
<action name="getBoardCommentPage" type="mobile" permission="view" standalone="false" />
|
||||
|
||||
<action name="procBoardInsertDocument" type="controller" permission="write_document" standalone="false" ruleset="insertDocument" />
|
||||
|
|
|
|||
1
modules/board/skins/default/comment.html
Normal file
1
modules/board/skins/default/comment.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<include target="_comment.html" />
|
||||
|
|
@ -101,10 +101,9 @@
|
|||
</div>
|
||||
<div class="tns">
|
||||
{@ $tag_list = $oDocument->get('tag_list') }
|
||||
<span class="tags" cond="count($tag_list)">
|
||||
<span class="tags" cond="$tag_list">
|
||||
<i class="xi-tags"></i>
|
||||
<!--@for($i=0;$i<count($tag_list);$i++)-->
|
||||
{@ $tag = $tag_list[$i]; }
|
||||
<!--@foreach($tag_list as $tag)-->
|
||||
<a href="{getUrl('search_target','tag','search_keyword',$tag,'document_srl','')}" class="tag" rel="tag">{htmlspecialchars($tag)}</a><span>,</span>
|
||||
<!--@end-->
|
||||
</span>
|
||||
|
|
|
|||
1
modules/board/skins/xedition/comment.html
Normal file
1
modules/board/skins/xedition/comment.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<include target="_comment.html" />
|
||||
|
|
@ -2,9 +2,9 @@
|
|||
<include cond="$oDocument->isExists()" target="_read.html" />
|
||||
<ul class="cTab" cond="$module_info->use_category=='Y'">
|
||||
<li class="on"|cond="!$category"><a href="{getUrl('category','','page','')}">{$lang->total}</a></li>
|
||||
<li loop="$cate_list=>$key,$val" class="on"|cond="$category==$val->category_srl"><a href="{getUrl(category,$val->category_srl,'document_srl','', 'page', '')}">{$val->title}<!--<em cond="$val->document_count">[{$val->document_count}]</em>--></a>
|
||||
<li loop="$cate_list=>$key,$val" class="on"|cond="$category==$val->category_srl"><a href="{getUrl('category',$val->category_srl,'document_srl','', 'page', '')}">{$val->title}<!--<em cond="$val->document_count">[{$val->document_count}]</em>--></a>
|
||||
<ul cond="count($val->children)">
|
||||
<li loop="$val->children=>$idx,$item" class="on_"|cond="$category==$item->category_srl"><a href="{getUrl(category,$item->category_srl,'document_srl','', 'page', '')}">{$item->title}<!--<em cond="$val->document_count">[{$item->document_count}]</em>--></a></li>
|
||||
<li loop="$val->children=>$idx,$item" class="on_"|cond="$category==$item->category_srl"><a href="{getUrl('category',$item->category_srl,'document_srl','', 'page', '')}">{$item->title}<!--<em cond="$val->document_count">[{$item->document_count}]</em>--></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -47,11 +47,7 @@
|
|||
|
||||
<div class="x_clearfix">
|
||||
<form cond="$page_navigation" action="./" class="x_pagination x_pull-left" no-error-return-url="true" style="margin-top:0">
|
||||
{@
|
||||
$urlInfo = parse_url(getRequestUriByServerEnviroment());
|
||||
parse_str($urlInfo['query'], $param);
|
||||
}
|
||||
<input loop="$param => $key, $val" cond="!in_array($key, array('mid', 'vid', 'act'))" type="hidden" name="{$key}" value="{$val}" />
|
||||
<input type="hidden" name="module" value="{$module}" />
|
||||
<ul>
|
||||
<li class="x_disabled"|cond="!$page || $page == 1"><a href="{getUrl('page', '')}">« {$lang->first_page}</a></li>
|
||||
<block cond="$page_navigation->first_page != 1 && $page_navigation->first_page + $page_navigation->page_count > $page_navigation->last_page - 1 && $page_navigation->page_count != $page_navigation->total_page">
|
||||
|
|
@ -87,7 +83,7 @@
|
|||
</span>
|
||||
</div>
|
||||
<form action="" class="search x_input-append center" no-error-return-url="true">
|
||||
<input loop="$param => $key, $val" cond="!in_array($key, array('mid', 'vid', 'act', 'page', 'search_target', 'search_keyword'))" type="hidden" name="{$key}" value="{$val}" />
|
||||
<input type="hidden" name="module" value="{$module}" />
|
||||
<select cond="count($module_category)" name="module_category_srl" title="{$lang->module_category}" style="margin-right:4px">
|
||||
<option value="" selected="selected"|cond="!$module_category_srl">{$lang->all}</option>
|
||||
<option value="0" selected="selected"|cond="$module_category_srl==='0'">{$lang->not_exists}</option>
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class commentAdminController extends comment
|
|||
$comment = $oCommentModel->getComment($comment_srl);
|
||||
if($comment->comment_srl != $comment_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
$document_srl = $comment->document_srl;
|
||||
if(!in_array($document_srl, $updated_documents_arr))
|
||||
|
|
|
|||
|
|
@ -33,8 +33,6 @@ class comment extends ModuleObject
|
|||
$oModuleController->insertTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after');
|
||||
// 2008. 02. 22 add comment setting when a new module added
|
||||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -194,8 +192,6 @@ class comment extends ModuleObject
|
|||
{
|
||||
$oDB->addIndex('comments', 'idx_parent_srl', array('parent_srl'));
|
||||
}
|
||||
|
||||
return new Object(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -29,13 +29,13 @@ class commentController extends comment
|
|||
{
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$comment_srl = Context::get('target_srl');
|
||||
if(!$comment_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$oCommentModel = getModel('comment');
|
||||
|
|
@ -43,14 +43,14 @@ class commentController extends comment
|
|||
$module_srl = $oComment->get('module_srl');
|
||||
if(!$module_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
$comment_config = $oModuleModel->getModulePartConfig('comment', $module_srl);
|
||||
if($comment_config->use_vote_up == 'N')
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$point = 1;
|
||||
|
|
@ -61,21 +61,21 @@ class commentController extends comment
|
|||
|
||||
function procCommentVoteUpCancel()
|
||||
{
|
||||
if(!Context::get('logged_info')) return new Object(-1, 'msg_invalid_request');
|
||||
if(!Context::get('logged_info')) return $this->setError('msg_invalid_request');
|
||||
|
||||
$comment_srl = Context::get('target_srl');
|
||||
if(!$comment_srl) return new Object(-1, 'msg_invalid_request');
|
||||
if(!$comment_srl) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oCommentModel = getModel('comment');
|
||||
$oComment = $oCommentModel->getComment($comment_srl, FALSE, FALSE);
|
||||
if($oComment->get('voted_count') <= 0)
|
||||
{
|
||||
return new Object(-1, 'msg_comment_voted_cancel_not');
|
||||
return $this->setError('msg_comment_voted_cancel_not');
|
||||
}
|
||||
$point = 1;
|
||||
$output = $this->updateVotedCountCancel($comment_srl, $oComment, $point);
|
||||
|
||||
$output = new Object();
|
||||
$output = new BaseObject();
|
||||
$output->setMessage('success_voted_canceled');
|
||||
|
||||
return $output;
|
||||
|
|
@ -90,13 +90,13 @@ class commentController extends comment
|
|||
{
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$comment_srl = Context::get('target_srl');
|
||||
if(!$comment_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$oCommentModel = getModel('comment');
|
||||
|
|
@ -104,14 +104,14 @@ class commentController extends comment
|
|||
$module_srl = $oComment->get('module_srl');
|
||||
if(!$module_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
$comment_config = $oModuleModel->getModulePartConfig('comment', $module_srl);
|
||||
if($comment_config->use_vote_down == 'N')
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$point = -1;
|
||||
|
|
@ -122,21 +122,21 @@ class commentController extends comment
|
|||
|
||||
function procCommentVoteDownCancel()
|
||||
{
|
||||
if(!Context::get('logged_info')) return new Object(-1, 'msg_invalid_request');
|
||||
if(!Context::get('logged_info')) return $this->setError('msg_invalid_request');
|
||||
|
||||
$comment_srl = Context::get('target_srl');
|
||||
if(!$comment_srl) return new Object(-1, 'msg_invalid_request');
|
||||
if(!$comment_srl) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oCommentModel = getModel('comment');
|
||||
$oComment = $oCommentModel->getComment($comment_srl, FALSE, FALSE);
|
||||
if($oComment->get('blamed_count') >= 0)
|
||||
{
|
||||
return new Object(-1, 'msg_comment_blamed_cancel_not');
|
||||
return $this->setError('msg_comment_blamed_cancel_not');
|
||||
}
|
||||
$point = -1;
|
||||
$output = $this->updateVotedCountCancel($comment_srl, $oComment, $point);
|
||||
|
||||
$output = new Object();
|
||||
$output = new BaseObject();
|
||||
$output->setMessage('success_blamed_canceled');
|
||||
|
||||
return $output;
|
||||
|
|
@ -193,13 +193,13 @@ class commentController extends comment
|
|||
{
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$comment_srl = Context::get('target_srl');
|
||||
if(!$comment_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// if an user select message from options, message would be the option.
|
||||
|
|
@ -226,7 +226,7 @@ class commentController extends comment
|
|||
$document_srl = $obj->document_srl;
|
||||
if(!$document_srl)
|
||||
{
|
||||
return new Object();
|
||||
return;
|
||||
}
|
||||
|
||||
return $this->deleteComments($document_srl, $obj);
|
||||
|
|
@ -241,7 +241,7 @@ class commentController extends comment
|
|||
$module_srl = $obj->module_srl;
|
||||
if(!$module_srl)
|
||||
{
|
||||
return new Object();
|
||||
return;
|
||||
}
|
||||
|
||||
$oCommentController = getAdminController('comment');
|
||||
|
|
@ -297,7 +297,7 @@ class commentController extends comment
|
|||
{
|
||||
if(!$manual_inserted && !checkCSRF())
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
}
|
||||
|
||||
if(!is_object($obj))
|
||||
|
|
@ -345,6 +345,9 @@ class commentController extends comment
|
|||
}
|
||||
$obj->__isupdate = FALSE;
|
||||
|
||||
// Remove manual member info to prevent forgery. This variable can be set by triggers only.
|
||||
unset($obj->manual_member_info);
|
||||
|
||||
// call a trigger (before)
|
||||
$output = ModuleHandler::triggerCall('comment.insertComment', 'before', $obj);
|
||||
if(!$output->toBool())
|
||||
|
|
@ -356,7 +359,7 @@ class commentController extends comment
|
|||
$document_srl = $obj->document_srl;
|
||||
if(!$document_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_document');
|
||||
return new BaseObject(-1, 'msg_invalid_document');
|
||||
}
|
||||
|
||||
// creat the comment model object
|
||||
|
|
@ -377,11 +380,11 @@ class commentController extends comment
|
|||
|
||||
if($document_srl != $oDocument->document_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_document');
|
||||
return new BaseObject(-1, 'msg_invalid_document');
|
||||
}
|
||||
if($oDocument->isLocked())
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
}
|
||||
|
||||
if($obj->homepage)
|
||||
|
|
@ -394,9 +397,9 @@ class commentController extends comment
|
|||
}
|
||||
|
||||
// input the member's information if logged-in
|
||||
if(Context::get('is_logged'))
|
||||
$logged_info = Context::get('logged_info');
|
||||
if(Context::get('is_logged') && !$obj->manual_member_info)
|
||||
{
|
||||
$logged_info = Context::get('logged_info');
|
||||
$obj->member_srl = $logged_info->member_srl;
|
||||
|
||||
// user_id, user_name and nick_name already encoded
|
||||
|
|
@ -411,7 +414,7 @@ class commentController extends comment
|
|||
// error display if neither of log-in info and user name exist.
|
||||
if(!$logged_info->member_srl && !$obj->nick_name)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
}
|
||||
|
||||
if(!$obj->comment_srl)
|
||||
|
|
@ -420,7 +423,7 @@ class commentController extends comment
|
|||
}
|
||||
elseif(!$is_admin && !$manual_inserted && !checkUserSequence($obj->comment_srl))
|
||||
{
|
||||
return new Object(-1, 'msg_not_permitted');
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
}
|
||||
|
||||
// determine the order
|
||||
|
|
@ -432,7 +435,7 @@ class commentController extends comment
|
|||
// Return error if content is empty.
|
||||
if (!$manual_inserted && is_empty_html_content($obj->content))
|
||||
{
|
||||
return new Object(-1, 'msg_empty_content');
|
||||
return new BaseObject(-1, 'msg_empty_content');
|
||||
}
|
||||
|
||||
// if use editor of nohtml, Remove HTML tags from the contents.
|
||||
|
|
@ -697,7 +700,7 @@ class commentController extends comment
|
|||
{
|
||||
if(!$manual_updated && !checkCSRF())
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
}
|
||||
|
||||
if(!is_object($obj))
|
||||
|
|
@ -707,6 +710,9 @@ class commentController extends comment
|
|||
|
||||
$obj->__isupdate = TRUE;
|
||||
|
||||
// Remove manual member info to prevent forgery. This variable can be set by triggers only.
|
||||
unset($obj->manual_member_info);
|
||||
|
||||
// call a trigger (before)
|
||||
$output = ModuleHandler::triggerCall('comment.updateComment', 'before', $obj);
|
||||
if(!$output->toBool())
|
||||
|
|
@ -731,7 +737,7 @@ class commentController extends comment
|
|||
// check if permission is granted
|
||||
if(!$is_admin && !$source_obj->isGranted())
|
||||
{
|
||||
return new Object(-1, 'msg_not_permitted');
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
}
|
||||
|
||||
if($obj->password)
|
||||
|
|
@ -750,7 +756,7 @@ class commentController extends comment
|
|||
|
||||
// set modifier's information if logged-in and posting author and modifier are matched.
|
||||
$logged_info = Context::get('logged_info');
|
||||
if(Context::get('is_logged'))
|
||||
if(Context::get('is_logged') && !$obj->manual_member_info)
|
||||
{
|
||||
if($source_obj->member_srl == $logged_info->member_srl)
|
||||
{
|
||||
|
|
@ -763,7 +769,7 @@ class commentController extends comment
|
|||
}
|
||||
|
||||
// if nick_name of the logged-in author doesn't exist
|
||||
if($source_obj->get('member_srl') && !$obj->nick_name)
|
||||
if($source_obj->get('member_srl') && !$obj->nick_name && !$obj->manual_member_info)
|
||||
{
|
||||
$obj->member_srl = $source_obj->get('member_srl');
|
||||
$obj->user_name = $source_obj->get('user_name');
|
||||
|
|
@ -782,7 +788,7 @@ class commentController extends comment
|
|||
// Return error if content is empty.
|
||||
if (!$manual_inserted && is_empty_html_content($obj->content))
|
||||
{
|
||||
return new Object(-1, 'msg_empty_content');
|
||||
return new BaseObject(-1, 'msg_empty_content');
|
||||
}
|
||||
|
||||
// if use editor of nohtml, Remove HTML tags from the contents.
|
||||
|
|
@ -831,7 +837,7 @@ class commentController extends comment
|
|||
{
|
||||
if (!$obj->comment_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
}
|
||||
|
||||
// call a trigger (before)
|
||||
|
|
@ -898,7 +904,7 @@ class commentController extends comment
|
|||
{
|
||||
if (!$obj->comment_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
}
|
||||
|
||||
// begin transaction
|
||||
|
|
@ -957,7 +963,7 @@ class commentController extends comment
|
|||
$comment = $oCommentModel->getComment($comment_srl);
|
||||
if($comment->comment_srl != $comment_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
}
|
||||
|
||||
$oMemberModel = getModel('member');
|
||||
|
|
@ -975,7 +981,7 @@ class commentController extends comment
|
|||
// check if permission is granted
|
||||
if(!$is_admin && !$comment->isGranted())
|
||||
{
|
||||
return new Object(-1, 'msg_not_permitted');
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
}
|
||||
|
||||
// check if child comment exists on the comment
|
||||
|
|
@ -1015,11 +1021,11 @@ class commentController extends comment
|
|||
|
||||
if(!$deleteAllComment)
|
||||
{
|
||||
return new Object(-1, 'fail_to_delete_have_children');
|
||||
return new BaseObject(-1, 'fail_to_delete_have_children');
|
||||
}
|
||||
elseif(!$deleteAdminComment)
|
||||
{
|
||||
return new Object(-1, 'msg_admin_c_comment_no_delete');
|
||||
return new BaseObject(-1, 'msg_admin_c_comment_no_delete');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1036,7 +1042,7 @@ class commentController extends comment
|
|||
|
||||
if($member_info->is_admin == 'Y' && $logged_info->is_admin != 'Y')
|
||||
{
|
||||
return new Object(-1, 'msg_admin_comment_no_delete');
|
||||
return new BaseObject(-1, 'msg_admin_comment_no_delete');
|
||||
}
|
||||
// begin transaction
|
||||
$oDB = DB::getInstance();
|
||||
|
|
@ -1126,7 +1132,7 @@ class commentController extends comment
|
|||
$member_info = $oMemberModel->getMemberInfoByMemberSrl($oComment->get('member_srl'));
|
||||
if($member_info->is_admin == 'Y' && $logged_info->is_admin != 'Y')
|
||||
{
|
||||
return new Object(-1, 'msg_admin_comment_no_move_to_trash');
|
||||
return new BaseObject(-1, 'msg_admin_comment_no_move_to_trash');
|
||||
}
|
||||
|
||||
$trash_args->module_srl = $oComment->variables['module_srl'];
|
||||
|
|
@ -1134,7 +1140,7 @@ class commentController extends comment
|
|||
|
||||
if($trash_args->module_srl === 0)
|
||||
{
|
||||
return new Object(-1, 'msg_module_srl_not_exists');
|
||||
return new BaseObject(-1, 'msg_module_srl_not_exists');
|
||||
}
|
||||
$trash_args->document_srl = $obj->document_srl;
|
||||
$trash_args->comment_srl = $obj->comment_srl;
|
||||
|
|
@ -1226,7 +1232,7 @@ class commentController extends comment
|
|||
{
|
||||
$this->_deleteDeclaredComments($args);
|
||||
$this->_deleteVotedComments($args);
|
||||
return new Object(0, 'success');
|
||||
return new BaseObject(0, 'success');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1253,7 +1259,7 @@ class commentController extends comment
|
|||
|
||||
if(!$oDocument->isExists() || !$oDocument->isGranted())
|
||||
{
|
||||
return new Object(-1, 'msg_not_permitted');
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
}
|
||||
|
||||
// get a list of comments and then execute a trigger(way to reduce the processing cost for delete all)
|
||||
|
|
@ -1345,7 +1351,7 @@ class commentController extends comment
|
|||
// invalid vote if vote info exists in the session info.
|
||||
if($_SESSION['voted_comment'][$comment_srl])
|
||||
{
|
||||
return new Object(-1, $failed_voted);
|
||||
return new BaseObject(-1, $failed_voted);
|
||||
}
|
||||
|
||||
$oCommentModel = getModel('comment');
|
||||
|
|
@ -1355,7 +1361,7 @@ class commentController extends comment
|
|||
if($oComment->get('ipaddress') == $_SERVER['REMOTE_ADDR'])
|
||||
{
|
||||
$_SESSION['voted_comment'][$comment_srl] = false;
|
||||
return new Object(-1, $failed_voted);
|
||||
return new BaseObject(-1, $failed_voted);
|
||||
}
|
||||
|
||||
// if the comment author is a member
|
||||
|
|
@ -1369,7 +1375,7 @@ class commentController extends comment
|
|||
if($member_srl && $member_srl == abs($oComment->get('member_srl')))
|
||||
{
|
||||
$_SESSION['voted_comment'][$comment_srl] = false;
|
||||
return new Object(-1, $failed_voted);
|
||||
return new BaseObject(-1, $failed_voted);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1392,7 +1398,7 @@ class commentController extends comment
|
|||
if($output->data->count)
|
||||
{
|
||||
$_SESSION['voted_comment'][$comment_srl] = false;
|
||||
return new Object(-1, $failed_voted);
|
||||
return new BaseObject(-1, $failed_voted);
|
||||
}
|
||||
|
||||
// begin transaction
|
||||
|
|
@ -1431,7 +1437,7 @@ class commentController extends comment
|
|||
$oDB->commit();
|
||||
|
||||
// Return the result
|
||||
$output = new Object(0, $success_message);
|
||||
$output = new BaseObject(0, $success_message);
|
||||
if($point > 0)
|
||||
{
|
||||
$output->add('voted_count', $obj->after_point);
|
||||
|
|
@ -1455,7 +1461,7 @@ class commentController extends comment
|
|||
// Fail if session information already has a reported document
|
||||
if($_SESSION['declared_comment'][$comment_srl])
|
||||
{
|
||||
return new Object(-1, 'failed_declared');
|
||||
return new BaseObject(-1, 'failed_declared');
|
||||
}
|
||||
|
||||
// check if already reported
|
||||
|
|
@ -1490,7 +1496,7 @@ class commentController extends comment
|
|||
if($oComment->get('ipaddress') == $_SERVER['REMOTE_ADDR'])
|
||||
{
|
||||
$_SESSION['declared_comment'][$comment_srl] = TRUE;
|
||||
return new Object(-1, 'failed_declared');
|
||||
return new BaseObject(-1, 'failed_declared');
|
||||
}
|
||||
|
||||
// if the comment author is a member
|
||||
|
|
@ -1504,7 +1510,7 @@ class commentController extends comment
|
|||
if($member_srl && $member_srl == abs($oComment->get('member_srl')))
|
||||
{
|
||||
$_SESSION['declared_comment'][$comment_srl] = TRUE;
|
||||
return new Object(-1, 'failed_declared');
|
||||
return new BaseObject(-1, 'failed_declared');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1526,7 +1532,7 @@ class commentController extends comment
|
|||
if($log_output->data->count)
|
||||
{
|
||||
$_SESSION['declared_comment'][$comment_srl] = TRUE;
|
||||
return new Object(-1, 'failed_declared');
|
||||
return new BaseObject(-1, 'failed_declared');
|
||||
}
|
||||
|
||||
// begin transaction
|
||||
|
|
@ -1616,13 +1622,13 @@ class commentController extends comment
|
|||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($srl);
|
||||
if (!$module_info->module_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$module_grant = $oModuleModel->getGrant($module_info, $logged_info);
|
||||
if (!$module_grant->manager)
|
||||
{
|
||||
return new Object(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
$module_srl[] = $srl;
|
||||
|
|
@ -1675,7 +1681,7 @@ class commentController extends comment
|
|||
{
|
||||
$oModuleController = getController('module');
|
||||
$oModuleController->insertModulePartConfig('comment', $srl, $comment_config);
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1686,7 +1692,7 @@ class commentController extends comment
|
|||
{
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new Object(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
$commentSrls = Context::get('comment_srls');
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
* @package /modules/comment
|
||||
* @version 0.1
|
||||
*/
|
||||
class commentItem extends Object
|
||||
class commentItem extends BaseObject
|
||||
{
|
||||
|
||||
/**
|
||||
|
|
@ -77,7 +77,7 @@ class commentItem extends Object
|
|||
$this->adds($attribute);
|
||||
|
||||
// define vars on the object for backward compatibility of skins
|
||||
if(count($attribute))
|
||||
if(countobj($attribute))
|
||||
{
|
||||
foreach($attribute as $key => $val)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -512,6 +512,13 @@ class commentModel extends comment
|
|||
$args->status = 1;
|
||||
}
|
||||
|
||||
// call trigger (before)
|
||||
$trigger_output = ModuleHandler::triggerCall('comment.getCommentList', 'before', $args);
|
||||
if($trigger_output instanceof BaseObject && !$trigger_output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
$output = executeQueryArray('comment.getCommentPageList', $args);
|
||||
|
||||
// return if an error occurs in the query results
|
||||
|
|
@ -531,6 +538,13 @@ class commentModel extends comment
|
|||
}
|
||||
}
|
||||
|
||||
// call trigger (after)
|
||||
$trigger_output = ModuleHandler::triggerCall('comment.getCommentList', 'after', $output);
|
||||
if($trigger_output instanceof BaseObject && !$trigger_output->toBool())
|
||||
{
|
||||
return $trigger_output;
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -962,7 +976,7 @@ class commentModel extends comment
|
|||
$comment_srl = Context::get('comment_srl');
|
||||
if(!$comment_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$point = Context::get('point');
|
||||
|
|
@ -976,7 +990,7 @@ class commentModel extends comment
|
|||
$module_srl = $oComment->get('module_srl');
|
||||
if(!$module_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
|
|
@ -988,7 +1002,7 @@ class commentModel extends comment
|
|||
{
|
||||
if($comment_config->use_vote_down != 'S')
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$args->below_point = 0;
|
||||
|
|
@ -997,7 +1011,7 @@ class commentModel extends comment
|
|||
{
|
||||
if($comment_config->use_vote_up != 'S')
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$args->more_point = 0;
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class commentView extends comment
|
|||
$current_module_srl = $current_module_info->module_srl;
|
||||
if(!$current_module_srl)
|
||||
{
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -57,7 +57,7 @@ class commentView extends comment
|
|||
$tpl = $oTemplate->compile($this->module_path . 'tpl', 'comment_module_config');
|
||||
$obj .= $tpl;
|
||||
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -82,12 +82,12 @@ class commentView extends comment
|
|||
$oComment = $oCommentModel->getComment($comment_srl);
|
||||
if(!$oComment->isExists())
|
||||
{
|
||||
return new Object(-1,'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
// Check permissions
|
||||
if(!$oComment->isAccessible())
|
||||
{
|
||||
return new Object(-1,'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
// Browser title settings
|
||||
|
|
|
|||
|
|
@ -30,8 +30,6 @@ class communication extends ModuleObject
|
|||
|
||||
// Create a temporary file storage for one new private message notification
|
||||
FileHandler::makeDir('./files/member_extra_info/new_message_flags');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -96,8 +94,6 @@ class communication extends ModuleObject
|
|||
{
|
||||
FileHandler::makeDir('./files/member_extra_info/new_message_flags');
|
||||
}
|
||||
|
||||
return new Object(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class communicationController extends communication
|
|||
{
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new Object(-1, 'msg_not_logged');
|
||||
return $this->setError('msg_not_logged');
|
||||
}
|
||||
|
||||
$args = new stdClass();
|
||||
|
|
@ -54,7 +54,7 @@ class communicationController extends communication
|
|||
// Check login information
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new Object(-1, 'msg_not_logged');
|
||||
return $this->setError('msg_not_logged');
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
|
@ -63,19 +63,19 @@ class communicationController extends communication
|
|||
$receiver_srl = Context::get('receiver_srl');
|
||||
if(!$receiver_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_not_exists_member');
|
||||
return $this->setError('msg_not_exists_member');
|
||||
}
|
||||
|
||||
$title = trim(Context::get('title'));
|
||||
if(!$title)
|
||||
{
|
||||
return new Object(-1, 'msg_title_is_null');
|
||||
return $this->setError('msg_title_is_null');
|
||||
}
|
||||
|
||||
$content = trim(Context::get('content'));
|
||||
if(!$content)
|
||||
{
|
||||
return new Object(-1, 'msg_content_is_null');
|
||||
return $this->setError('msg_content_is_null');
|
||||
}
|
||||
|
||||
$send_mail = Context::get('send_mail');
|
||||
|
|
@ -91,13 +91,13 @@ class communicationController extends communication
|
|||
|
||||
if(!$oCommunicationModel->checkGrant($config->grant_send))
|
||||
{
|
||||
return new Object(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
$receiver_member_info = $oMemberModel->getMemberInfoByMemberSrl($receiver_srl);
|
||||
if($receiver_member_info->member_srl != $receiver_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_not_exists_member');
|
||||
return $this->setError('msg_not_exists_member');
|
||||
}
|
||||
|
||||
// check whether to allow to receive the message(pass if a top-administrator)
|
||||
|
|
@ -107,12 +107,12 @@ class communicationController extends communication
|
|||
{
|
||||
if(!$oCommunicationModel->isFriend($receiver_member_info->member_srl))
|
||||
{
|
||||
return new object(-1, 'msg_allow_message_to_friend');
|
||||
return $this->setError('msg_allow_message_to_friend');
|
||||
}
|
||||
}
|
||||
else if($receiver_member_info->allow_message == 'N')
|
||||
{
|
||||
return new object(-1, 'msg_disallow_message');
|
||||
return $this->setError('msg_disallow_message');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -257,7 +257,7 @@ class communicationController extends communication
|
|||
// create a flag that message is sent (in file format)
|
||||
$this->updateFlagFile($receiver_srl);
|
||||
|
||||
return new Object(0, 'success_sended');
|
||||
return new BaseObject(0, 'success_sended');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -269,7 +269,7 @@ class communicationController extends communication
|
|||
// Check login information
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new Object(-1, 'msg_not_logged');
|
||||
return $this->setError('msg_not_logged');
|
||||
}
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
|
|
@ -277,7 +277,7 @@ class communicationController extends communication
|
|||
$message_srl = Context::get('message_srl');
|
||||
if(!$message_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// get the message
|
||||
|
|
@ -285,7 +285,7 @@ class communicationController extends communication
|
|||
$message = $oCommunicationModel->getSelectedMessage($message_srl);
|
||||
if(!$message || $message->message_type != 'R')
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$args = new stdClass();
|
||||
|
|
@ -309,7 +309,7 @@ class communicationController extends communication
|
|||
// Check login information
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new Object(-1, 'msg_not_logged');
|
||||
return $this->setError('msg_not_logged');
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
|
@ -319,7 +319,7 @@ class communicationController extends communication
|
|||
$message_srl = Context::get('message_srl');
|
||||
if(!$message_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// Get the message
|
||||
|
|
@ -327,7 +327,7 @@ class communicationController extends communication
|
|||
$message = $oCommunicationModel->getSelectedMessage($message_srl);
|
||||
if(!$message)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// Check the grant
|
||||
|
|
@ -336,14 +336,14 @@ class communicationController extends communication
|
|||
case 'S':
|
||||
if($message->sender_srl != $member_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
break;
|
||||
|
||||
case 'R':
|
||||
if($message->receiver_srl != $member_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -369,7 +369,7 @@ class communicationController extends communication
|
|||
// Check login information
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new Object(-1, 'msg_not_logged');
|
||||
return $this->setError('msg_not_logged');
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
|
@ -378,7 +378,7 @@ class communicationController extends communication
|
|||
// check variables
|
||||
if(!Context::get('message_srl_list'))
|
||||
{
|
||||
return new Object(-1, 'msg_cart_is_null');
|
||||
return $this->setError('msg_cart_is_null');
|
||||
}
|
||||
|
||||
$message_srl_list = Context::get('message_srl_list');
|
||||
|
|
@ -389,13 +389,13 @@ class communicationController extends communication
|
|||
|
||||
if(!count($message_srl_list))
|
||||
{
|
||||
return new Object(-1, 'msg_cart_is_null');
|
||||
return $this->setError('msg_cart_is_null');
|
||||
}
|
||||
|
||||
$message_type = Context::get('message_type');
|
||||
if(!$message_type || !in_array($message_type, array('R', 'S', 'T')))
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$message_count = count($message_srl_list);
|
||||
|
|
@ -412,7 +412,7 @@ class communicationController extends communication
|
|||
}
|
||||
if(!count($target))
|
||||
{
|
||||
return new Object(-1, 'msg_cart_is_null');
|
||||
return $this->setError('msg_cart_is_null');
|
||||
}
|
||||
|
||||
// Delete
|
||||
|
|
@ -450,7 +450,7 @@ class communicationController extends communication
|
|||
// Check login information
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new Object(-1, 'msg_not_logged');
|
||||
return $this->setError('msg_not_logged');
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
|
@ -458,11 +458,11 @@ class communicationController extends communication
|
|||
$target_srl = (int) trim(Context::get('target_srl'));
|
||||
if(!$target_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
if($target_srl == $logged_info->member_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_no_self_friend');
|
||||
return $this->setError('msg_no_self_friend');
|
||||
}
|
||||
|
||||
// Check duplicate friend
|
||||
|
|
@ -472,7 +472,7 @@ class communicationController extends communication
|
|||
$output = executeQuery('communication.isAddedFriend', $args);
|
||||
if($output->data->count)
|
||||
{
|
||||
return new Object(-1, 'msg_already_friend');
|
||||
return $this->setError('msg_already_friend');
|
||||
}
|
||||
|
||||
// Variable
|
||||
|
|
@ -512,7 +512,7 @@ class communicationController extends communication
|
|||
// Check login information
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new Object(-1, 'msg_not_logged');
|
||||
return $this->setError('msg_not_logged');
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
|
@ -521,7 +521,7 @@ class communicationController extends communication
|
|||
$friend_srl_list = Context::get('friend_srl_list');
|
||||
if(!$friend_srl_list)
|
||||
{
|
||||
return new Object(-1, 'msg_cart_is_null');
|
||||
return $this->setError('msg_cart_is_null');
|
||||
}
|
||||
|
||||
if(!is_array($friend_srl_list))
|
||||
|
|
@ -531,7 +531,7 @@ class communicationController extends communication
|
|||
|
||||
if(!count($friend_srl_list))
|
||||
{
|
||||
return new Object(-1, 'msg_cart_is_null');
|
||||
return $this->setError('msg_cart_is_null');
|
||||
}
|
||||
|
||||
$friend_count = count($friend_srl_list);
|
||||
|
|
@ -549,7 +549,7 @@ class communicationController extends communication
|
|||
|
||||
if(!count($target))
|
||||
{
|
||||
return new Object(-1, 'msg_cart_is_null');
|
||||
return $this->setError('msg_cart_is_null');
|
||||
}
|
||||
|
||||
// Variables
|
||||
|
|
@ -579,7 +579,7 @@ class communicationController extends communication
|
|||
// Check login information
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new Object(-1, 'msg_not_logged');
|
||||
return $this->setError('msg_not_logged');
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
|
@ -595,7 +595,7 @@ class communicationController extends communication
|
|||
|
||||
if(!count($friend_srl_list))
|
||||
{
|
||||
return new Object(-1, 'msg_cart_is_null');
|
||||
return $this->setError('msg_cart_is_null');
|
||||
}
|
||||
|
||||
$friend_count = count($friend_srl_list);
|
||||
|
|
@ -614,7 +614,7 @@ class communicationController extends communication
|
|||
|
||||
if(!count($target))
|
||||
{
|
||||
return new Object(-1, 'msg_cart_is_null');
|
||||
return $this->setError('msg_cart_is_null');
|
||||
}
|
||||
|
||||
// Delete
|
||||
|
|
@ -642,7 +642,7 @@ class communicationController extends communication
|
|||
// Check login information
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new Object(-1, 'msg_not_logged');
|
||||
return $this->setError('msg_not_logged');
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
|
@ -656,7 +656,7 @@ class communicationController extends communication
|
|||
|
||||
if(!$args->title)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// modify if friend_group_srl exists.
|
||||
|
|
@ -718,7 +718,7 @@ class communicationController extends communication
|
|||
// Check login information
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new Object(-1, 'msg_not_logged');
|
||||
return $this->setError('msg_not_logged');
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
|
@ -732,7 +732,7 @@ class communicationController extends communication
|
|||
|
||||
if(!$args->title)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$output = executeQuery('communication.renameFriendGroup', $args);
|
||||
|
|
@ -753,7 +753,7 @@ class communicationController extends communication
|
|||
// Check login information
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new Object(-1, 'msg_not_logged');
|
||||
return $this->setError('msg_not_logged');
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
|
@ -831,7 +831,7 @@ class communicationController extends communication
|
|||
{
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new Object();
|
||||
return;
|
||||
}
|
||||
|
||||
$oCommunicationModel = getModel('communication');
|
||||
|
|
@ -839,11 +839,11 @@ class communicationController extends communication
|
|||
|
||||
if($config->enable_message == 'N' && $config->enable_friend == 'N')
|
||||
{
|
||||
return new Object();
|
||||
return;
|
||||
}
|
||||
if(!$oCommunicationModel->checkGrant($config->grant_send))
|
||||
{
|
||||
return new Object();
|
||||
return;
|
||||
}
|
||||
|
||||
$mid = Context::get('cur_mid');
|
||||
|
|
@ -874,7 +874,7 @@ class communicationController extends communication
|
|||
$target_member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
|
||||
if(!$target_member_info->member_srl)
|
||||
{
|
||||
return new Object();
|
||||
return;
|
||||
}
|
||||
|
||||
// Add a menu for sending message
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) NAVER <http://www.navercorp.com> */
|
||||
|
||||
require_once(_XE_PATH_ . 'modules/communication/communication.view.php');
|
||||
|
||||
/**
|
||||
* @class communicationMobile
|
||||
* @author NAVER (developers@xpressengine.com)
|
||||
|
|
@ -32,100 +30,6 @@ class communicationMobile extends communicationView
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display message box
|
||||
* @return Object (void : success, Object : fail)
|
||||
*/
|
||||
function dispCommunicationMessages()
|
||||
{
|
||||
// Error appears if not logged-in
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new Object(-1,'msg_not_logged');
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
if(!array_key_exists('dispCommunicationMessages', $logged_info->menu_list))
|
||||
{
|
||||
return new Object(-1,'msg_invalid_request');
|
||||
}
|
||||
|
||||
// Set the variables
|
||||
$message_srl = Context::get('message_srl');
|
||||
$message_type = Context::get('message_type');
|
||||
if(!in_array($message_type, array('R', 'S', 'T', 'N')))
|
||||
{
|
||||
$message_type = 'R';
|
||||
Context::set('message_type', $message_type);
|
||||
}
|
||||
$oCommunicationModel = getModel('communication');
|
||||
|
||||
// extract contents if message_srl exists
|
||||
if($message_srl)
|
||||
{
|
||||
$templateFile = 'read_message';
|
||||
$columnList = array('message_srl', 'sender_srl', 'receiver_srl', 'message_type', 'title', 'content', 'readed', 'regdate');
|
||||
$message = $oCommunicationModel->getSelectedMessage($message_srl, $columnList);
|
||||
|
||||
switch($message->message_type)
|
||||
{
|
||||
case 'R':
|
||||
if($message->receiver_srl != $logged_info->member_srl)
|
||||
{
|
||||
return $this->stop('msg_invalid_request');
|
||||
}
|
||||
break;
|
||||
|
||||
case 'S':
|
||||
if($message->sender_srl != $logged_info->member_srl)
|
||||
{
|
||||
return $this->stop('msg_invalid_request');
|
||||
}
|
||||
break;
|
||||
|
||||
case 'T':
|
||||
if($message->receiver_srl != $logged_info->member_srl && $message->sender_srl != $logged_info->member_srl)
|
||||
{
|
||||
return $this->stop('msg_invalid_request');
|
||||
}
|
||||
break;
|
||||
|
||||
case 'N':
|
||||
if($message->receiver_srl != $logged_info->member_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if($message->message_srl == $message_srl && ($message->receiver_srl == $logged_info->member_srl || $message->sender_srl == $logged_info->member_srl))
|
||||
{
|
||||
stripEmbedTagForAdmin($message->content, $message->sender_srl);
|
||||
Context::set('message', $message);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$templateFile = 'messages';
|
||||
}
|
||||
|
||||
// Extract a list
|
||||
$columnList = array('message_srl', 'readed', 'title', 'member.member_srl', 'member.nick_name', 'message.regdate', 'readed_date');
|
||||
$output = $oCommunicationModel->getMessages($message_type, $columnList);
|
||||
|
||||
// set a template file
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
Context::set('page', $output->page);
|
||||
Context::set('message_list', $output->data);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
|
||||
$oSecurity = new Security();
|
||||
$oSecurity->encodeHTML('message_list..nick_name');
|
||||
|
||||
$this->setTemplateFile($templateFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display list of message box
|
||||
* @return void
|
||||
|
|
@ -134,64 +38,6 @@ class communicationMobile extends communicationView
|
|||
{
|
||||
$this->setTemplateFile('message_box');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display message sending
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
*/
|
||||
function dispCommunicationSendMessage()
|
||||
{
|
||||
$oCommunicationModel = getModel('communication');
|
||||
$oMemberModel = getModel('member');
|
||||
|
||||
// Error appears if not logged-in
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return $this->stop('msg_not_logged');
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
// get receipient's information
|
||||
// check inalid request
|
||||
$receiver_srl = Context::get('receiver_srl');
|
||||
if(!$receiver_srl)
|
||||
{
|
||||
return $this->stop('msg_invalid_request');
|
||||
}
|
||||
|
||||
// check receiver and sender are same
|
||||
if($logged_info->member_srl == $receiver_srl)
|
||||
{
|
||||
return $this->stop('msg_cannot_send_to_yourself');
|
||||
}
|
||||
|
||||
// get message_srl of the original message if it is a reply
|
||||
$message_srl = Context::get('message_srl');
|
||||
if($message_srl)
|
||||
{
|
||||
$source_message = $oCommunicationModel->getSelectedMessage($message_srl);
|
||||
if($source_message->message_srl == $message_srl && $source_message->sender_srl == $receiver_srl)
|
||||
{
|
||||
if(strncasecmp('[re]', $source_message->title, 4) !== 0)
|
||||
{
|
||||
$source_message->title = '[re] ' . $source_message->title;
|
||||
}
|
||||
$source_message->content = "\r\n<br />\r\n<br /><div style=\"padding-left:5px; border-left:5px solid #DDDDDD;\">" . trim($source_message->content) . "</div>";
|
||||
Context::set('source_message', $source_message);
|
||||
}
|
||||
}
|
||||
|
||||
$receiver_info = $oMemberModel->getMemberInfoByMemberSrl($receiver_srl);
|
||||
if(!$receiver_info)
|
||||
{
|
||||
return $this->stop('msg_invalid_request');
|
||||
}
|
||||
|
||||
Context::set('receiver_info', $receiver_info);
|
||||
$this->setTemplateFile('send_message');
|
||||
}
|
||||
|
||||
}
|
||||
/* End of file communication.mobile.php */
|
||||
/* Location: ./modules/comment/communication.mobile.php */
|
||||
|
|
|
|||
|
|
@ -52,13 +52,13 @@ class communicationView extends communication
|
|||
{
|
||||
if($this->config->enable_message == 'N')
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// Error appears if not logged-in
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new Object(-1, 'msg_not_logged');
|
||||
return $this->setError('msg_not_logged');
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
|
@ -73,9 +73,9 @@ class communicationView extends communication
|
|||
Context::set('message_type', $message_type);
|
||||
}
|
||||
|
||||
$oCommunicationModel = getModel('communication');
|
||||
|
||||
// extract contents if message_srl exists
|
||||
$oCommunicationModel = getModel('communication');
|
||||
$template_filename = 'messages';
|
||||
if($message_srl)
|
||||
{
|
||||
$columnList = array('message_srl', 'sender_srl', 'receiver_srl', 'message_type', 'title', 'content', 'readed', 'regdate');
|
||||
|
|
@ -86,28 +86,28 @@ class communicationView extends communication
|
|||
case 'R':
|
||||
if($message->receiver_srl != $logged_info->member_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
break;
|
||||
|
||||
case 'S':
|
||||
if($message->sender_srl != $logged_info->member_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
break;
|
||||
|
||||
case 'T':
|
||||
if($message->receiver_srl != $logged_info->member_srl && $message->sender_srl != $logged_info->member_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
break;
|
||||
|
||||
case 'N':
|
||||
if($message->receiver_srl != $logged_info->member_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -116,6 +116,10 @@ class communicationView extends communication
|
|||
{
|
||||
stripEmbedTagForAdmin($message->content, $message->sender_srl);
|
||||
Context::set('message', $message);
|
||||
if(Context::get('m'))
|
||||
{
|
||||
$template_filename = 'read_message';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -133,7 +137,7 @@ class communicationView extends communication
|
|||
$oSecurity = new Security();
|
||||
$oSecurity->encodeHTML('message_list..nick_name');
|
||||
|
||||
$this->setTemplateFile('messages');
|
||||
$this->setTemplateFile($template_filename);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -178,8 +182,11 @@ class communicationView extends communication
|
|||
*/
|
||||
function dispCommunicationSendMessage()
|
||||
{
|
||||
$this->setLayoutPath('./common/tpl/');
|
||||
$this->setLayoutFile("popup_layout");
|
||||
if(!Context::get('m'))
|
||||
{
|
||||
$this->setLayoutPath('./common/tpl/');
|
||||
$this->setLayoutFile("popup_layout");
|
||||
}
|
||||
|
||||
if($this->config->enable_message == 'N')
|
||||
{
|
||||
|
|
@ -253,6 +260,7 @@ class communicationView extends communication
|
|||
$option->height = 300;
|
||||
$option->skin = $this->config->editor_skin;
|
||||
$option->colorset = $this->config->editor_colorset;
|
||||
$option->editor_focus = Context::get('source_message') ? 'Y' : 'N';
|
||||
$editor = $oEditorModel->getEditor($logged_info->member_srl, $option);
|
||||
Context::set('editor', $editor);
|
||||
|
||||
|
|
|
|||
|
|
@ -43,3 +43,7 @@ $lang->cmd_manage_base = '기본 정보';
|
|||
$lang->alert_new_message_arrived = '%d개의 새로운 메시지가 도착하였습니다. 확인하시겠습니까?';
|
||||
$lang->enable_communication_friend = '친구기능 사용';
|
||||
$lang->enable_communication_message = '쪽지기능 사용';
|
||||
$lang->warning = '알려드립니다!';
|
||||
$lang->msg_allow_message_friend = '현재 회원님은 친구에게만 수신 가능한 상태입니다.';
|
||||
$lang->msg_allow_meesage_Block = '현재 회원님은 수신거부 상태입니다.';
|
||||
$lang->msg_allow_message_please = '전송하는 쪽지에 대한 답변을 받기 위해서는 모두에게 전송을 허용해야합니다.';
|
||||
|
|
|
|||
|
|
@ -126,3 +126,22 @@ input[type=radio]{width:13px;height:13px;margin:0;padding:0}
|
|||
.sh select{width:80px;font-size:14px;margin:0 0 5px 0}
|
||||
.sh input[type=text]{width:160px;margin:0;font-size:14px;padding:5px}
|
||||
.sh .shbn{width:28px;height:28px;border:1px solid #666;background:#777 url(../img/mx.png) no-repeat 5px -60px;box-shadow:0 0 1px #fff inset;-moz-box-shadow:0 0 1px #fff inset;-webkit-box-shadow:0 0 1px #fff inset;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;cursor:pointer}
|
||||
|
||||
/**
|
||||
* warning label from modules\admin\tpl\css\admin.bootstrap.css
|
||||
*/
|
||||
.warning_label{
|
||||
display:inline-block;
|
||||
margin-top:10px;
|
||||
padding:2px 4px;
|
||||
font-size:11.844px;
|
||||
font-weight:bold;
|
||||
line-height:14px;
|
||||
color:#ffffff;
|
||||
text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);
|
||||
-webkit-border-radius:3px;
|
||||
-moz-border-radius:3px;
|
||||
border-radius:3px;
|
||||
box-sizing:border-box;
|
||||
}
|
||||
.warning_label-important{background-color:#b94a48}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,16 @@
|
|||
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/communication/m.skins/default/send_message/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||
</div>
|
||||
<div class="warning_label warning_label-important" cond="$logged_info->allow_message !== 'Y'">
|
||||
{$lang->warning}
|
||||
<br>
|
||||
<!--@if($logged_info->allow_message == 'F')-->
|
||||
{$lang->msg_allow_message_friend}
|
||||
<!--@elseif($logged_info->allow_message == 'N')-->
|
||||
{$lang->msg_allow_meesage_Block}
|
||||
<!--@end-->
|
||||
<br>{$lang->msg_allow_message_please}
|
||||
</div>
|
||||
<form ruleset="sendMessage" action="./" method="post" class="ff" id="fo_comm">
|
||||
<input type="hidden" name="module" value="communication" />
|
||||
<input type="hidden" name="is_popup" value="Y" />
|
||||
|
|
|
|||
|
|
@ -465,3 +465,21 @@ script, style
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* warning label from modules\admin\tpl\css\admin.bootstrap.css
|
||||
*/
|
||||
.warning_label{
|
||||
display:inline-block;
|
||||
margin:5px 15px !important;
|
||||
padding:2px 4px;
|
||||
font-size:11.844px;
|
||||
font-weight:bold;
|
||||
line-height:14px;
|
||||
color:#ffffff;
|
||||
text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);
|
||||
-webkit-border-radius:3px;
|
||||
-moz-border-radius:3px;
|
||||
border-radius:3px;
|
||||
box-sizing:border-box;
|
||||
}
|
||||
.warning_label-important{background-color:#b94a48}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,16 @@
|
|||
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/communication/skins/rx_prn/send_message/1'" class="rx_prn-notice {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||
</div>
|
||||
<div class="warning_label warning_label-important" cond="$logged_info->allow_message !== 'Y'">
|
||||
{$lang->warning}
|
||||
<br>
|
||||
<!--@if($logged_info->allow_message == 'F')-->
|
||||
{$lang->msg_allow_message_friend}
|
||||
<!--@elseif($logged_info->allow_message == 'N')-->
|
||||
{$lang->msg_allow_meesage_Block}
|
||||
<!--@end-->
|
||||
<br>{$lang->msg_allow_message_please}
|
||||
</div>
|
||||
<form ruleset="sendMessage" action="./" method="post">
|
||||
<input type="hidden" name="module" value="communication" />
|
||||
<input type="hidden" name="act" value="procCommunicationSendMessage" />
|
||||
|
|
|
|||
|
|
@ -5,6 +5,16 @@
|
|||
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/communication/skins/default/send_message/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||
</div>
|
||||
<div class="x_label x_label-important" cond="$logged_info->allow_message !== 'Y'">
|
||||
{$lang->warning}
|
||||
<br>
|
||||
<!--@if($logged_info->allow_message == 'F')-->
|
||||
{$lang->msg_allow_message_friend}
|
||||
<!--@elseif($logged_info->allow_message == 'N')-->
|
||||
{$lang->msg_allow_meesage_Block}
|
||||
<!--@end-->
|
||||
<br>{$lang->msg_allow_message_please}
|
||||
</div>
|
||||
<form ruleset="sendMessage" action="./" method="post">
|
||||
<input type="hidden" name="module" value="communication" />
|
||||
<input type="hidden" name="act" value="procCommunicationSendMessage" />
|
||||
|
|
|
|||
|
|
@ -18,6 +18,16 @@
|
|||
<input type="text" name="title" id="message_title" value="{$source_message->title}" />
|
||||
<label for="message_send_mail"><input type="checkbox" value="Y" name="send_mail" id="message_send_mail" /> {$lang->cmd_send_mail}</label>
|
||||
<div class="rx_member-notice info">{$lang->msg_send_mail_privacy}</div>
|
||||
<div class="rx_member-notice info" cond="$logged_info->allow_message !== 'Y'">
|
||||
{$lang->warning}
|
||||
<br>
|
||||
<!--@if($logged_info->allow_message == 'F')-->
|
||||
{$lang->msg_allow_message_friend}
|
||||
<!--@elseif($logged_info->allow_message == 'N')-->
|
||||
{$lang->msg_allow_meesage_Block}
|
||||
<!--@end-->
|
||||
<br>{$lang->msg_allow_message_please}
|
||||
</div>
|
||||
</div>
|
||||
{$editor}
|
||||
<div class="control-group">
|
||||
|
|
@ -25,4 +35,4 @@
|
|||
</div>
|
||||
</form>
|
||||
</section>
|
||||
<include target="./common_footer.html" />
|
||||
<include target="./common_footer.html" />
|
||||
|
|
|
|||
|
|
@ -22,8 +22,6 @@ class counter extends ModuleObject
|
|||
|
||||
// add a row for today's status
|
||||
//$oCounterController->insertTodayStatus();
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -67,8 +65,6 @@ class counter extends ModuleObject
|
|||
{
|
||||
$oDB->addIndex('counter_log', 'idx_site_counter_log', array('site_srl', 'ipaddress'), FALSE);
|
||||
}
|
||||
|
||||
return new Object(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ class documentAdminController extends document
|
|||
{
|
||||
Rhymix\Framework\Cache::delete('document_item:'. getNumberingPath($document_srl) . $document_srl);
|
||||
}
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -426,7 +426,7 @@ class documentAdminController extends document
|
|||
|
||||
$oDB->commit();
|
||||
|
||||
$output = new Object();
|
||||
$output = new BaseObject();
|
||||
$output->add('copied_srls', $copied_srls);
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -471,13 +471,21 @@ class documentAdminController extends document
|
|||
$oDocumentModel = getModel('document');
|
||||
$config = $oDocumentModel->getDocumentConfig();
|
||||
$config->view_count_option = Context::get('view_count_option');
|
||||
$config->icons = Context::get('icons');
|
||||
$config->micons = Context::get('micons');
|
||||
|
||||
// Insert by creating the module Controller object
|
||||
$oModuleController = getController('module');
|
||||
$output = $oModuleController->insertModuleConfig('document',$config);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispDocumentAdminConfig');
|
||||
return $this->setRedirectUrl($returnUrl, $output);
|
||||
$this->setRedirectUrl($returnUrl, $output);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -503,10 +511,11 @@ class documentAdminController extends document
|
|||
*/
|
||||
function procDocumentAdminDeleteAllThumbnail()
|
||||
{
|
||||
// delete all of thumbnail_ *. jpg files from files/attaches/images/ directory (prior versions to 1.0.4)
|
||||
$this->deleteThumbnailFile('./files/attach/images');
|
||||
// delete a directory itself, files/thumbnails (thumbnail policies have changed since version 1.0.5)
|
||||
FileHandler::removeFilesInDir('./files/thumbnails');
|
||||
$temp_cache_dir = './files/thumbnails_' . $_SERVER['REQUEST_TIME'];
|
||||
FileHandler::rename('./files/thumbnails', $temp_cache_dir);
|
||||
FileHandler::makeDir('./files/thumbnails');
|
||||
|
||||
FileHandler::removeDir($temp_cache_dir);
|
||||
|
||||
$this->setMessage('success_deleted');
|
||||
}
|
||||
|
|
@ -548,7 +557,7 @@ class documentAdminController extends document
|
|||
$eid = Context::get('eid');
|
||||
$obj = new stdClass();
|
||||
|
||||
if(!$module_srl || !$name || !$eid) return new Object(-1,'msg_invalid_request');
|
||||
if(!$module_srl || !$name || !$eid) return $this->setError('msg_invalid_request');
|
||||
// set the max value if idx is not specified
|
||||
if(!$var_idx)
|
||||
{
|
||||
|
|
@ -564,7 +573,7 @@ class documentAdminController extends document
|
|||
$output = executeQuery('document.isExistsExtraKey', $obj);
|
||||
if(!$output->toBool() || $output->data->count)
|
||||
{
|
||||
return new Object(-1, 'msg_extra_name_exists');
|
||||
return $this->setError('msg_extra_name_exists');
|
||||
}
|
||||
|
||||
// insert or update
|
||||
|
|
@ -586,7 +595,7 @@ class documentAdminController extends document
|
|||
{
|
||||
$module_srl = Context::get('module_srl');
|
||||
$var_idx = Context::get('var_idx');
|
||||
if(!$module_srl || !$var_idx) return new Object(-1,'msg_invalid_request');
|
||||
if(!$module_srl || !$var_idx) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oDocumentController = getController('document');
|
||||
$output = $oDocumentController->deleteDocumentExtraKeys($module_srl, $var_idx);
|
||||
|
|
@ -605,26 +614,26 @@ class documentAdminController extends document
|
|||
$module_srl = Context::get('module_srl');
|
||||
$var_idx = Context::get('var_idx');
|
||||
|
||||
if(!$type || !$module_srl || !$var_idx) return new Object(-1,'msg_invalid_request');
|
||||
if(!$type || !$module_srl || !$var_idx) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
if(!$module_info->module_srl) return new Object(-1,'msg_invalid_request');
|
||||
if(!$module_info->module_srl) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oDocumentModel = getModel('document');
|
||||
$extra_keys = $oDocumentModel->getExtraKeys($module_srl);
|
||||
if(!$extra_keys[$var_idx]) return new Object(-1,'msg_invalid_request');
|
||||
if(!$extra_keys[$var_idx]) return $this->setError('msg_invalid_request');
|
||||
|
||||
if($type == 'up') $new_idx = $var_idx-1;
|
||||
else $new_idx = $var_idx+1;
|
||||
if($new_idx<1) return new Object(-1,'msg_invalid_request');
|
||||
if($new_idx<1) return $this->setError('msg_invalid_request');
|
||||
|
||||
$args = new stdClass();
|
||||
$args->module_srl = $module_srl;
|
||||
$args->var_idx = $new_idx;
|
||||
$output = executeQuery('document.getDocumentExtraKeys', $args);
|
||||
if (!$output->toBool()) return $output;
|
||||
if (!$output->data) return new Object(-1, 'msg_invalid_request');
|
||||
if (!$output->data) return $this->setError('msg_invalid_request');
|
||||
unset($args);
|
||||
|
||||
// update immediately if there is no idx to change
|
||||
|
|
@ -728,7 +737,7 @@ class documentAdminController extends document
|
|||
$member_info = $oMemberModel->getMemberInfoByMemberSrl($oDocument->get('member_srl'));
|
||||
if($member_info->is_admin == 'Y' && $logged_info->is_admin != 'Y')
|
||||
{
|
||||
return new Object(-1, 'msg_admin_document_no_move_to_trash');
|
||||
return $this->setError('msg_admin_document_no_move_to_trash');
|
||||
}
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
|
|
@ -873,7 +882,7 @@ class documentAdminController extends document
|
|||
|
||||
//DB restore
|
||||
$output = $oDocumentController->insertDocument($originObject, false, true, false);
|
||||
if(!$output->toBool()) return new Object(-1, $output->getMessage());
|
||||
if(!$output->toBool()) return $this->setError($output->getMessage());
|
||||
|
||||
//FILE restore
|
||||
$oDocument = $oDocumentModel->getDocument($originObject->document_srl);
|
||||
|
|
@ -891,7 +900,7 @@ class documentAdminController extends document
|
|||
|
||||
// commit
|
||||
$oDB->commit();
|
||||
return new Object(0, 'success');
|
||||
return new BaseObject(0, 'success');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -148,6 +148,13 @@ class documentAdminView extends document
|
|||
$config = $oDocumentModel->getDocumentConfig();
|
||||
Context::set('config',$config);
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
$pcIconSkinList = $oModuleModel->getSkins($this->module_path . 'tpl', 'icons');
|
||||
$mobileIconSkinList = $oModuleModel->getSkins($this->module_path . 'tpl', 'micons');
|
||||
|
||||
Context::set('pcIconSkinList', $pcIconSkinList);
|
||||
Context::set('mobileIconSkinList', $mobileIconSkinList);
|
||||
|
||||
// Set the template file
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('document_config');
|
||||
|
|
|
|||
|
|
@ -47,8 +47,6 @@ class document extends ModuleObject
|
|||
|
||||
// 2009. 01. 29 Added a trigger for additional setup
|
||||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -341,8 +339,6 @@ class document extends ModuleObject
|
|||
$oDB->addColumn('document_update_log', 'is_admin', 'varchar', 1);
|
||||
$oDB->addIndex('document_update_log', 'idx_is_admin', array('is_admin'));
|
||||
}
|
||||
|
||||
return new Object(0,'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -28,21 +28,21 @@ class documentController extends document
|
|||
{
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
}
|
||||
|
||||
$document_srl = Context::get('target_srl');
|
||||
if(!$document_srl) return new Object(-1, 'msg_invalid_request');
|
||||
if(!$document_srl) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oDocumentModel = getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl, false, false);
|
||||
$module_srl = $oDocument->get('module_srl');
|
||||
if(!$module_srl) return new Object(-1, 'msg_invalid_request');
|
||||
if(!$module_srl) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
$document_config = $oModuleModel->getModulePartConfig('document',$module_srl);
|
||||
if($document_config->use_vote_up=='N') return new Object(-1, 'msg_invalid_request');
|
||||
if($document_config->use_vote_up=='N') return $this->setError('msg_invalid_request');
|
||||
|
||||
$point = 1;
|
||||
$output = $this->updateVotedCount($document_srl, $point);
|
||||
|
|
@ -60,18 +60,18 @@ class documentController extends document
|
|||
{
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
}
|
||||
|
||||
$document_srl = Context::get('target_srl');
|
||||
if(!$document_srl) return new Object(-1, 'msg_invalid_request');
|
||||
if(!$document_srl) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oDocumentModel = getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl, false, false);
|
||||
if($oDocument->get('voted_count') <= 0)
|
||||
{
|
||||
return new Object(-1, 'msg_document_voted_cancel_not');
|
||||
return $this->setError('msg_document_voted_cancel_not');
|
||||
}
|
||||
$point = 1;
|
||||
$output = $this->updateVotedCountCancel($document_srl, $oDocument, $point);
|
||||
|
|
@ -80,7 +80,7 @@ class documentController extends document
|
|||
return $output;
|
||||
}
|
||||
|
||||
$output = new Object();
|
||||
$output = new BaseObject();
|
||||
$output->setMessage('success_voted_canceled');
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -114,21 +114,21 @@ class documentController extends document
|
|||
{
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
}
|
||||
|
||||
$document_srl = Context::get('target_srl');
|
||||
if(!$document_srl) return new Object(-1, 'msg_invalid_request');
|
||||
if(!$document_srl) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oDocumentModel = getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl, false, false);
|
||||
$module_srl = $oDocument->get('module_srl');
|
||||
if(!$module_srl) return new Object(-1, 'msg_invalid_request');
|
||||
if(!$module_srl) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
$document_config = $oModuleModel->getModulePartConfig('document',$module_srl);
|
||||
if($document_config->use_vote_down=='N') return new Object(-1, 'msg_invalid_request');
|
||||
if($document_config->use_vote_down=='N') return $this->setError('msg_invalid_request');
|
||||
|
||||
$point = -1;
|
||||
$output = $this->updateVotedCount($document_srl, $point);
|
||||
|
|
@ -146,18 +146,18 @@ class documentController extends document
|
|||
{
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
}
|
||||
|
||||
$document_srl = Context::get('target_srl');
|
||||
if(!$document_srl) return new Object(-1, 'msg_invalid_request');
|
||||
if(!$document_srl) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oDocumentModel = getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl, false, false);
|
||||
if($oDocument->get('blamed_count') >= 0)
|
||||
{
|
||||
return new Object(-1, 'msg_document_voted_cancel_not');
|
||||
return $this->setError('msg_document_voted_cancel_not');
|
||||
}
|
||||
$point = -1;
|
||||
$output = $this->updateVotedCountCancel($document_srl, $oDocument, $point);
|
||||
|
|
@ -166,7 +166,7 @@ class documentController extends document
|
|||
return $output;
|
||||
}
|
||||
|
||||
$output = new Object();
|
||||
$output = new BaseObject();
|
||||
$output->setMessage('success_blamed_canceled');
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -229,13 +229,13 @@ class documentController extends document
|
|||
{
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new Object(-1, 'msg_not_logged');
|
||||
return $this->setError('msg_not_logged');
|
||||
}
|
||||
|
||||
$document_srl = intval(Context::get('target_srl'));
|
||||
if(!$document_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// if an user select message from options, message would be the option.
|
||||
|
|
@ -302,7 +302,7 @@ class documentController extends document
|
|||
function triggerDeleteModuleDocuments(&$obj)
|
||||
{
|
||||
$module_srl = $obj->module_srl;
|
||||
if(!$module_srl) return new Object();
|
||||
if(!$module_srl) return;
|
||||
// Delete the document
|
||||
$oDocumentAdminController = getAdminController('document');
|
||||
$output = $oDocumentAdminController->deleteModuleDocument($module_srl);
|
||||
|
|
@ -319,8 +319,6 @@ class documentController extends document
|
|||
|
||||
// remove histories
|
||||
$this->deleteDocumentHistory(null, null, $module_srl);
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -349,7 +347,7 @@ class documentController extends document
|
|||
{
|
||||
if(!$manual_inserted && !checkCSRF())
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
}
|
||||
|
||||
// begin transaction
|
||||
|
|
@ -396,41 +394,59 @@ class documentController extends document
|
|||
|
||||
// Serialize the $extra_vars, check the extra_vars type, because duplicate serialized avoid
|
||||
if(!is_string($obj->extra_vars)) $obj->extra_vars = serialize($obj->extra_vars);
|
||||
|
||||
// Remove the columns for automatic saving
|
||||
unset($obj->_saved_doc_srl);
|
||||
unset($obj->_saved_doc_title);
|
||||
unset($obj->_saved_doc_content);
|
||||
unset($obj->_saved_doc_message);
|
||||
|
||||
// Remove manual member info to prevent forgery. This variable can be set by triggers only.
|
||||
unset($obj->manual_member_info);
|
||||
|
||||
// Call a trigger (before)
|
||||
$output = ModuleHandler::triggerCall('document.insertDocument', 'before', $obj);
|
||||
if(!$output->toBool()) return $output;
|
||||
// Register it if no given document_srl exists
|
||||
if(!$obj->document_srl) $obj->document_srl = getNextSequence();
|
||||
elseif(!$manual_inserted && !$isRestore && !checkUserSequence($obj->document_srl)) return new Object(-1, 'msg_not_permitted');
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
// Register it if no given document_srl exists
|
||||
if(!$obj->document_srl)
|
||||
{
|
||||
$obj->document_srl = getNextSequence();
|
||||
}
|
||||
elseif(!$manual_inserted && !$isRestore && !checkUserSequence($obj->document_srl))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
}
|
||||
|
||||
$oDocumentModel = getModel('document');
|
||||
// Set to 0 if the category_srl doesn't exist
|
||||
$oDocumentModel = getModel('document');
|
||||
if($obj->category_srl)
|
||||
{
|
||||
$category_list = $oDocumentModel->getCategoryList($obj->module_srl);
|
||||
if(count($category_list) > 0 && !$category_list[$obj->category_srl]->grant)
|
||||
{
|
||||
return new Object(-1, 'msg_not_permitted');
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
}
|
||||
if(count($category_list) > 0 && !$category_list[$obj->category_srl]) $obj->category_srl = 0;
|
||||
}
|
||||
|
||||
// Set the read counts and update order.
|
||||
if(!$obj->readed_count) $obj->readed_count = 0;
|
||||
if($isLatest) $obj->update_order = $obj->list_order = $obj->document_srl * -1;
|
||||
else $obj->update_order = $obj->list_order;
|
||||
|
||||
// Check the status of password hash for manually inserting. Apply hashing for otherwise.
|
||||
if($obj->password && !$obj->password_is_hashed)
|
||||
{
|
||||
$obj->password = getModel('member')->hashPassword($obj->password);
|
||||
}
|
||||
|
||||
// Insert member's information only if the member is logged-in and not manually registered.
|
||||
$logged_info = Context::get('logged_info');
|
||||
if(Context::get('is_logged') && !$manual_inserted && !$isRestore)
|
||||
if(Context::get('is_logged') && !$manual_inserted && !$isRestore && !$obj->manual_member_info)
|
||||
{
|
||||
$obj->member_srl = $logged_info->member_srl;
|
||||
|
||||
|
|
@ -441,19 +457,27 @@ class documentController extends document
|
|||
$obj->email_address = $logged_info->email_address;
|
||||
$obj->homepage = $logged_info->homepage;
|
||||
}
|
||||
|
||||
// If the tile is empty, extract string from the contents.
|
||||
$obj->title = htmlspecialchars($obj->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
|
||||
settype($obj->title, "string");
|
||||
if($obj->title == '') $obj->title = cut_str(trim(strip_tags(nl2br($obj->content))),20,'...');
|
||||
// If no tile extracted from the contents, leave it untitled.
|
||||
if($obj->title == '') $obj->title = 'Untitled';
|
||||
$obj->title = escape($obj->title, false);
|
||||
if($obj->title == '')
|
||||
{
|
||||
$obj->title = cut_str(trim(strip_tags(nl2br($obj->content))),20,'...');
|
||||
}
|
||||
if($obj->title == '')
|
||||
{
|
||||
$obj->title = 'Untitled';
|
||||
}
|
||||
|
||||
// Remove XE's own tags from the contents.
|
||||
$obj->content = preg_replace('!<\!--(Before|After)(Document|Comment)\(([0-9]+),([0-9]+)\)-->!is', '', $obj->content);
|
||||
|
||||
// Return error if content is empty.
|
||||
if (!$manual_inserted && is_empty_html_content($obj->content))
|
||||
{
|
||||
return new Object(-1, 'msg_empty_content');
|
||||
return new BaseObject(-1, 'msg_empty_content');
|
||||
}
|
||||
|
||||
// if use editor of nohtml, Remove HTML tags from the contents.
|
||||
if(!$manual_inserted)
|
||||
{
|
||||
|
|
@ -462,8 +486,9 @@ class documentController extends document
|
|||
|
||||
// Remove iframe and script if not a top adminisrator in the session.
|
||||
if($logged_info->is_admin != 'Y') $obj->content = removeHackTag($obj->content);
|
||||
|
||||
// An error appears if both log-in info and user name don't exist.
|
||||
if(!$logged_info->member_srl && !$obj->nick_name) return new Object(-1,'msg_invalid_request');
|
||||
if(!$logged_info->member_srl && !$obj->nick_name) return new BaseObject(-1, 'msg_invalid_request');
|
||||
|
||||
// Fix encoding of non-BMP UTF-8 characters.
|
||||
$obj->title = utf8_mbencode($obj->title);
|
||||
|
|
@ -478,6 +503,7 @@ class documentController extends document
|
|||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
// Insert extra variables if the document successfully inserted.
|
||||
$extra_vars = array();
|
||||
$extra_keys = $oDocumentModel->getExtraKeys($obj->module_srl);
|
||||
|
|
@ -550,10 +576,10 @@ class documentController extends document
|
|||
{
|
||||
if(!$manual_updated && !checkCSRF())
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
}
|
||||
|
||||
if(!$source_obj->document_srl || !$obj->document_srl) return new Object(-1,'msg_invalied_request');
|
||||
if(!$source_obj->document_srl || !$obj->document_srl) return new BaseObject(-1, 'msg_invalied_request');
|
||||
|
||||
// Default Status
|
||||
if($obj->status)
|
||||
|
|
@ -574,9 +600,15 @@ class documentController extends document
|
|||
$this->_checkDocumentStatusForOldVersion($obj);
|
||||
}
|
||||
|
||||
// Remove manual member info to prevent forgery. This variable can be set by triggers only.
|
||||
unset($obj->manual_member_info);
|
||||
|
||||
// Call a trigger (before)
|
||||
$output = ModuleHandler::triggerCall('document.updateDocument', 'before', $obj);
|
||||
if(!$output->toBool()) return $output;
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
// begin transaction
|
||||
$oDB = &DB::getInstance();
|
||||
|
|
@ -610,6 +642,7 @@ class documentController extends document
|
|||
{
|
||||
$obj->ipaddress = $source_obj->get('ipaddress');
|
||||
}
|
||||
|
||||
// List variables
|
||||
if($obj->comment_status) $obj->commentStatus = $obj->comment_status;
|
||||
if(!$obj->commentStatus) $obj->commentStatus = 'DENY';
|
||||
|
|
@ -635,21 +668,24 @@ class documentController extends document
|
|||
|
||||
// Serialize the $extra_vars
|
||||
if(!is_string($obj->extra_vars)) $obj->extra_vars = serialize($obj->extra_vars);
|
||||
|
||||
// Remove the columns for automatic saving
|
||||
unset($obj->_saved_doc_srl);
|
||||
unset($obj->_saved_doc_title);
|
||||
unset($obj->_saved_doc_content);
|
||||
unset($obj->_saved_doc_message);
|
||||
|
||||
$oDocumentModel = getModel('document');
|
||||
// Set the category_srl to 0 if the changed category is not exsiting.
|
||||
$oDocumentModel = getModel('document');
|
||||
if($source_obj->get('category_srl')!=$obj->category_srl)
|
||||
{
|
||||
$category_list = $oDocumentModel->getCategoryList($obj->module_srl);
|
||||
if(!$category_list[$obj->category_srl]) $obj->category_srl = 0;
|
||||
}
|
||||
|
||||
// Change the update order
|
||||
$obj->update_order = getNextSequence() * -1;
|
||||
|
||||
// Hash the password if it exists
|
||||
if($obj->password)
|
||||
{
|
||||
|
|
@ -658,7 +694,7 @@ class documentController extends document
|
|||
|
||||
// If an author is identical to the modifier or history is used, use the logged-in user's information.
|
||||
$logged_info = Context::get('logged_info');
|
||||
if(Context::get('is_logged') && !$manual_updated)
|
||||
if(Context::get('is_logged') && !$manual_updated && !$obj->manual_member_info)
|
||||
{
|
||||
if($source_obj->get('member_srl')==$logged_info->member_srl)
|
||||
{
|
||||
|
|
@ -671,7 +707,7 @@ class documentController extends document
|
|||
}
|
||||
|
||||
// For the document written by logged-in user however no nick_name exists
|
||||
if($source_obj->get('member_srl')&& !$obj->nick_name)
|
||||
if($source_obj->get('member_srl')&& !$obj->nick_name && !$obj->manual_member_info)
|
||||
{
|
||||
$obj->member_srl = $source_obj->get('member_srl');
|
||||
$obj->user_name = $source_obj->get('user_name');
|
||||
|
|
@ -679,19 +715,27 @@ class documentController extends document
|
|||
$obj->email_address = $source_obj->get('email_address');
|
||||
$obj->homepage = $source_obj->get('homepage');
|
||||
}
|
||||
|
||||
// If the tile is empty, extract string from the contents.
|
||||
$obj->title = htmlspecialchars($obj->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
|
||||
settype($obj->title, "string");
|
||||
if($obj->title == '') $obj->title = cut_str(strip_tags($obj->content),20,'...');
|
||||
// If no tile extracted from the contents, leave it untitled.
|
||||
if($obj->title == '') $obj->title = 'Untitled';
|
||||
$obj->title = escape($obj->title, false);
|
||||
if($obj->title == '')
|
||||
{
|
||||
$obj->title = cut_str(strip_tags($obj->content),20,'...');
|
||||
}
|
||||
if($obj->title == '')
|
||||
{
|
||||
$obj->title = 'Untitled';
|
||||
}
|
||||
|
||||
// Remove XE's own tags from the contents.
|
||||
$obj->content = preg_replace('!<\!--(Before|After)(Document|Comment)\(([0-9]+),([0-9]+)\)-->!is', '', $obj->content);
|
||||
|
||||
// Return error if content is empty.
|
||||
if (!$manual_inserted && is_empty_html_content($obj->content))
|
||||
{
|
||||
return new Object(-1, 'msg_empty_content');
|
||||
return new BaseObject(-1, 'msg_empty_content');
|
||||
}
|
||||
|
||||
// if use editor of nohtml, Remove HTML tags from the contents.
|
||||
if(!$manual_updated)
|
||||
{
|
||||
|
|
@ -722,11 +766,13 @@ class documentController extends document
|
|||
$obj->content = $document_output->data->content;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove iframe and script if not a top adminisrator in the session.
|
||||
if($logged_info->is_admin != 'Y')
|
||||
{
|
||||
$obj->content = removeHackTag($obj->content);
|
||||
}
|
||||
|
||||
// if temporary document, regdate is now setting
|
||||
if($source_obj->get('status') == $this->getConfigStatus('temp')) $obj->regdate = date('YmdHis');
|
||||
|
||||
|
|
@ -768,6 +814,7 @@ class documentController extends document
|
|||
$this->insertDocumentExtraVar($obj->module_srl, $obj->document_srl, $idx, $value, $extra_item->eid);
|
||||
}
|
||||
}
|
||||
|
||||
// Inert extra vars for multi-language support of title and contents.
|
||||
if($extra_content->title) $this->insertDocumentExtraVar($obj->module_srl, $obj->document_srl, -1, $extra_content->title, 'title_'.Context::getLangType());
|
||||
if($extra_content->content) $this->insertDocumentExtraVar($obj->module_srl, $obj->document_srl, -2, $extra_content->content, 'content_'.Context::getLangType());
|
||||
|
|
@ -799,6 +846,7 @@ class documentController extends document
|
|||
|
||||
// commit
|
||||
$oDB->commit();
|
||||
|
||||
// Remove the thumbnail file
|
||||
FileHandler::removeDir(sprintf('files/thumbnails/%s',getNumberingPath($obj->document_srl, 3)));
|
||||
|
||||
|
|
@ -876,7 +924,7 @@ class documentController extends document
|
|||
// Check if the documnet exists
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl, $is_admin);
|
||||
}
|
||||
else if($isEmptyTrash && $oDocument == null) return new Object(-1, 'document is not exists');
|
||||
else if($isEmptyTrash && $oDocument == null) return new BaseObject(-1, 'document is not exists');
|
||||
|
||||
$oMemberModel = getModel('member');
|
||||
$member_info = $oMemberModel->getMemberInfoByMemberSrl($oDocument->get('member_srl'));
|
||||
|
|
@ -884,13 +932,13 @@ class documentController extends document
|
|||
|
||||
if($member_info->is_admin == 'Y' && $logged_info->is_admin != 'Y')
|
||||
{
|
||||
return new Object(-1, 'msg_document_is_admin_not_permitted');
|
||||
return new BaseObject(-1, 'msg_document_is_admin_not_permitted');
|
||||
}
|
||||
|
||||
|
||||
if(!$oDocument->isExists() || $oDocument->document_srl != $document_srl) return new Object(-1, 'msg_invalid_document');
|
||||
if(!$oDocument->isExists() || $oDocument->document_srl != $document_srl) return new BaseObject(-1, 'msg_invalid_document');
|
||||
// Check if a permossion is granted
|
||||
if(!$oDocument->isGranted()) return new Object(-1, 'msg_not_permitted');
|
||||
if(!$oDocument->isGranted()) return new BaseObject(-1, 'msg_not_permitted');
|
||||
|
||||
//if empty trash, document already deleted, therefore document not delete
|
||||
$args = new stdClass();
|
||||
|
|
@ -995,7 +1043,7 @@ class documentController extends document
|
|||
$member_info = $oMemberModel->getMemberInfoByMemberSrl($oDocument->get('member_srl'));
|
||||
if($member_info->is_admin == 'Y' && $logged_info->is_admin != 'Y')
|
||||
{
|
||||
return new Object(-1, 'msg_admin_document_no_move_to_trash');
|
||||
return new BaseObject(-1, 'msg_admin_document_no_move_to_trash');
|
||||
}
|
||||
|
||||
$trash_args->module_srl = $oDocument->get('module_srl');
|
||||
|
|
@ -1195,7 +1243,7 @@ class documentController extends document
|
|||
*/
|
||||
function insertDocumentExtraKey($module_srl, $var_idx, $var_name, $var_type, $var_is_required = 'N', $var_search = 'N', $var_default = '', $var_desc = '', $eid)
|
||||
{
|
||||
if(!$module_srl || !$var_idx || !$var_name || !$var_type || !$eid) return new Object(-1,'msg_invalid_request');
|
||||
if(!$module_srl || !$var_idx || !$var_name || !$var_type || !$eid) return new BaseObject(-1, 'msg_invalid_request');
|
||||
|
||||
$obj = new stdClass();
|
||||
$obj->module_srl = $module_srl;
|
||||
|
|
@ -1232,7 +1280,7 @@ class documentController extends document
|
|||
*/
|
||||
function deleteDocumentExtraKeys($module_srl, $var_idx = null)
|
||||
{
|
||||
if(!$module_srl) return new Object(-1,'msg_invalid_request');
|
||||
if(!$module_srl) return new BaseObject(-1, 'msg_invalid_request');
|
||||
$obj = new stdClass();
|
||||
$obj->module_srl = $module_srl;
|
||||
if(!is_null($var_idx)) $obj->var_idx = $var_idx;
|
||||
|
|
@ -1277,7 +1325,7 @@ class documentController extends document
|
|||
$oDB->commit();
|
||||
|
||||
Rhymix\Framework\Cache::delete("site_and_module:module_document_extra_keys:$module_srl");
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1292,7 +1340,7 @@ class documentController extends document
|
|||
*/
|
||||
function insertDocumentExtraVar($module_srl, $document_srl, $var_idx, $value, $eid = null, $lang_code = '')
|
||||
{
|
||||
if(!$module_srl || !$document_srl || !$var_idx || !isset($value)) return new Object(-1,'msg_invalid_request');
|
||||
if(!$module_srl || !$document_srl || !$var_idx || !isset($value)) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!$lang_code) $lang_code = Context::getLangType();
|
||||
|
||||
$obj = new stdClass;
|
||||
|
|
@ -1347,7 +1395,7 @@ class documentController extends document
|
|||
// Return fail if session already has information about votes
|
||||
if($_SESSION['voted_document'][$document_srl])
|
||||
{
|
||||
return new Object(-1, $failed_voted);
|
||||
return new BaseObject(-1, $failed_voted);
|
||||
}
|
||||
// Get the original document
|
||||
$oDocumentModel = getModel('document');
|
||||
|
|
@ -1356,7 +1404,7 @@ class documentController extends document
|
|||
if($oDocument->get('ipaddress') == $_SERVER['REMOTE_ADDR'])
|
||||
{
|
||||
$_SESSION['voted_document'][$document_srl] = false;
|
||||
return new Object(-1, $failed_voted);
|
||||
return new BaseObject(-1, $failed_voted);
|
||||
}
|
||||
// Create a member model object
|
||||
$oMemberModel = getModel('member');
|
||||
|
|
@ -1369,7 +1417,7 @@ class documentController extends document
|
|||
if($member_srl && $member_srl == abs($oDocument->get('member_srl')))
|
||||
{
|
||||
$_SESSION['voted_document'][$document_srl] = false;
|
||||
return new Object(-1, $failed_voted);
|
||||
return new BaseObject(-1, $failed_voted);
|
||||
}
|
||||
}
|
||||
// Use member_srl for logged-in members and IP address for non-members.
|
||||
|
|
@ -1388,7 +1436,7 @@ class documentController extends document
|
|||
if($output->data->count)
|
||||
{
|
||||
$_SESSION['voted_document'][$document_srl] = false;
|
||||
return new Object(-1, $failed_voted);
|
||||
return new BaseObject(-1, $failed_voted);
|
||||
}
|
||||
// begin transaction
|
||||
$oDB = DB::getInstance();
|
||||
|
|
@ -1432,7 +1480,7 @@ class documentController extends document
|
|||
Rhymix\Framework\Cache::delete('document_item:' . getNumberingPath($document_srl) . $document_srl);
|
||||
|
||||
// Return result
|
||||
$output = new Object();
|
||||
$output = new BaseObject();
|
||||
if($point > 0)
|
||||
{
|
||||
$output->setMessage('success_voted');
|
||||
|
|
@ -1458,7 +1506,7 @@ class documentController extends document
|
|||
// Fail if session information already has a reported document
|
||||
if($_SESSION['declared_document'][$document_srl])
|
||||
{
|
||||
return new Object(-1, 'failed_declared');
|
||||
return new BaseObject(-1, 'failed_declared');
|
||||
}
|
||||
|
||||
// Check if previously reported
|
||||
|
|
@ -1493,7 +1541,7 @@ class documentController extends document
|
|||
if($oDocument->get('ipaddress') == $_SERVER['REMOTE_ADDR'])
|
||||
{
|
||||
$_SESSION['declared_document'][$document_srl] = true;
|
||||
return new Object(-1, 'failed_declared');
|
||||
return new BaseObject(-1, 'failed_declared');
|
||||
}
|
||||
|
||||
// Check if document's author is a member.
|
||||
|
|
@ -1506,7 +1554,7 @@ class documentController extends document
|
|||
if($member_srl && $member_srl == abs($oDocument->get('member_srl')))
|
||||
{
|
||||
$_SESSION['declared_document'][$document_srl] = true;
|
||||
return new Object(-1, 'failed_declared');
|
||||
return new BaseObject(-1, 'failed_declared');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1529,7 +1577,7 @@ class documentController extends document
|
|||
if($output->data->count)
|
||||
{
|
||||
$_SESSION['declared_document'][$document_srl] = true;
|
||||
return new Object(-1, 'failed_declared');
|
||||
return new BaseObject(-1, 'failed_declared');
|
||||
}
|
||||
|
||||
// begin transaction
|
||||
|
|
@ -1715,7 +1763,7 @@ class documentController extends document
|
|||
// Display an error that the category cannot be deleted if it has a child
|
||||
$output = executeQuery('document.getChildCategoryCount', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
if($output->data->count>0) return new Object(-1, 'msg_cannot_delete_for_child');
|
||||
if($output->data->count>0) return new BaseObject(-1, 'msg_cannot_delete_for_child');
|
||||
// Delete a category information
|
||||
$output = executeQuery('document.deleteCategory', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
|
@ -1784,7 +1832,7 @@ class documentController extends document
|
|||
// Seek a full list of categories
|
||||
$category_list = $oDocumentModel->getCategoryList($module_srl);
|
||||
$category_srl_list = array_keys($category_list);
|
||||
if(count($category_srl_list)<2) return new Object();
|
||||
if(count($category_srl_list)<2) return new BaseObject();
|
||||
|
||||
$prev_category = NULL;
|
||||
foreach($category_list as $key => $val)
|
||||
|
|
@ -1793,9 +1841,9 @@ class documentController extends document
|
|||
$prev_category = $val;
|
||||
}
|
||||
// Return if the previous category doesn't exist
|
||||
if(!$prev_category) return new Object(-1,lang('msg_category_not_moved'));
|
||||
if(!$prev_category) return new BaseObject(-1, 'msg_category_not_moved');
|
||||
// Return if the selected category is the top level
|
||||
if($category_srl_list[0]==$category_srl) return new Object(-1,lang('msg_category_not_moved'));
|
||||
if($category_srl_list[0]==$category_srl) return new BaseObject(-1, 'msg_category_not_moved');
|
||||
// Information of the selected category
|
||||
$cur_args = new stdClass;
|
||||
$cur_args->category_srl = $category_srl;
|
||||
|
|
@ -1809,7 +1857,7 @@ class documentController extends document
|
|||
$prev_args->title = $prev_category->title;
|
||||
$this->updateCategory($prev_args);
|
||||
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1831,7 +1879,7 @@ class documentController extends document
|
|||
// Seek a full list of categories
|
||||
$category_list = $oDocumentModel->getCategoryList($module_srl);
|
||||
$category_srl_list = array_keys($category_list);
|
||||
if(count($category_srl_list)<2) return new Object();
|
||||
if(count($category_srl_list)<2) return new BaseObject();
|
||||
|
||||
for($i=0;$i<count($category_srl_list);$i++)
|
||||
{
|
||||
|
|
@ -1839,7 +1887,7 @@ class documentController extends document
|
|||
}
|
||||
|
||||
$next_category_srl = $category_srl_list[$i+1];
|
||||
if(!$category_list[$next_category_srl]) return new Object(-1,lang('msg_category_not_moved'));
|
||||
if(!$category_list[$next_category_srl]) return new BaseObject(-1, 'msg_category_not_moved');
|
||||
$next_category = $category_list[$next_category_srl];
|
||||
// Information of the selected category
|
||||
$cur_args = new stdClass;
|
||||
|
|
@ -1854,7 +1902,7 @@ class documentController extends document
|
|||
$next_args->title = $next_category->title;
|
||||
$this->updateCategory($next_args);
|
||||
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1919,7 +1967,7 @@ class documentController extends document
|
|||
$columnList = array('module_srl', 'module');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl, $columnList);
|
||||
$grant = $oModuleModel->getGrant($module_info, Context::get('logged_info'));
|
||||
if(!$grant->manager) return new Object(-1,'msg_not_permitted');
|
||||
if(!$grant->manager) return new BaseObject(-1, 'msg_not_permitted');
|
||||
|
||||
if($args->expand !="Y") $args->expand = "N";
|
||||
if(!is_array($args->group_srls)) $args->group_srls = str_replace('|@|',',',$args->group_srls);
|
||||
|
|
@ -1989,7 +2037,7 @@ class documentController extends document
|
|||
$columnList = array('module_srl', 'module');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($source_category->module_srl, $columnList);
|
||||
$grant = $oModuleModel->getGrant($module_info, Context::get('logged_info'));
|
||||
if(!$grant->manager) return new Object(-1,'msg_not_permitted');
|
||||
if(!$grant->manager) return new BaseObject(-1, 'msg_not_permitted');
|
||||
|
||||
// First child of the parent_category_srl
|
||||
$source_args = new stdClass;
|
||||
|
|
@ -2050,14 +2098,14 @@ class documentController extends document
|
|||
$columnList = array('module_srl', 'module');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl, $columnList);
|
||||
$grant = $oModuleModel->getGrant($module_info, Context::get('logged_info'));
|
||||
if(!$grant->manager) return new Object(-1,'msg_not_permitted');
|
||||
if(!$grant->manager) return new BaseObject(-1, 'msg_not_permitted');
|
||||
|
||||
$oDocumentModel = getModel('document');
|
||||
// Get original information
|
||||
$category_info = $oDocumentModel->getCategory($args->category_srl);
|
||||
if($category_info->parent_srl) $parent_srl = $category_info->parent_srl;
|
||||
// Display an error that the category cannot be deleted if it has a child node
|
||||
if($oDocumentModel->getCategoryChlidCount($args->category_srl)) return new Object(-1, 'msg_cannot_delete_for_child');
|
||||
if($oDocumentModel->getCategoryChlidCount($args->category_srl)) return new BaseObject(-1, 'msg_cannot_delete_for_child');
|
||||
// Remove from the DB
|
||||
$output = $this->deleteCategory($args->category_srl);
|
||||
if(!$output->toBool())
|
||||
|
|
@ -2091,7 +2139,7 @@ class documentController extends document
|
|||
$columnList = array('module_srl', 'module');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
|
||||
$grant = $oModuleModel->getGrant($module_info, Context::get('logged_info'));
|
||||
if(!$grant->manager) return new Object(-1,'msg_not_permitted');
|
||||
if(!$grant->manager) return new BaseObject(-1, 'msg_not_permitted');
|
||||
|
||||
$xml_file = $this->makeCategoryFile($module_srl);
|
||||
// Set return value
|
||||
|
|
@ -2249,7 +2297,7 @@ class documentController extends document
|
|||
{
|
||||
foreach($langs as $key => $val)
|
||||
{
|
||||
$xml_header_buff .= sprintf('$_titles[%d]["%s"] = "%s"; ', $category_srl, $key, str_replace('"','\\"',htmlspecialchars($val, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)));
|
||||
$xml_header_buff .= sprintf('$_titles[%d][%s] = %s; ', $category_srl, var_export($key, true), var_export(escape($val, false), true));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2258,12 +2306,12 @@ class documentController extends document
|
|||
{
|
||||
foreach($langx as $key => $val)
|
||||
{
|
||||
$xml_header_buff .= sprintf('$_descriptions[%d]["%s"] = "%s"; ', $category_srl, $key, str_replace('"','\\"',htmlspecialchars($val, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)));
|
||||
$xml_header_buff .= sprintf('$_descriptions[%d][%s] = %s; ', $category_srl, var_export($key, true), var_export(escape($val, false), true));
|
||||
}
|
||||
}
|
||||
|
||||
$attribute = sprintf(
|
||||
'mid="%s" module_srl="%d" node_srl="%d" parent_srl="%d" category_srl="%d" text="<?php echo (%s?($_titles[%d][$lang_type]):"")?>" url="%s" expand="%s" color="%s" description="<?php echo (%s?($_descriptions[%d][$lang_type]):"")?>" document_count="%d" ',
|
||||
'mid="%s" module_srl="%d" node_srl="%d" parent_srl="%d" category_srl="%d" text="<?php echo (%s?($_titles[%d][$lang_type]):"")?>" url=%s expand=%s color=%s description="<?php echo (%s?($_descriptions[%d][$lang_type]):"")?>" document_count="%d" ',
|
||||
$mid,
|
||||
$module_srl,
|
||||
$category_srl,
|
||||
|
|
@ -2271,9 +2319,9 @@ class documentController extends document
|
|||
$category_srl,
|
||||
$group_check_code,
|
||||
$category_srl,
|
||||
getUrl('','mid',$node->mid,'category',$category_srl),
|
||||
$expand,
|
||||
htmlspecialchars($color, ENT_COMPAT | ENT_HTML401, 'UTF-8', false),
|
||||
str_replace("'", '"', var_export(getUrl('','mid',$node->mid,'category',$category_srl), true)),
|
||||
str_replace("'", '"', var_export($expand, true)),
|
||||
str_replace("'", '"', var_export(escape($color, false), true)),
|
||||
$group_check_code,
|
||||
$category_srl,
|
||||
$node->document_count
|
||||
|
|
@ -2338,10 +2386,10 @@ class documentController extends document
|
|||
{
|
||||
$val = htmlspecialchars($val, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
|
||||
$php_header_buff .= sprintf(
|
||||
'$_titles[%d]["%s"] = "%s"; ',
|
||||
'$_titles[%d][%s] = %s; ',
|
||||
$category_srl,
|
||||
$key,
|
||||
str_replace('"','\\"', $val)
|
||||
var_export($key, true),
|
||||
var_export($val, true)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -2354,17 +2402,17 @@ class documentController extends document
|
|||
{
|
||||
$val = htmlspecialchars($val, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
|
||||
$php_header_buff .= sprintf(
|
||||
'$_descriptions[%d]["%s"] = "%s"; ',
|
||||
'$_descriptions[%d][%s] = %s; ',
|
||||
$category_srl,
|
||||
$key,
|
||||
str_replace('"','\\"', $val)
|
||||
var_export($key, true),
|
||||
var_export($val, true)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Create attributes(Use the category_srl_list to check whether to belong to the menu's node. It seems to be tricky but fast fast and powerful;)
|
||||
$attribute = sprintf(
|
||||
'"mid" => "%s", "module_srl" => "%d","node_srl"=>"%s","category_srl"=>"%s","parent_srl"=>"%s","text"=>$_titles[%d][$lang_type],"selected"=>(in_array(Context::get("category"),array(%s))?1:0),"expand"=>"%s","color"=>"%s","description"=>$_descriptions[%d][$lang_type],"list"=>array(%s),"document_count"=>"%d","grant"=>%s?true:false',
|
||||
'"mid" => "%s", "module_srl" => "%d","node_srl"=>"%d","category_srl"=>"%d","parent_srl"=>"%d","text"=>$_titles[%d][$lang_type],"selected"=>(in_array(Context::get("category"),array(%s))?1:0),"expand"=>%s,"color"=>%s,"description"=>$_descriptions[%d][$lang_type],"list"=>array(%s),"document_count"=>"%d","grant"=>%s?true:false',
|
||||
$node->mid,
|
||||
$node->module_srl,
|
||||
$node->category_srl,
|
||||
|
|
@ -2372,8 +2420,8 @@ class documentController extends document
|
|||
$node->parent_srl,
|
||||
$node->category_srl,
|
||||
$selected,
|
||||
$expand,
|
||||
$node->color,
|
||||
var_export($expand, true),
|
||||
var_export($node->color, true),
|
||||
$node->category_srl,
|
||||
$child_buff,
|
||||
$node->document_count,
|
||||
|
|
@ -2416,7 +2464,7 @@ class documentController extends document
|
|||
*/
|
||||
function procDocumentAddCart()
|
||||
{
|
||||
if(!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted');
|
||||
if(!Context::get('is_logged')) return $this->setError('msg_not_permitted');
|
||||
|
||||
// Get document_srl
|
||||
$srls = explode(',',Context::get('srls'));
|
||||
|
|
@ -2436,14 +2484,14 @@ class documentController extends document
|
|||
$args->document_srls = implode(',',$document_srls);
|
||||
$args->order_type = 'asc';
|
||||
$output = executeQueryArray('document.getDocuments', $args);
|
||||
if(!$output->data) return new Object();
|
||||
if(!$output->data) return new BaseObject();
|
||||
|
||||
unset($document_srls);
|
||||
foreach($output->data as $key => $val)
|
||||
{
|
||||
$document_srls[$val->module_srl][] = $val->document_srl;
|
||||
}
|
||||
if(!$document_srls || !count($document_srls)) return new Object();
|
||||
if(!$document_srls || !count($document_srls)) return new BaseObject();
|
||||
|
||||
// Check if each of module administrators exists. Top-level administator will have a permission to modify every document of all modules.(Even to modify temporarily saved or trashed documents)
|
||||
$oModuleModel = getModel('module');
|
||||
|
|
@ -2468,7 +2516,7 @@ class documentController extends document
|
|||
}
|
||||
}
|
||||
}
|
||||
if(!count($document_srls)) return new Object();
|
||||
if(!count($document_srls)) return new BaseObject();
|
||||
|
||||
foreach($document_srls as $module_srl => $documents)
|
||||
{
|
||||
|
|
@ -2490,7 +2538,7 @@ class documentController extends document
|
|||
function procDocumentManageCheckedDocument()
|
||||
{
|
||||
@set_time_limit(0);
|
||||
if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
|
||||
if(!Context::get('is_logged')) return $this->setError('msg_not_permitted');
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
// Get request parameters.
|
||||
|
|
@ -2546,13 +2594,13 @@ class documentController extends document
|
|||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
if (!$module_info->module_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$module_grant = $oModuleModel->getGrant($module_info, $logged_info);
|
||||
if (!$module_grant->manager)
|
||||
{
|
||||
return new Object(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2562,22 +2610,22 @@ class documentController extends document
|
|||
|
||||
if($type == 'move')
|
||||
{
|
||||
if(!$target_module_srl) return new Object(-1, 'fail_to_move');
|
||||
if(!$target_module_srl) return $this->setError('fail_to_move');
|
||||
|
||||
$oDocumentAdminController = getAdminController('document');
|
||||
$output = $oDocumentAdminController->moveDocumentModule($document_srl_list, $target_module_srl, $target_category_srl);
|
||||
if(!$output->toBool()) return new Object(-1, 'fail_to_move');
|
||||
if(!$output->toBool()) return $this->setError('fail_to_move');
|
||||
|
||||
$msg_code = 'success_moved';
|
||||
|
||||
}
|
||||
else if($type == 'copy')
|
||||
{
|
||||
if(!$target_module_srl) return new Object(-1, 'fail_to_move');
|
||||
if(!$target_module_srl) return $this->setError('fail_to_move');
|
||||
|
||||
$oDocumentAdminController = getAdminController('document');
|
||||
$output = $oDocumentAdminController->copyDocumentModule($document_srl_list, $target_module_srl, $target_category_srl);
|
||||
if(!$output->toBool()) return new Object(-1, 'fail_to_move');
|
||||
if(!$output->toBool()) return $this->setError('fail_to_move');
|
||||
|
||||
$msg_code = 'success_copied';
|
||||
}
|
||||
|
|
@ -2588,7 +2636,7 @@ class documentController extends document
|
|||
foreach ($document_srl_list as $document_srl)
|
||||
{
|
||||
$output = $this->deleteDocument($document_srl, true);
|
||||
if(!$output->toBool()) return new Object(-1, 'fail_to_delete');
|
||||
if(!$output->toBool()) return $this->setError('fail_to_delete');
|
||||
}
|
||||
$oDB->commit();
|
||||
$msg_code = 'success_deleted';
|
||||
|
|
@ -2604,7 +2652,7 @@ class documentController extends document
|
|||
{
|
||||
$args->document_srl = $document_srl;
|
||||
$output = $this->moveDocumentToTrash($args);
|
||||
if(!$output || !$output->toBool()) return new Object(-1, 'fail_to_trash');
|
||||
if(!$output || !$output->toBool()) return $this->setError('fail_to_trash');
|
||||
}
|
||||
$oDB->commit();
|
||||
$msg_code = 'success_trashed';
|
||||
|
|
@ -2662,13 +2710,13 @@ class documentController extends document
|
|||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($srl);
|
||||
if (!$module_info->module_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$module_grant = $oModuleModel->getGrant($module_info, $logged_info);
|
||||
if (!$module_grant->manager)
|
||||
{
|
||||
return new Object(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
$module_srl[] = $srl;
|
||||
|
|
@ -2707,7 +2755,7 @@ class documentController extends document
|
|||
{
|
||||
if(!$this->module_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$obj = Context::getRequestVars();
|
||||
|
|
@ -2730,12 +2778,12 @@ class documentController extends document
|
|||
{
|
||||
if(!$oDocument->isGranted())
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
if($oDocument->get('status') != $this->getConfigStatus('temp'))
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$output = $this->updateDocument($oDocument, $obj);
|
||||
|
|
@ -2767,7 +2815,7 @@ class documentController extends document
|
|||
*/
|
||||
function procDocumentGetList()
|
||||
{
|
||||
if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
|
||||
if(!Context::get('is_logged')) return $this->setError('msg_not_permitted');
|
||||
$documentSrls = Context::get('document_srls');
|
||||
if($documentSrls) $documentSrlList = explode(',', $documentSrls);
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
* @package /modules/document
|
||||
* @version 0.1
|
||||
*/
|
||||
class documentItem extends Object
|
||||
class documentItem extends BaseObject
|
||||
{
|
||||
/**
|
||||
* Document number
|
||||
|
|
@ -917,6 +917,9 @@ class documentItem extends Object
|
|||
Context::set($cpageStr, $output->page_navigation->cur_page);
|
||||
Context::set('cpage', $output->page_navigation->cur_page);
|
||||
if($output->total_page>1) $this->comment_page_navigation = $output->page_navigation;
|
||||
|
||||
// Call trigger (after)
|
||||
$output = ModuleHandler::triggerCall('document.getComments', 'after', $comment_list);
|
||||
|
||||
return $comment_list;
|
||||
}
|
||||
|
|
@ -1185,9 +1188,27 @@ class documentItem extends Object
|
|||
*/
|
||||
function printExtraImages($time_check = 43200)
|
||||
{
|
||||
if(!$this->document_srl) return;
|
||||
// Get the icon directory
|
||||
$path = sprintf('%s%s',getUrl(), 'modules/document/tpl/icons/');
|
||||
if (!$this->document_srl)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$oDocumentModel = getModel('document');
|
||||
$documentConfig = $oDocumentModel->getDocumentConfig();
|
||||
|
||||
if(Mobile::isFromMobilePhone())
|
||||
{
|
||||
$iconSkin = $documentConfig->micons;
|
||||
}
|
||||
else
|
||||
{
|
||||
$iconSkin = $documentConfig->icons;
|
||||
}
|
||||
if($iconSkin == null)
|
||||
{
|
||||
$iconSkin = 'default';
|
||||
}
|
||||
$path = sprintf('%s%s',getUrl(), "modules/document/tpl/icons/$iconSkin/");
|
||||
|
||||
$buffs = $this->getExtraImages($time_check);
|
||||
if(!count($buffs)) return;
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@
|
|||
*/
|
||||
class documentModel extends document
|
||||
{
|
||||
private $documentConfig = NULL;
|
||||
|
||||
/**
|
||||
* Initialization
|
||||
* @return void
|
||||
|
|
@ -37,7 +39,7 @@ class documentModel extends document
|
|||
{
|
||||
if(!is_array($documentSrls) || count($documentSrls) == 0)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$args = new stdClass();
|
||||
|
|
@ -226,13 +228,13 @@ class documentModel extends document
|
|||
// Call trigger (before)
|
||||
// This trigger can be used to set an alternative output using a different search method
|
||||
$output = ModuleHandler::triggerCall('document.getDocumentList', 'before', $obj);
|
||||
if($output instanceof Object && !$output->toBool())
|
||||
if($output instanceof BaseObject && !$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
// If an alternate output is set, use it instead of running the default queries
|
||||
$use_alternate_output = (isset($obj->use_alternate_output) && $obj->use_alternate_output instanceof Object);
|
||||
$use_alternate_output = (isset($obj->use_alternate_output) && $obj->use_alternate_output instanceof BaseObject);
|
||||
if (!$use_alternate_output)
|
||||
{
|
||||
$this->_setSearchOption($obj, $args, $query_id, $use_division);
|
||||
|
|
@ -506,7 +508,7 @@ class documentModel extends document
|
|||
$oDocument = $oDocumentModel->getDocument($document_srl, false, false, $columnList);
|
||||
$module_srl = $oDocument->get('module_srl');
|
||||
$member_srl = $oDocument->get('member_srl');
|
||||
if(!$module_srl) return new Object(-1, 'msg_invalid_request');
|
||||
if(!$module_srl) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
$document_config = $oModuleModel->getModulePartConfig('document',$module_srl);
|
||||
|
|
@ -913,7 +915,7 @@ class documentModel extends document
|
|||
*/
|
||||
function getDocumentCategories()
|
||||
{
|
||||
if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
|
||||
if(!Context::get('is_logged')) return $this->setError('msg_not_permitted');
|
||||
$module_srl = Context::get('module_srl');
|
||||
$categories= $this->getCategoryList($module_srl);
|
||||
$lang = Context::get('lang');
|
||||
|
|
@ -935,15 +937,18 @@ class documentModel extends document
|
|||
*/
|
||||
function getDocumentConfig()
|
||||
{
|
||||
if(!$GLOBALS['__document_config__'])
|
||||
if ($this->documentConfig === NULL)
|
||||
{
|
||||
$oModuleModel = getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('document');
|
||||
|
||||
if(!$config) $config = new stdClass();
|
||||
$GLOBALS['__document_config__'] = $config;
|
||||
if (!$config)
|
||||
{
|
||||
$config = new stdClass();
|
||||
}
|
||||
$this->documentConfig = $config;
|
||||
}
|
||||
return $GLOBALS['__document_config__'];
|
||||
return $this->documentConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1005,13 +1010,13 @@ class documentModel extends document
|
|||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
// Check permissions
|
||||
$grant = $oModuleModel->getGrant($module_info, Context::get('logged_info'));
|
||||
if(!$grant->manager) return new Object(-1,'msg_not_permitted');
|
||||
if(!$grant->manager) return $this->setError('msg_not_permitted');
|
||||
|
||||
$category_srl = Context::get('category_srl');
|
||||
$category_info = $this->getCategory($category_srl);
|
||||
if(!$category_info)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$this->add('category_info', $category_info);
|
||||
|
|
@ -1193,7 +1198,7 @@ class documentModel extends document
|
|||
{
|
||||
$args = new stdClass;
|
||||
$document_srl = Context::get('document_srl');
|
||||
if(!$document_srl) return new Object(-1,'msg_invalid_request');
|
||||
if(!$document_srl) return $this->setError('msg_invalid_request');
|
||||
|
||||
$point = Context::get('point');
|
||||
if($point != -1) $point = 1;
|
||||
|
|
@ -1202,18 +1207,18 @@ class documentModel extends document
|
|||
$columnList = array('document_srl', 'module_srl');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl, false, false, $columnList);
|
||||
$module_srl = $oDocument->get('module_srl');
|
||||
if(!$module_srl) return new Object(-1, 'msg_invalid_request');
|
||||
if(!$module_srl) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
$document_config = $oModuleModel->getModulePartConfig('document',$module_srl);
|
||||
if($point == -1)
|
||||
{
|
||||
if($document_config->use_vote_down!='S') return new Object(-1, 'msg_invalid_request');
|
||||
if($document_config->use_vote_down!='S') return $this->setError('msg_invalid_request');
|
||||
$args->below_point = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if($document_config->use_vote_up!='S') return new Object(-1, 'msg_invalid_request');
|
||||
if($document_config->use_vote_up!='S') return $this->setError('msg_invalid_request');
|
||||
$args->more_point = 0;
|
||||
}
|
||||
|
||||
|
|
@ -1610,6 +1615,22 @@ class documentModel extends document
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
function getDocumentExtraImagePath()
|
||||
{
|
||||
$documentConfig = getModel('document')->getDocumentConfig();
|
||||
if(Mobile::isFromMobilePhone())
|
||||
{
|
||||
$iconSkin = $documentConfig->micons;
|
||||
}
|
||||
else
|
||||
{
|
||||
$iconSkin = $documentConfig->icons;
|
||||
}
|
||||
$path = sprintf('%s%s',getUrl(), "modules/document/tpl/icons/$iconSkin/");
|
||||
|
||||
return $path;
|
||||
}
|
||||
}
|
||||
/* End of file document.model.php */
|
||||
/* Location: ./modules/document/document.model.php */
|
||||
|
|
|
|||
|
|
@ -36,9 +36,9 @@ class documentView extends document
|
|||
$oDocumentModel = getModel('document');
|
||||
// Creates an object for displaying the selected document
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl, $this->grant->manager);
|
||||
if(!$oDocument->isExists()) return new Object(-1,'msg_invalid_request');
|
||||
if(!$oDocument->isExists()) return $this->setError('msg_invalid_request');
|
||||
// Check permissions
|
||||
if(!$oDocument->isAccessible()) return new Object(-1,'msg_not_permitted');
|
||||
if(!$oDocument->isAccessible()) return $this->setError('msg_not_permitted');
|
||||
// Information setting module
|
||||
//Context::set('module_info', $module_info); //module_info not use in UI
|
||||
// Browser title settings
|
||||
|
|
@ -58,7 +58,7 @@ class documentView extends document
|
|||
{
|
||||
if(!checkCSRF())
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$content = Context::get('content');
|
||||
|
|
@ -87,7 +87,7 @@ class documentView extends document
|
|||
*/
|
||||
function dispDocumentManageDocument()
|
||||
{
|
||||
if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
|
||||
if(!Context::get('is_logged')) return $this->setError('msg_not_permitted');
|
||||
// Taken from a list of selected sessions
|
||||
$flag_list = $_SESSION['document_management'];
|
||||
if(count($flag_list))
|
||||
|
|
@ -140,7 +140,7 @@ class documentView extends document
|
|||
// Get information of the current module
|
||||
$current_module_info = Context::get('current_module_info');
|
||||
$current_module_srl = $current_module_info->module_srl;
|
||||
if(!$current_module_srl) return new Object();
|
||||
if(!$current_module_srl) return new BaseObject();
|
||||
}
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
|
|
@ -159,7 +159,7 @@ class documentView extends document
|
|||
$tpl = $oTemplate->compile($this->module_path.'tpl', 'document_module_config');
|
||||
$obj .= $tpl;
|
||||
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -215,12 +215,12 @@ class documentView extends document
|
|||
$oDocument = $oDocumentModel->getDocument($document_srl, $this->grant->manager, FALSE);
|
||||
if(!$oDocument->isExists())
|
||||
{
|
||||
return new Object(-1,'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
// Check permissions
|
||||
if(!$oDocument->isAccessible())
|
||||
{
|
||||
return new Object(-1,'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
// Browser title settings
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ $lang->category_color = 'Category Font Color';
|
|||
$lang->expand = 'Expand';
|
||||
$lang->category_group_srls = 'Accessable Group';
|
||||
$lang->cmd_make_child = 'Add Child Category';
|
||||
$lang->cmd_pc_icon_setting = 'PC icon setting';
|
||||
$lang->cmd_mobile_icon_setting = 'Mobile icon setting';
|
||||
$lang->cmd_enable_move_category = 'Change category position (Select a category and drag it to the position you want.)';
|
||||
$lang->about_category_title = 'Please enter a category name.';
|
||||
$lang->about_expand = 'Select this option, and they will stay expanded.';
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ $lang->view_count_option_some = '일부 계산';
|
|||
$lang->view_count_option_once = '중복 금지';
|
||||
$lang->view_count_option_none = '계산 안함';
|
||||
$lang->cmd_delete_all_thumbnail = '섬네일 모두 삭제';
|
||||
$lang->cmd_pc_icon_setting = 'PC아이콘 설정';
|
||||
$lang->cmd_mobile_icon_setting = '모바일 아이콘 설정';
|
||||
$lang->title_bold = '제목 굵게';
|
||||
$lang->title_color = '제목 색깔';
|
||||
$lang->new_document_count = '새 글';
|
||||
|
|
@ -21,6 +23,8 @@ $lang->about_view_count_option = '조회수설정에 따라 중복 조회수 카
|
|||
$lang->about_expand = '선택하면 늘 펼쳐진 상태로 있게 합니다.';
|
||||
$lang->about_category_group_srls = '선택한 그룹만 현재 카테고리를 지정할 수 있도록 합니다.';
|
||||
$lang->about_category_color = '분류 폰트색깔을 지정합니다. 예) red 또는 #ff0000';
|
||||
$lang->about_cmd_pc_icon_setting = '게시판 새로운 글 혹은 수정되었을 때 출력하는 아이콘입니다. 기본값은 default 입니다. 사용않함을 선택할 경우 default 스킨이 기본값으로 출력됩니다.';
|
||||
$lang->about_cmd_mobile_icon_setting = '게시판 새로운 글 혹은 수정되었을 때 출력하는 아이콘입니다. 기본값은 default 입니다. 사용않함을 선택할 경우 default 스킨이 기본값으로 출력됩니다.';
|
||||
$lang->cmd_search_next = '계속 검색';
|
||||
$lang->cmd_temp_save = '임시 저장';
|
||||
$lang->cmd_toggle_checked_document = '선택항목 반전';
|
||||
|
|
|
|||
|
|
@ -19,6 +19,28 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label" for="icons">{$lang->cmd_pc_icon_setting}</label>
|
||||
<div class="x_controls">
|
||||
<select name="icons" id="icons">
|
||||
<option value="">{$lang->notuse}</option>
|
||||
<option loop="$pcIconSkinList => $key, $val" value="{$val->title}" selected="selected"|cond="$config->icons == $val->title">{$val->title}</option>
|
||||
</select>
|
||||
<a href="#icons_help" class="x_icon-question-sign" data-toggle>{$lang->help}</a>
|
||||
<p id="icons_help" class="x_help-block" hidden>{$lang->about_cmd_pc_icon_setting}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label" for="micons">{$lang->cmd_mobile_icon_setting}</label>
|
||||
<div class="x_controls">
|
||||
<select name="micons" id="micons">
|
||||
<option value="">{$lang->notuse}</option>
|
||||
<option loop="$pcIconSkinList => $key, $val" value="{$val->title}" selected="selected"|cond="$config->micons == $val->title">{$val->title}</option>
|
||||
</select>
|
||||
<a href="#micons_help" class="x_icon-question-sign" data-toggle>{$lang->help}</a>
|
||||
<p id="micons_help" class="x_help-block" hidden>{$lang->about_cmd_mobile_icon_setting}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="btnArea x_clearfix">
|
||||
<span class="x_pull-right" style="margin-left:10px;"><input class="btn" type="button" value="{$lang->cmd_delete_all_thumbnail}" onclick="doDeleteAllThumbnail()"/></span>
|
||||
|
|
|
|||
BIN
modules/document/tpl/icons/default/file.gif
Normal file
BIN
modules/document/tpl/icons/default/file.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 183 B |
BIN
modules/document/tpl/icons/default/image.gif
Normal file
BIN
modules/document/tpl/icons/default/image.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 127 B |
BIN
modules/document/tpl/icons/default/movie.gif
Normal file
BIN
modules/document/tpl/icons/default/movie.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 134 B |
BIN
modules/document/tpl/icons/default/new.gif
Normal file
BIN
modules/document/tpl/icons/default/new.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 126 B |
BIN
modules/document/tpl/icons/default/secret.gif
Normal file
BIN
modules/document/tpl/icons/default/secret.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 120 B |
BIN
modules/document/tpl/icons/default/update.gif
Normal file
BIN
modules/document/tpl/icons/default/update.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 128 B |
|
|
@ -28,7 +28,7 @@ class emoticon extends EditorHandler
|
|||
function getEmoticonList()
|
||||
{
|
||||
$emoticon = Context::get('emoticon');
|
||||
if(!$emoticon || !preg_match("/^([a-z0-9\_]+)$/i",$emoticon)) return new Object(-1,'msg_invalid_request');
|
||||
if(!$emoticon || !preg_match("/^([a-z0-9\_]+)$/i",$emoticon)) return new BaseObject(-1,'msg_invalid_request');
|
||||
|
||||
$list = $this->getEmoticons($emoticon);
|
||||
|
||||
|
|
|
|||
|
|
@ -39,10 +39,10 @@ class editorAdminController extends editor
|
|||
}
|
||||
|
||||
$output = $this->editorListOrder($component_names,$site_module_info->site_srl);
|
||||
if(!$output->toBool()) return new Object();
|
||||
if(!$output->toBool()) return new BaseObject();
|
||||
|
||||
$output = $this->editorCheckUse($componentList,$site_module_info->site_srl);
|
||||
if(!$output->toBool()) return new Object();
|
||||
if(!$output->toBool()) return new BaseObject();
|
||||
|
||||
$oEditorController = getController('editor');
|
||||
$oEditorController->removeCache($site_module_info->site_srl);
|
||||
|
|
@ -70,7 +70,7 @@ class editorAdminController extends editor
|
|||
$output = executeQuery('editor.updateSiteComponent', $args);
|
||||
}
|
||||
}
|
||||
if(!$output->toBool()) return new Object();
|
||||
if(!$output->toBool()) return new BaseObject();
|
||||
|
||||
unset($componentList);
|
||||
return $output;
|
||||
|
|
@ -99,7 +99,7 @@ class editorAdminController extends editor
|
|||
$output = executeQuery('editor.updateSiteComponent', $args);
|
||||
}
|
||||
|
||||
if(!$output->toBool()) return new Object();
|
||||
if(!$output->toBool()) return new BaseObject();
|
||||
$list_order_num++;
|
||||
}
|
||||
}
|
||||
|
|
@ -251,7 +251,7 @@ class editorAdminController extends editor
|
|||
// Check if the component exists
|
||||
if(!$site_srl) $output = executeQuery('editor.isComponentInserted', $args);
|
||||
else $output = executeQuery('editor.isSiteComponentInserted', $args);
|
||||
if($output->data->count) return new Object(-1, 'msg_component_is_not_founded');
|
||||
if($output->data->count) return $this->setError('msg_component_is_not_founded');
|
||||
// Inert a component
|
||||
$args->list_order = getNextSequence();
|
||||
if(!$site_srl) $output = executeQuery('editor.insertComponent', $args);
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ class editor extends ModuleObject
|
|||
'content_word_break' => 'normal',
|
||||
'enable_autosave' => 'Y',
|
||||
'allow_html' => 'Y',
|
||||
'editor_focus' => 'N',
|
||||
'autoinsert_image' => 'paragraph',
|
||||
'additional_css' => array(),
|
||||
'additional_mobile_css' => array(),
|
||||
|
|
@ -82,8 +83,6 @@ class editor extends ModuleObject
|
|||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before');
|
||||
// 2009. 04. 14 Add a trigger from compiled codes of the editor component
|
||||
$oModuleController->insertTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -150,8 +149,6 @@ class editor extends ModuleObject
|
|||
{
|
||||
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after');
|
||||
}
|
||||
|
||||
return new Object(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -47,20 +47,20 @@ class editorController extends editor
|
|||
{
|
||||
$component = Context::get('component');
|
||||
$method = Context::get('method');
|
||||
if(!$component) return new Object(-1, sprintf(lang('msg_component_is_not_founded'), $component));
|
||||
if(!$component) return $this->setError('msg_component_is_not_founded', $component);
|
||||
|
||||
$oEditorModel = getModel('editor');
|
||||
$oComponent = &$oEditorModel->getComponentObject($component);
|
||||
if(!$oComponent->toBool()) return $oComponent;
|
||||
|
||||
if(!method_exists($oComponent, $method)) return new Object(-1, sprintf(lang('msg_component_is_not_founded'), $component));
|
||||
if(!method_exists($oComponent, $method)) return $this->setError('msg_component_is_not_founded', $component);
|
||||
|
||||
//$output = call_user_method($method, $oComponent);
|
||||
//$output = call_user_func(array($oComponent, $method));
|
||||
if(method_exists($oComponent, $method)) $output = $oComponent->{$method}();
|
||||
else return new Object(-1,sprintf('%s method is not exists', $method));
|
||||
else return $this->setError('%s method is not exists', $method);
|
||||
|
||||
if($output instanceof Object && !$output->toBool()) return $output;
|
||||
if($output instanceof BaseObject && !$output->toBool()) return $output;
|
||||
|
||||
$this->setError($oComponent->getError());
|
||||
$this->setMessage($oComponent->getMessage());
|
||||
|
|
@ -93,13 +93,13 @@ class editorController extends editor
|
|||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($srl);
|
||||
if (!$module_info->module_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$module_grant = $oModuleModel->getGrant($module_info, $logged_info);
|
||||
if (!$module_grant->manager)
|
||||
{
|
||||
return new Object(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
$module_srl[] = $srl;
|
||||
|
|
@ -171,7 +171,7 @@ class editorController extends editor
|
|||
*/
|
||||
function triggerEditorComponentCompile(&$content)
|
||||
{
|
||||
if(Context::getResponseMethod()!='HTML') return new Object();
|
||||
if(Context::getResponseMethod() !== 'HTML') return;
|
||||
|
||||
$module_info = Context::get('module_info');
|
||||
$module_srl = $module_info->module_srl;
|
||||
|
|
@ -253,7 +253,6 @@ class editorController extends editor
|
|||
}
|
||||
|
||||
$content = $this->transComponent($content);
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -350,7 +349,6 @@ class editorController extends editor
|
|||
function triggerDeleteSavedDoc(&$obj)
|
||||
{
|
||||
$this->deleteSavedDoc(false);
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -169,8 +169,9 @@ class editorModel extends editor
|
|||
}
|
||||
Context::set('enable_autosave', $option->enable_autosave);
|
||||
|
||||
// Set allow html
|
||||
// Set allow html and focus
|
||||
Context::set('allow_html', ($option->allow_html === false || $option->allow_html === 'N') ? false : true);
|
||||
Context::set('editor_focus', toBool($option->editor_focus));
|
||||
|
||||
// Load editor components.
|
||||
$site_srl = Context::get('site_module_info')->site_srl ?: 0;
|
||||
|
|
@ -465,11 +466,11 @@ class editorModel extends editor
|
|||
// Create an object of the component and execute
|
||||
$class_path = sprintf('%scomponents/%s/', $this->module_path, $component);
|
||||
$class_file = sprintf('%s%s.class.php', $class_path, $component);
|
||||
if(!file_exists($class_file)) return new Object(-1, sprintf(lang('msg_component_is_not_founded'), $component));
|
||||
if(!file_exists($class_file)) return $this->setError('msg_component_is_not_founded', $component);
|
||||
// Create an object after loading the class file
|
||||
require_once($class_file);
|
||||
$oComponent = new $component($editor_sequence, $class_path);
|
||||
if(!$oComponent) return new Object(-1, sprintf(lang('msg_component_is_not_founded'), $component));
|
||||
if(!$oComponent) return $this->setError('msg_component_is_not_founded', $component);
|
||||
// Add configuration information
|
||||
$component_info = $this->getComponent($component, $site_srl);
|
||||
$oComponent->setInfo($component_info);
|
||||
|
|
@ -526,7 +527,7 @@ class editorModel extends editor
|
|||
$group_list = array();
|
||||
}
|
||||
|
||||
if(count($component_list))
|
||||
if(countobj($component_list))
|
||||
{
|
||||
foreach($component_list as $key => $val)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ class editorView extends editor
|
|||
// Get information of the current module
|
||||
$current_module_info = Context::get('current_module_info');
|
||||
$current_module_srl = $current_module_info->module_srl;
|
||||
if(!$current_module_srl) return new Object();
|
||||
if(!$current_module_srl) return new BaseObject();
|
||||
}
|
||||
// Get editors settings
|
||||
$oEditorModel = getModel('editor');
|
||||
|
|
@ -135,7 +135,7 @@ class editorView extends editor
|
|||
$tpl = $oTemplate->compile($this->module_path.'tpl', 'editor_module_config');
|
||||
$obj .= $tpl;
|
||||
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -104,6 +104,7 @@ var auto_saved_msg = "{$lang->msg_auto_saved}";
|
|||
fontSize_sizes: font_sizes,
|
||||
toolbarCanCollapse: true,
|
||||
allowedContent: true,
|
||||
startupFocus: {json_encode($editor_focus)},
|
||||
language: "{str_replace('jp','ja',$lang_type)}"
|
||||
},
|
||||
loadXeComponent: true,
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ class fileAdminController extends file
|
|||
{
|
||||
if ($config->allowed_filesize > 2047 || $config->allowed_attach_size > 2047)
|
||||
{
|
||||
return new Object(-1, 'msg_32bit_max_2047mb');
|
||||
return $this->setError('msg_32bit_max_2047mb');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -154,7 +154,7 @@ class fileAdminController extends file
|
|||
{
|
||||
if ($file_config->allowed_filesize > 2047 || $file_config->allowed_attach_size > 2047)
|
||||
{
|
||||
return new Object(-1, 'msg_32bit_max_2047mb');
|
||||
return $this->setError('msg_32bit_max_2047mb');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,8 +42,6 @@ class file extends ModuleObject
|
|||
$oModuleController->insertTrigger('module.deleteModule', 'file', 'controller', 'triggerDeleteModuleFiles', 'after');
|
||||
// 2007. 10. 19 Call a trigger to set up the file permissions before displaying
|
||||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'file', 'view', 'triggerDispFileAdditionSetup', 'before');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -142,8 +140,6 @@ class file extends ModuleObject
|
|||
}
|
||||
|
||||
if(!$oDB->isColumnExists('files', 'cover_image')) $oDB->addColumn('files', 'cover_image', 'char', '1', 'N');
|
||||
|
||||
return new Object(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class fileController extends file
|
|||
// Exit a session if there is neither upload permission nor information
|
||||
if(!$_SESSION['upload_info'][$editor_sequence]->enabled)
|
||||
{
|
||||
return new Object(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
// Get upload_target_srl
|
||||
|
|
@ -63,7 +63,7 @@ class fileController extends file
|
|||
$total_size = intval($matches[3]);
|
||||
if ($chunk_start < 0 || $chunk_size < 0 || $total_size < 0 || $chunk_start + $chunk_size > $total_size || $chunk_size != $file_info['size'])
|
||||
{
|
||||
return new Object(-1, 'msg_upload_invalid_chunk');
|
||||
return $this->setError('msg_upload_invalid_chunk');
|
||||
}
|
||||
$this->add('chunk_current_size', $chunk_size);
|
||||
$this->add('chunk_uploaded_size', $chunk_start);
|
||||
|
|
@ -76,13 +76,13 @@ class fileController extends file
|
|||
{
|
||||
Rhymix\Framework\Storage::delete($temp_filename);
|
||||
$this->add('chunk_status', 11);
|
||||
return new Object(-1, 'msg_upload_invalid_chunk');
|
||||
return $this->setError('msg_upload_invalid_chunk');
|
||||
}
|
||||
if ($chunk_start != 0 && (!Rhymix\Framework\Storage::isFile($temp_filename) || Rhymix\Framework\Storage::getSize($temp_filename) != $chunk_start))
|
||||
{
|
||||
Rhymix\Framework\Storage::delete($temp_filename);
|
||||
$this->add('chunk_status', 12);
|
||||
return new Object(-1, 'msg_upload_invalid_chunk');
|
||||
return $this->setError('msg_upload_invalid_chunk');
|
||||
}
|
||||
|
||||
// Check size limit
|
||||
|
|
@ -95,13 +95,13 @@ class fileController extends file
|
|||
if ($total_size > $allowed_filesize)
|
||||
{
|
||||
$this->add('chunk_status', 21);
|
||||
return new Object(-1, 'msg_exceeds_limit_size');
|
||||
return $this->setError('msg_exceeds_limit_size');
|
||||
}
|
||||
$output = executeQuery('file.getAttachedFileSize', (object)array('upload_target_srl' => $upload_target_srl));
|
||||
if (intval($output->data->attached_size) + $total_size > $allowed_attach_size)
|
||||
{
|
||||
$this->add('chunk_status', 22);
|
||||
return new Object(-1, 'msg_exceeds_limit_size');
|
||||
return $this->setError('msg_exceeds_limit_size');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -119,14 +119,14 @@ class fileController extends file
|
|||
}
|
||||
else
|
||||
{
|
||||
return new Object();
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Rhymix\Framework\Storage::delete($temp_filename);
|
||||
$this->add('chunk_status', 40);
|
||||
return new Object(-1, 'msg_upload_invalid_chunk');
|
||||
return $this->setError('msg_upload_invalid_chunk');
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -207,14 +207,14 @@ class fileController extends file
|
|||
|
||||
if(!$file_srl || !$width)
|
||||
{
|
||||
return new Object(-1,'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$oFileModel = getModel('file');
|
||||
$fileInfo = $oFileModel->getFile($file_srl);
|
||||
if(!$fileInfo || $fileInfo->direct_download != 'Y')
|
||||
{
|
||||
return new Object(-1,'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$source_src = $fileInfo->uploaded_filename;
|
||||
|
|
@ -230,7 +230,7 @@ class fileController extends file
|
|||
}
|
||||
else
|
||||
{
|
||||
return new Object(-1,'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$this->add('resized_info',$output);
|
||||
|
|
@ -271,7 +271,7 @@ class fileController extends file
|
|||
{
|
||||
$oFileModel = getModel('file');
|
||||
|
||||
if(isset($this->grant->access) && $this->grant->access !== true) return new Object(-1, 'msg_not_permitted');
|
||||
if(isset($this->grant->access) && $this->grant->access !== true) return $this->setError('msg_not_permitted');
|
||||
|
||||
$file_srl = Context::get('file_srl');
|
||||
$sid = Context::get('sid');
|
||||
|
|
@ -554,11 +554,11 @@ class fileController extends file
|
|||
*/
|
||||
function procFileGetList()
|
||||
{
|
||||
if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
|
||||
if(!Context::get('is_logged')) return $this->setError('msg_not_permitted');
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->is_admin !== 'Y' && !getModel('module')->isSiteAdmin($logged_info))
|
||||
{
|
||||
return new Object(-1,'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
$fileSrls = Context::get('file_srls');
|
||||
|
|
@ -598,12 +598,12 @@ class fileController extends file
|
|||
function triggerCheckAttached(&$obj)
|
||||
{
|
||||
$document_srl = $obj->document_srl;
|
||||
if(!$document_srl) return new Object();
|
||||
if(!$document_srl) return;
|
||||
|
||||
// Get numbers of attachments
|
||||
$oFileModel = getModel('file');
|
||||
$obj->uploaded_count = $oFileModel->getFilesCount($document_srl);
|
||||
|
||||
return new Object();
|
||||
// TODO: WTF are we doing with uploaded_count anyway?
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -615,12 +615,10 @@ class fileController extends file
|
|||
function triggerAttachFiles(&$obj)
|
||||
{
|
||||
$document_srl = $obj->document_srl;
|
||||
if(!$document_srl) return new Object();
|
||||
if(!$document_srl) return;
|
||||
|
||||
$output = $this->setFilesValid($document_srl);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -632,7 +630,7 @@ class fileController extends file
|
|||
function triggerDeleteAttached(&$obj)
|
||||
{
|
||||
$document_srl = $obj->document_srl;
|
||||
if(!$document_srl) return new Object();
|
||||
if(!$document_srl) return;
|
||||
|
||||
$output = $this->deleteFiles($document_srl);
|
||||
return $output;
|
||||
|
|
@ -647,12 +645,10 @@ class fileController extends file
|
|||
function triggerCommentCheckAttached(&$obj)
|
||||
{
|
||||
$comment_srl = $obj->comment_srl;
|
||||
if(!$comment_srl) return new Object();
|
||||
if(!$comment_srl) return;
|
||||
// Get numbers of attachments
|
||||
$oFileModel = getModel('file');
|
||||
$obj->uploaded_count = $oFileModel->getFilesCount($comment_srl);
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -665,12 +661,10 @@ class fileController extends file
|
|||
{
|
||||
$comment_srl = $obj->comment_srl;
|
||||
$uploaded_count = $obj->uploaded_count;
|
||||
if(!$comment_srl || !$uploaded_count) return new Object();
|
||||
if(!$comment_srl || !$uploaded_count) return;
|
||||
|
||||
$output = $this->setFilesValid($comment_srl);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -682,9 +676,9 @@ class fileController extends file
|
|||
function triggerCommentDeleteAttached(&$obj)
|
||||
{
|
||||
$comment_srl = $obj->comment_srl;
|
||||
if(!$comment_srl) return new Object();
|
||||
if(!$comment_srl) return;
|
||||
|
||||
if($obj->isMoveToTrash) return new Object();
|
||||
if($obj->isMoveToTrash) return;
|
||||
|
||||
$output = $this->deleteFiles($comment_srl);
|
||||
return $output;
|
||||
|
|
@ -699,7 +693,7 @@ class fileController extends file
|
|||
function triggerDeleteModuleFiles(&$obj)
|
||||
{
|
||||
$module_srl = $obj->module_srl;
|
||||
if(!$module_srl) return new Object();
|
||||
if(!$module_srl) return;
|
||||
|
||||
$oFileController = getAdminController('file');
|
||||
return $oFileController->deleteModuleFiles($module_srl);
|
||||
|
|
@ -817,13 +811,13 @@ class fileController extends file
|
|||
$allowed_filesize = $config->allowed_filesize * 1024 * 1024;
|
||||
$allowed_attach_size = $config->allowed_attach_size * 1024 * 1024;
|
||||
// An error appears if file size exceeds a limit
|
||||
if($allowed_filesize < filesize($file_info['tmp_name'])) return new Object(-1, 'msg_exceeds_limit_size');
|
||||
if($allowed_filesize < filesize($file_info['tmp_name'])) return $this->setError('msg_exceeds_limit_size');
|
||||
// Get total file size of all attachements (from DB)
|
||||
$size_args = new stdClass;
|
||||
$size_args->upload_target_srl = $upload_target_srl;
|
||||
$output = executeQuery('file.getAttachedFileSize', $size_args);
|
||||
$attached_size = (int)$output->data->attached_size + filesize($file_info['tmp_name']);
|
||||
if($attached_size > $allowed_attach_size) return new Object(-1, 'msg_exceeds_limit_size');
|
||||
if($attached_size > $allowed_attach_size) return $this->setError('msg_exceeds_limit_size');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -860,7 +854,7 @@ class fileController extends file
|
|||
// Create a directory
|
||||
if(!Rhymix\Framework\Storage::isDirectory($path) && !Rhymix\Framework\Storage::createDirectory($path))
|
||||
{
|
||||
return new Object(-1,'msg_not_permitted_create');
|
||||
return $this->setError('msg_not_permitted_create');
|
||||
}
|
||||
|
||||
// Move the file
|
||||
|
|
@ -872,7 +866,7 @@ class fileController extends file
|
|||
@copy($file_info['tmp_name'], $filename);
|
||||
if(!file_exists($filename))
|
||||
{
|
||||
return new Object(-1,'msg_file_upload_error');
|
||||
return $this->setError('msg_file_upload_error');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -882,7 +876,7 @@ class fileController extends file
|
|||
{
|
||||
if (!Rhymix\Framework\Storage::move($file_info['tmp_name'], $filename))
|
||||
{
|
||||
return new Object(-1,'msg_file_upload_error');
|
||||
return $this->setError('msg_file_upload_error');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -892,7 +886,7 @@ class fileController extends file
|
|||
{
|
||||
if(!@move_uploaded_file($file_info['tmp_name'], $filename))
|
||||
{
|
||||
return new Object(-1,'msg_file_upload_error');
|
||||
return $this->setError('msg_file_upload_error');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1033,7 +1027,7 @@ class fileController extends file
|
|||
$columnList = array('file_srl', 'uploaded_filename', 'module_srl');
|
||||
$file_list = $oFileModel->getFiles($upload_target_srl, $columnList);
|
||||
// Success returned if no attachement exists
|
||||
if(!is_array($file_list)||!count($file_list)) return new Object();
|
||||
if(!is_array($file_list)||!count($file_list)) return new BaseObject();
|
||||
|
||||
// Delete the file
|
||||
foreach ($file_list as $file)
|
||||
|
|
@ -1107,16 +1101,16 @@ class fileController extends file
|
|||
$vars = Context::getRequestVars();
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
if(!$vars->editor_sequence) return new Object(-1, 'msg_invalid_request');
|
||||
if(!$vars->editor_sequence) return $this->setError('msg_invalid_request');
|
||||
|
||||
$upload_target_srl = $_SESSION['upload_info'][$vars->editor_sequence]->upload_target_srl;
|
||||
|
||||
$oFileModel = getModel('file');
|
||||
$file_info = $oFileModel->getFile($vars->file_srl);
|
||||
|
||||
if(!$file_info) return new Object(-1, 'msg_not_founded');
|
||||
if(!$file_info) return $this->setError('msg_not_founded');
|
||||
|
||||
if(!$this->manager && !$file_info->member_srl === $logged_info->member_srl) return new Object(-1, 'msg_not_permitted');
|
||||
if(!$this->manager && !$file_info->member_srl === $logged_info->member_srl) return $this->setError('msg_not_permitted');
|
||||
|
||||
$args = new stdClass();
|
||||
$args->file_srl = $vars->file_srl;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class fileModel extends file
|
|||
$oComment = $oCommentModel->getComment($upload_target_srl);
|
||||
if($oComment->isExists() && $oComment->isSecret() && !$oComment->isGranted())
|
||||
{
|
||||
return new Object(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
$oDocument = $oDocumentModel->getDocument($oComment->get('document_srl'));
|
||||
|
|
@ -54,7 +54,7 @@ class fileModel extends file
|
|||
// document 권한 확인
|
||||
if($oDocument->isExists() && $oDocument->isSecret() && !$oDocument->isGranted())
|
||||
{
|
||||
return new Object(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
// 모듈 권한 확인
|
||||
|
|
@ -63,12 +63,12 @@ class fileModel extends file
|
|||
$grant = $oModuleModel->getGrant($oModuleModel->getModuleInfoByModuleSrl($oDocument->get('module_srl')), $logged_info);
|
||||
if(!$grant->access)
|
||||
{
|
||||
return new Object(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
}
|
||||
|
||||
$tmp_files = $this->getFiles($upload_target_srl);
|
||||
if($tmp_files instanceof Object && !$tmp_files->toBool()) return $tmp_files;
|
||||
if($tmp_files instanceof BaseObject && !$tmp_files->toBool()) return $tmp_files;
|
||||
$files = array();
|
||||
|
||||
foreach($tmp_files as $file_info)
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class fileView extends file
|
|||
* It only receives file configurations
|
||||
*
|
||||
* @param string $obj The html string of page of addition setup of module
|
||||
* @return Object
|
||||
* @return void
|
||||
*/
|
||||
function triggerDispFileAdditionSetup(&$obj)
|
||||
{
|
||||
|
|
@ -31,7 +31,7 @@ class fileView extends file
|
|||
// Get information of the current module
|
||||
$current_module_info = Context::get('current_module_info');
|
||||
$current_module_srl = $current_module_info->module_srl;
|
||||
if(!$current_module_srl) return new Object();
|
||||
if(!$current_module_srl) return;
|
||||
}
|
||||
// Get file configurations of the module
|
||||
$oFileModel = getModel('file');
|
||||
|
|
@ -46,8 +46,6 @@ class fileView extends file
|
|||
$oTemplate = &TemplateHandler::getInstance();
|
||||
$tpl = $oTemplate->compile($this->module_path.'tpl', 'file_module_config');
|
||||
$obj .= $tpl;
|
||||
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
/* End of file file.view.php */
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ class extract
|
|||
// If local file
|
||||
if(strncasecmp('http://', $this->filename, 7) !== 0)
|
||||
{
|
||||
if(!file_exists($this->filename)) return new Object(-1,'msg_no_xml_file');
|
||||
if(!file_exists($this->filename)) return $this->setError('msg_no_xml_file');
|
||||
$this->fd = fopen($this->filename,"r");
|
||||
// If remote file
|
||||
}
|
||||
|
|
@ -135,7 +135,7 @@ class extract
|
|||
if(!$url_info['path']) $url_info['path'] = '/';
|
||||
|
||||
$this->fd = @fsockopen($url_info['host'], $url_info['port']);
|
||||
if(!$this->fd) return new Object(-1,'msg_no_xml_file');
|
||||
if(!$this->fd) return $this->setError('msg_no_xml_file');
|
||||
// If the file name contains Korean, do urlencode(iconv required)
|
||||
$path = $url_info['path'];
|
||||
if(preg_match('/[\xEA-\xED][\x80-\xFF]{2}/', $path)&&function_exists('iconv'))
|
||||
|
|
@ -157,7 +157,7 @@ class extract
|
|||
$buff .= $str = fgets($this->fd, 1024);
|
||||
if(!trim($str)) break;
|
||||
}
|
||||
if(preg_match('/404 Not Found/i',$buff)) return new Object(-1,'msg_no_xml_file');
|
||||
if(preg_match('/404 Not Found/i',$buff)) return $this->setError('msg_no_xml_file');
|
||||
}
|
||||
|
||||
if($this->startTag)
|
||||
|
|
@ -181,7 +181,7 @@ class extract
|
|||
$this->isFinished = false;
|
||||
}
|
||||
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -292,12 +292,12 @@ class importerAdminController extends importer
|
|||
$this->unit_count = Context::get('unit_count');
|
||||
// Check if an index file exists
|
||||
$index_file = './files/cache/importer/'.$key.'/index';
|
||||
if(!file_exists($index_file)) return new Object(-1, 'msg_invalid_xml_file');
|
||||
if(!file_exists($index_file)) return $this->setError('msg_invalid_xml_file');
|
||||
|
||||
switch($type)
|
||||
{
|
||||
case 'ttxml' :
|
||||
if(!$target_module) return new Object(-1,'msg_invalid_request');
|
||||
if(!$target_module) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
$columnList = array('module_srl', 'module');
|
||||
|
|
@ -317,7 +317,7 @@ class importerAdminController extends importer
|
|||
break;
|
||||
case 'module' :
|
||||
// Check if the target module exists
|
||||
if(!$target_module) return new Object(-1,'msg_invalid_request');
|
||||
if(!$target_module) return $this->setError('msg_invalid_request');
|
||||
$cur = $this->importModule($key, $cur, $index_file, $target_module);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,11 +12,11 @@ class importer extends ModuleObject
|
|||
{
|
||||
/**
|
||||
* Implement if additional tasks are necessary when installing
|
||||
* @return Object
|
||||
* @return void
|
||||
*/
|
||||
function moduleInstall()
|
||||
{
|
||||
return new Object();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -30,11 +30,11 @@ class importer extends ModuleObject
|
|||
|
||||
/**
|
||||
* Execute update
|
||||
* @return Object
|
||||
* @return void
|
||||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
return new Object();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -43,6 +43,7 @@ class importer extends ModuleObject
|
|||
*/
|
||||
function recompileCache()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
/* End of file importer.class.php */
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class installAdminController extends install
|
|||
function procInstallAdminInstall()
|
||||
{
|
||||
$module_name = Context::get('module_name');
|
||||
if(!$module_name) return new object(-1, 'invalid_request');
|
||||
if(!$module_name) return $this->setError('invalid_request');
|
||||
|
||||
$oInstallController = getController('install');
|
||||
$oInstallController->installModule($module_name, './modules/'.$module_name);
|
||||
|
|
@ -35,18 +35,21 @@ class installAdminController extends install
|
|||
{
|
||||
@set_time_limit(0);
|
||||
$module_name = Context::get('module_name');
|
||||
if(!$module_name) return new object(-1, 'invalid_request');
|
||||
if(!$module_name) return $this->setError('invalid_request');
|
||||
|
||||
$oModule = getModule($module_name, 'class');
|
||||
if(!$oModule)
|
||||
{
|
||||
$output = new Object(-1, 'invalid_request');
|
||||
$output = return $this->setError('invalid_request');
|
||||
}
|
||||
|
||||
Rhymix\Framework\Session::close();
|
||||
$output = $oModule->moduleUpdate();
|
||||
Rhymix\Framework\Session::start();
|
||||
return $output;
|
||||
if($output instanceof BaseObject && !$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
function procInstallAdminRemoveFTPInfo()
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class install extends ModuleObject
|
|||
*/
|
||||
function moduleInstall()
|
||||
{
|
||||
return new Object();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -28,7 +28,7 @@ class install extends ModuleObject
|
|||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
return new Object();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ class installController extends install
|
|||
{
|
||||
if ($oDB->isTableExists($table_name))
|
||||
{
|
||||
return new Object(-1, 'msg_table_already_exists');
|
||||
return $this->setError('msg_table_already_exists');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -99,7 +99,7 @@ class installController extends install
|
|||
// Check if it is already installed
|
||||
if (Context::isInstalled())
|
||||
{
|
||||
return new Object(-1, 'msg_already_installed');
|
||||
return $this->setError('msg_already_installed');
|
||||
}
|
||||
|
||||
// Get install parameters.
|
||||
|
|
@ -227,7 +227,7 @@ class installController extends install
|
|||
catch(Exception $e)
|
||||
{
|
||||
$oDB->rollback();
|
||||
return new Object(-1, $e->getMessage());
|
||||
return $this->setError($e->getMessage());
|
||||
}
|
||||
|
||||
// Execute the install script.
|
||||
|
|
@ -264,7 +264,7 @@ class installController extends install
|
|||
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : RX_BASEURL;
|
||||
$this->setRedirectUrl($returnUrl);
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -411,7 +411,7 @@ class installController extends install
|
|||
else
|
||||
{
|
||||
FileHandler::removeFile($this->flagLicenseAgreement);
|
||||
return new Object(-1, 'msg_must_accept_license_agreement');
|
||||
return $this->setError('msg_must_accept_license_agreement');
|
||||
}
|
||||
|
||||
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
|
||||
|
|
@ -505,7 +505,7 @@ class installController extends install
|
|||
}
|
||||
}
|
||||
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -534,7 +534,7 @@ class installController extends install
|
|||
unset($oModule);
|
||||
$oModule = getClass($module);
|
||||
if(method_exists($oModule, 'moduleInstall')) $oModule->moduleInstall();
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -15,13 +15,13 @@ class installModel extends install
|
|||
$connection = ssh2_connect($ftp_info->ftp_host, $ftp_info->ftp_port);
|
||||
if(!ssh2_auth_password($connection, $ftp_info->ftp_user, $ftp_info->ftp_password))
|
||||
{
|
||||
return new Object(-1,'msg_ftp_invalid_auth_info');
|
||||
return $this->setError('msg_ftp_invalid_auth_info');
|
||||
}
|
||||
|
||||
$sftp = ssh2_sftp($connection);
|
||||
$curpwd = "ssh2.sftp://$sftp".$this->pwd;
|
||||
$dh = @opendir($curpwd);
|
||||
if(!$dh) return new Object(-1, 'msg_ftp_invalid_path');
|
||||
if(!$dh) return $this->setError('msg_ftp_invalid_path');
|
||||
|
||||
$list = array();
|
||||
while(($file = readdir($dh)) !== false)
|
||||
|
|
@ -37,7 +37,7 @@ class installModel extends install
|
|||
{
|
||||
if(!($ftp_info = Context::getRequestVars()) || !$ftp_info->ftp_user || !$ftp_info->ftp_password)
|
||||
{
|
||||
return new Object(-1, 'msg_ftp_invalid_auth_info');
|
||||
return $this->setError('msg_ftp_invalid_auth_info');
|
||||
}
|
||||
$this->pwd = $ftp_info->ftp_root_path;
|
||||
if(!$ftp_info->ftp_host)
|
||||
|
|
@ -54,11 +54,11 @@ class installModel extends install
|
|||
if(function_exists('ftp_connect'))
|
||||
{
|
||||
$connection = ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port);
|
||||
if(!$connection) return new Object(-1, sprintf(lang('msg_ftp_not_connected'), 'host'));
|
||||
if(!$connection) return $this->setError(sprintf(lang('msg_ftp_not_connected'), 'host'));
|
||||
if(! @ftp_login($connection, $ftp_info->ftp_user, $ftp_info->ftp_password))
|
||||
{
|
||||
ftp_close($connection);
|
||||
return new Object(-1,'msg_ftp_invalid_auth_info');
|
||||
return $this->setError('msg_ftp_invalid_auth_info');
|
||||
}
|
||||
|
||||
if($ftp_info->ftp_pasv != "N")
|
||||
|
|
@ -82,7 +82,7 @@ class installModel extends install
|
|||
else
|
||||
{
|
||||
$oFtp->ftp_quit();
|
||||
return new Object(-1,'msg_ftp_invalid_auth_info');
|
||||
return $this->setError('msg_ftp_invalid_auth_info');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,7 +58,6 @@ class installView extends install
|
|||
else
|
||||
{
|
||||
$this->setRedirectUrl(RX_BASEURL);
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ function __makeMenu(&$list, $parent_srl)
|
|||
}
|
||||
|
||||
$output = $oMenuAdminController->procMenuAdminInsertItem();
|
||||
if($output instanceof Object && !$output->toBool())
|
||||
if($output instanceof BaseObject && !$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@ class integration_search extends ModuleObject
|
|||
// Registered in action forward
|
||||
$oModuleController = getController('module');
|
||||
$oModuleController->insertActionForward('integration_search', 'view', 'IS');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -67,8 +65,6 @@ class integration_search extends ModuleObject
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new Object(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ class integration_searchModel extends module
|
|||
function getTrackbacks($target, $module_srls_list, $search_target = "title", $search_keyword, $page=1, $list_count = 20)
|
||||
{
|
||||
$oTrackbackModel = getAdminModel('trackback');
|
||||
if(!$oTrackbackModel) return new Object();
|
||||
if(!$oTrackbackModel) return new BaseObject();
|
||||
$args = new stdClass();
|
||||
|
||||
if(is_array($module_srls_list)) $module_srls = implode(',',$module_srls_list);
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class integration_searchView extends integration_search
|
|||
}
|
||||
|
||||
// Check permissions
|
||||
if(!$this->grant->access) return new Object(-1,'msg_not_permitted');
|
||||
if(!$this->grant->access) return $this->setError('msg_not_permitted');
|
||||
|
||||
$config = $oModuleModel->getModuleConfig('integration_search');
|
||||
if(!$config) $config = new stdClass;
|
||||
|
|
|
|||
|
|
@ -26,12 +26,7 @@ class krzip extends ModuleObject
|
|||
|
||||
function moduleInstall()
|
||||
{
|
||||
return new Object();
|
||||
}
|
||||
|
||||
function moduleUninstall()
|
||||
{
|
||||
return new Object();
|
||||
|
||||
}
|
||||
|
||||
function checkUpdate()
|
||||
|
|
@ -41,7 +36,7 @@ class krzip extends ModuleObject
|
|||
|
||||
function moduleUpdate()
|
||||
{
|
||||
return new Object();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ class krzipModel extends krzip
|
|||
$module_config = $this->getConfig();
|
||||
if($module_config->api_handler != 1)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
if(!isset($query))
|
||||
{
|
||||
|
|
@ -185,11 +185,11 @@ class krzipModel extends krzip
|
|||
}
|
||||
}
|
||||
|
||||
return new Object(-1, $err_msg);
|
||||
return $this->setError($err_msg);
|
||||
}
|
||||
if(!$result->post)
|
||||
{
|
||||
return new Object(-1, 'msg_krzip_riddling_wrong');
|
||||
return $this->setError('msg_krzip_riddling_wrong');
|
||||
}
|
||||
|
||||
$item_list = $result->post->itemlist->item;
|
||||
|
|
@ -199,7 +199,7 @@ class krzipModel extends krzip
|
|||
}
|
||||
if(!$item_list)
|
||||
{
|
||||
return new Object(-1, 'msg_krzip_no_result');
|
||||
return $this->setError('msg_krzip_no_result');
|
||||
}
|
||||
|
||||
$addr_list = array();
|
||||
|
|
@ -211,7 +211,7 @@ class krzipModel extends krzip
|
|||
$addr_list[] = $this->getMigratedPostcode('(' . $postcode . ') (' . $jibun_addr . ') ' . $road_addr);
|
||||
}
|
||||
|
||||
$output = new Object();
|
||||
$output = new BaseObject();
|
||||
$output->add('address_list', $addr_list);
|
||||
|
||||
return $output;
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ class layoutAdminController extends layout
|
|||
$output = executeQuery('menu.getMenuItemByUrl', $tmpArgs);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return new Object(-1, 'fail_to_update');
|
||||
return $this->setError('fail_to_update');
|
||||
}
|
||||
|
||||
$menu_srl = $output->data->menu_srl;
|
||||
|
|
@ -313,7 +313,7 @@ class layoutAdminController extends layout
|
|||
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return new Object(-1, $output->message);
|
||||
return $this->setError($output->message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -334,7 +334,7 @@ class layoutAdminController extends layout
|
|||
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
return new Object(0,'success_deleted');
|
||||
return new BaseObject(0,'success_deleted');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -356,7 +356,7 @@ class layoutAdminController extends layout
|
|||
|
||||
if(!$layout_srl || !$code || !$is_post)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$oLayoutModel = getModel('layout');
|
||||
|
|
@ -377,7 +377,7 @@ class layoutAdminController extends layout
|
|||
function procLayoutAdminCodeReset()
|
||||
{
|
||||
$layout_srl = Context::get('layout_srl');
|
||||
if(!$layout_srl) return new Object(-1, 'msg_invalid_request');
|
||||
if(!$layout_srl) return $this->setError('msg_invalid_request');
|
||||
|
||||
// delete user layout file
|
||||
$oLayoutModel = getModel('layout');
|
||||
|
|
@ -480,13 +480,13 @@ class layoutAdminController extends layout
|
|||
$oModuleModel = getModel('module');
|
||||
|
||||
$mid = Context::get('mid');
|
||||
if(!$mid) return new Object(-1, 'msg_invalid_request');
|
||||
if(!$mid) return $this->setError('msg_invalid_request');
|
||||
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$columnList = array('layout_srl');
|
||||
$module_info = $oModuleModel->getModuleInfoByMid($mid, $site_module_info->site_srl, $columnList);
|
||||
$layout_srl = $module_info->layout_srl;
|
||||
if(!$layout_srl) return new Object(-1, 'msg_invalid_request');
|
||||
if(!$layout_srl) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oLayoutModel = getModel('layout');
|
||||
|
||||
|
|
@ -589,7 +589,7 @@ class layoutAdminController extends layout
|
|||
function procLayoutAdminUserLayoutExport()
|
||||
{
|
||||
$layout_srl = Context::get('layout_srl');
|
||||
if(!$layout_srl) return new Object('-1','msg_invalid_request');
|
||||
if(!$layout_srl) return new BaseObject('-1','msg_invalid_request');
|
||||
|
||||
$oLayoutModel = getModel('layout');
|
||||
|
||||
|
|
|
|||
|
|
@ -295,11 +295,11 @@ class layoutAdminView extends layout
|
|||
$layout_srl = Context::get('layout_srl');
|
||||
$code = Context::get('code');
|
||||
$code_css = Context::get('code_css');
|
||||
if(!$layout_srl || !$code) return new Object(-1, 'msg_invalid_request');
|
||||
if(!$layout_srl || !$code) return $this->setError('msg_invalid_request');
|
||||
// Get the layout information
|
||||
$oLayoutModel = getModel('layout');
|
||||
$layout_info = $oLayoutModel->getLayout($layout_srl);
|
||||
if(!$layout_info) return new Object(-1, 'msg_invalid_request');
|
||||
if(!$layout_info) return $this->setError('msg_invalid_request');
|
||||
// Separately handle the layout if its type is faceoff
|
||||
if($layout_info && $layout_info->type == 'faceoff') $oLayoutModel->doActivateFaceOff($layout_info);
|
||||
// Apply CSS directly
|
||||
|
|
|
|||
|
|
@ -15,8 +15,6 @@ class layout extends ModuleObject
|
|||
{
|
||||
// Create a directory to be used in the layout
|
||||
FileHandler::makeDir('./files/cache/layout');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -104,7 +102,6 @@ class layout extends ModuleObject
|
|||
}
|
||||
}
|
||||
}
|
||||
return new Object(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -318,8 +318,7 @@ class layoutView extends layout
|
|||
{
|
||||
if(!checkCSRF())
|
||||
{
|
||||
$this->stop('msg_invalid_request');
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// admin check
|
||||
|
|
@ -331,11 +330,11 @@ class layoutView extends layout
|
|||
$code = Context::get('code');
|
||||
|
||||
$code_css = Context::get('code_css');
|
||||
if(!$layout_srl || !$code) return new Object(-1, 'msg_invalid_request');
|
||||
if(!$layout_srl || !$code) return $this->setError('msg_invalid_request');
|
||||
// Get the layout information
|
||||
$oLayoutModel = getModel('layout');
|
||||
$layout_info = $oLayoutModel->getLayout($layout_srl);
|
||||
if(!$layout_info) return new Object(-1, 'msg_invalid_request');
|
||||
if(!$layout_info) return $this->setError('msg_invalid_request');
|
||||
// Separately handle the layout if its type is faceoff
|
||||
if($layout_info && $layout_info->type == 'faceoff') $oLayoutModel->doActivateFaceOff($layout_info);
|
||||
// Apply CSS directly
|
||||
|
|
|
|||
|
|
@ -62,6 +62,8 @@
|
|||
<action name="dispMemberAdminInsert" type="view" menu_name="userList" />
|
||||
<action name="dispMemberAdminConfig" type="view" menu_name="userSetting" menu_index="true" />
|
||||
<action name="dispMemberAdminFeaturesConfig" type="view" menu_name="userSetting" />
|
||||
<action name="dispMemberAdminAgreementsConfig" type="view" menu_name="userSetting" />
|
||||
<action name="dispMemberAdminAgreementsEdit" type="view" menu_name="userSetting" />
|
||||
<action name="dispMemberAdminSignUpConfig" type="view" menu_name="userSetting" />
|
||||
<action name="dispMemberAdminLoginConfig" type="view" menu_name="userSetting" />
|
||||
<action name="dispMemberAdminDesignConfig" type="view" menu_name="userSetting" />
|
||||
|
|
@ -78,6 +80,7 @@
|
|||
<action name="procMemberAdminSelectedMemberManage" type="controller" ruleset="updateSeletecdMemberInfo" />
|
||||
<action name="procMemberAdminInsertDefaultConfig" type="controller" ruleset="insertDefaultConfig" />
|
||||
<action name="procMemberAdminInsertFeaturesConfig" type="controller" />
|
||||
<action name="procMemberAdminInsertAgreementsConfig" type="controller" />
|
||||
<action name="procMemberAdminInsertSignupConfig" type="controller" />
|
||||
<action name="procMemberAdminInsertLoginConfig" type="controller" />
|
||||
<action name="procMemberAdminInsertDesignConfig" type="controller" />
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ $lang->member = 'Member';
|
|||
$lang->site = 'Site';
|
||||
$lang->member_default_config = 'Basic Settings';
|
||||
$lang->member_features_config = 'Features';
|
||||
$lang->member_agreements_config = 'Terms of Service';
|
||||
$lang->member_default_info = 'Basic Info';
|
||||
$lang->member_extend_info = 'Additional Info';
|
||||
$lang->default_group_1 = 'Associate Member';
|
||||
|
|
@ -158,7 +159,7 @@ $lang->msg_not_uploaded_profile_image = 'Profile image could not be registered.'
|
|||
$lang->msg_not_uploaded_image_name = 'Image name could not be registered.';
|
||||
$lang->msg_not_uploaded_image_mark = 'Image mark could not be registered.';
|
||||
$lang->msg_not_uploaded_group_image_mark = 'Group image mark could not be registered.';
|
||||
$lang->msg_accept_agreement = 'You have to accept the agreement.';
|
||||
$lang->msg_accept_agreement = 'You must accept all required agreements in order to sign up.';
|
||||
$lang->msg_user_denied = 'You have entered a prohibited ID.';
|
||||
$lang->msg_user_not_confirmed = 'Your account is not activated yet. Please check your email.';
|
||||
$lang->msg_user_limited = 'You have entered an ID that cannot be used before %s';
|
||||
|
|
@ -216,7 +217,7 @@ $lang->about_image_mark = 'Members will be able to use image mark in front of th
|
|||
$lang->about_group_image_mark = 'You may use group marks shown before their names';
|
||||
$lang->about_profile_image = 'Members will be able to use profile images';
|
||||
$lang->about_signature_max_height = 'You can limit the signature max height. Set this as 0 or leave it blank not to limit it.';
|
||||
$lang->about_accept_agreement = 'I have read the agreement and agree with it';
|
||||
$lang->about_accept_agreement = 'I have read the above and agree with it.';
|
||||
$lang->about_member_default = 'It will be set as the default group on sign up';
|
||||
$lang->about_find_member_account = 'Please input the email address you have entered during the registration and we will send your account info to this email address.';
|
||||
$lang->about_ssl_port = 'Please enter if you are using non-default SSL port';
|
||||
|
|
@ -257,8 +258,12 @@ $lang->about_change_user_group = 'Resets the selected group of memebers.';
|
|||
$lang->about_send_message = 'Send a message to the member about this. If you don\'t write a message, it is not sent.';
|
||||
$lang->cmd_allowed = 'Allowed';
|
||||
$lang->cmd_prohibited = 'Prohibited';
|
||||
$lang->cmd_agreement_title = 'Title';
|
||||
$lang->cmd_agreement_content = 'Content';
|
||||
$lang->cmd_agreement_type = 'Agreement required';
|
||||
$lang->cmd_required = 'Required';
|
||||
$lang->cmd_optional = 'Optional';
|
||||
$lang->cmd_disabled = 'Disabled';
|
||||
$lang->cmd_image_max_width = 'Max Width';
|
||||
$lang->cmd_image_max_height = 'Max Height';
|
||||
$lang->cmd_input_extend_form = 'User Defined Input';
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ $lang->member = '회원';
|
|||
$lang->site = '사이트';
|
||||
$lang->member_default_config = '기본 설정';
|
||||
$lang->member_features_config = '기능 설정';
|
||||
$lang->member_agreements_config = '약관 설정';
|
||||
$lang->member_default_info = '기본 정보';
|
||||
$lang->member_extend_info = '추가 정보';
|
||||
$lang->default_group_1 = '준회원';
|
||||
|
|
@ -166,7 +167,7 @@ $lang->msg_not_uploaded_profile_image = '프로필 이미지를 등록할 수
|
|||
$lang->msg_not_uploaded_image_name = '이미지 이름을 등록할 수 없습니다.';
|
||||
$lang->msg_not_uploaded_image_mark = '이미지 마크를 등록할 수 없습니다.';
|
||||
$lang->msg_not_uploaded_group_image_mark = '그룹 이미지 마크를 등록할 수 없습니다.';
|
||||
$lang->msg_accept_agreement = '약관에 동의해야 합니다.';
|
||||
$lang->msg_accept_agreement = '필수 약관에 모두 동의해야 가입하실 수 있습니다.';
|
||||
$lang->msg_user_denied = '입력한 아이디의 사용이 중지 되었습니다.';
|
||||
$lang->msg_user_not_confirmed = '아직 메일 인증이 이루어지지 않았습니다. 메일을 확인해 주세요.';
|
||||
$lang->msg_user_limited = '입력한 아이디는 %s 까지 사용하실 수 없습니다.';
|
||||
|
|
@ -224,7 +225,7 @@ $lang->about_image_mark = '회원의 이름 앞에 마크를 달 수 있습니
|
|||
$lang->about_group_image_mark = '회원의 이름 앞에 그룹 마크를 달 수 있습니다.';
|
||||
$lang->about_profile_image = '회원의 프로필 이미지를 사용할 수 있게 합니다.';
|
||||
$lang->about_signature_max_height = '서명란의 최대 높이를 제한할 수 있습니다. (0 또는 비워두면 제한하지 않습니다.)';
|
||||
$lang->about_accept_agreement = '약관을 모두 읽었으며 동의합니다.';
|
||||
$lang->about_accept_agreement = '위의 내용을 모두 읽었으며 동의합니다.';
|
||||
$lang->about_member_default = '회원 가입을 한 사람이 최초에 속하는 그룹을 말합니다.';
|
||||
$lang->about_find_member_account = '아이디/비밀번호는 가입시 등록한 메일 주소로 알려드립니다. 가입할 때 등록한 메일 주소를 입력하고 "ID/PW 찾기" 버튼을 클릭해주세요.<br />';
|
||||
$lang->about_temp_password = '임시 비밀번호가 정상적으로 발급되었습니다.<br />로그인 후 반드시 비밀번호를 변경하세요.<br />';
|
||||
|
|
@ -271,8 +272,12 @@ $lang->about_change_user_group = '선택한 회원의 그룹을 다시 설정.';
|
|||
$lang->about_send_message = '회원에게 쪽지를 발송해서 이 사실을 알립니다. 작성하지 않으면 발송하지 않습니다.';
|
||||
$lang->cmd_allowed = '허가';
|
||||
$lang->cmd_prohibited = '제한';
|
||||
$lang->cmd_agreement_title = '약관 제목';
|
||||
$lang->cmd_agreement_content = '약관 내용';
|
||||
$lang->cmd_agreement_type = '동의 필수 여부';
|
||||
$lang->cmd_required = '필수';
|
||||
$lang->cmd_optional = '선택';
|
||||
$lang->cmd_disabled = '사용 안 함';
|
||||
$lang->cmd_image_max_width = '너비 제한';
|
||||
$lang->cmd_image_max_height = '높이 제한';
|
||||
$lang->cmd_input_extend_form = '회원 정의 입력';
|
||||
|
|
|
|||
|
|
@ -1,9 +1,3 @@
|
|||
{@ Context::loadFile(array("./common/js/jquery.js", 'head', '', -100000), true) }
|
||||
{@ Context::loadFile(array("./common/js/js_app.js", 'head', '', -100000), true) }
|
||||
{@ Context::loadFile(array("./common/js/common.js", 'head', '', -100000), true) }
|
||||
{@ Context::loadFile(array("./common/js/xml_handler.js", 'head', '', -100000), true) }
|
||||
{@ Context::loadFile(array("./common/js/xml_js_filter.js", 'head', '', -100000), true) }
|
||||
|
||||
<load target="../../tpl/js/signup_check.js" />
|
||||
<load target="../../tpl/js/member_admin.js" />
|
||||
<load target="css/msignup.css" />
|
||||
|
|
|
|||
|
|
@ -14,17 +14,22 @@
|
|||
<input type="hidden" name="act" value="procMemberInsert" />
|
||||
<input type="hidden" name="xe_validator_id" value="modules/member/skins/default/modify_info/1" />
|
||||
<input type="hidden" name="success_return_url" value="{getUrl('act','dispMemberInfo')}" />
|
||||
<!--@if(!$is_logged && $member_config->agreement)-->
|
||||
<div class="agreement">
|
||||
<div class="agreement" loop="$member_config->agreements => $i, $agreement" cond="$agreement->type !== 'disabled'">
|
||||
<div class="title">
|
||||
{$agreement->title}
|
||||
<block cond="$agreement->type === 'required'">({$lang->cmd_required})</block>
|
||||
<block cond="$agreement->type === 'optional'">({$lang->cmd_optional})</block>
|
||||
</div>
|
||||
<div class="text">
|
||||
{$member_config->agreement}
|
||||
{$agreement->content}
|
||||
</div>
|
||||
<div class="confirm">
|
||||
<input type="checkbox" name="accept_agreement" value="Y" id="accept_agree" />
|
||||
<label for="accept_agree">{$lang->about_accept_agreement}</label>
|
||||
<label for="accept_agreement_{$i}">
|
||||
<input type="checkbox" name="accept_agreement[{$i}]" value="Y" id="accept_agreement_{$i}" />
|
||||
{$lang->about_accept_agreement}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<!--@end-->
|
||||
<ul>
|
||||
<li>
|
||||
<label for="{$identifierForm->name}">{$identifierForm->title} <em style="color:red">*</em></label>
|
||||
|
|
|
|||
|
|
@ -17,13 +17,18 @@
|
|||
<input type="hidden" name="act" value="procMemberInsert" />
|
||||
<input type="hidden" name="xe_validator_id" value="modules/member/skins" />
|
||||
<input type="hidden" name="success_return_url" value="{getUrl('act','dispMemberInfo')}" />
|
||||
<div class="agreement" cond="$member_config->agreement">
|
||||
<div class="agreement" loop="$member_config->agreements => $i, $agreement" cond="$agreement->type !== 'disabled'">
|
||||
<div class="title">
|
||||
{$agreement->title}
|
||||
<block cond="$agreement->type === 'required'">({$lang->cmd_required})</block>
|
||||
<block cond="$agreement->type === 'optional'">({$lang->cmd_optional})</block>
|
||||
</div>
|
||||
<div class="text">
|
||||
{$member_config->agreement}
|
||||
{$agreement->content}
|
||||
</div>
|
||||
<div class="confirm">
|
||||
<label for="accept_agree">
|
||||
<input type="checkbox" name="accept_agreement" value="Y" id="accept_agree" />
|
||||
<label for="accept_agreement_{$i}">
|
||||
<input type="checkbox" name="accept_agreement[{$i}]" value="Y" id="accept_agreement_{$i}" />
|
||||
{$lang->about_accept_agreement}
|
||||
</label>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class memberAdminController extends member
|
|||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->is_admin != 'Y' || !checkCSRF())
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$args = Context::gets('member_srl','email_address','find_account_answer', 'allow_mailing','allow_message','denied','is_admin','description','group_srl_list','limit_date');
|
||||
|
|
@ -244,6 +244,41 @@ class memberAdminController extends member
|
|||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminFeaturesConfig');
|
||||
$this->setRedirectUrl($returnUrl);
|
||||
}
|
||||
|
||||
public function procMemberAdminInsertAgreementsConfig()
|
||||
{
|
||||
$config = new stdClass;
|
||||
$config->agreements = array();
|
||||
|
||||
$args = Context::getRequestVars();
|
||||
for ($i = 1; $i < 20; $i++)
|
||||
{
|
||||
if (isset($args->{'agreement_' . $i . '_type'}))
|
||||
{
|
||||
$agreement = new stdClass;
|
||||
$agreement->title = escape(utf8_trim($args->{'agreement_' . $i . '_title'}));
|
||||
$agreement->content = $args->{'agreement_' . $i . '_content'};
|
||||
$agreement->type = $args->{'agreement_' . $i . '_type'};
|
||||
if (!in_array($agreement->type, array('required', 'optional', 'disabled')))
|
||||
{
|
||||
$agreement->type = 'disabled';
|
||||
}
|
||||
$config->agreements[$i] = $agreement;
|
||||
}
|
||||
}
|
||||
|
||||
// for compatibility with older versions
|
||||
$config->agreement = $config->agreements[1]->content;
|
||||
|
||||
$oModuleController = getController('module');
|
||||
$output = $oModuleController->updateModuleConfig('member', $config);
|
||||
|
||||
// default setting end
|
||||
$this->setMessage('success_updated');
|
||||
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminAgreementsConfig');
|
||||
$this->setRedirectUrl($returnUrl);
|
||||
}
|
||||
|
||||
public function procMemberAdminInsertSignupConfig()
|
||||
{
|
||||
|
|
@ -254,7 +289,6 @@ class memberAdminController extends member
|
|||
'limit_day',
|
||||
'limit_day_description',
|
||||
'emailhost_check',
|
||||
'agreement',
|
||||
'redirect_url',
|
||||
'profile_image', 'profile_image_max_width', 'profile_image_max_height',
|
||||
'image_name', 'image_name_max_width', 'image_name_max_height',
|
||||
|
|
@ -268,12 +302,6 @@ class memberAdminController extends member
|
|||
|
||||
$args->limit_day = (int)$args->limit_day;
|
||||
if($args->emailhost_check != 'allowed' && $args->emailhost_check != 'prohibited') $args->emailhost_check == 'allowed';
|
||||
if(!trim(strip_tags($args->agreement)))
|
||||
{
|
||||
$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt';
|
||||
FileHandler::removeFile($agreement_file);
|
||||
$args->agreement = NULL;
|
||||
}
|
||||
|
||||
if($args->redirect_url)
|
||||
{
|
||||
|
|
@ -282,7 +310,7 @@ class memberAdminController extends member
|
|||
|
||||
if(!$redirectModuleInfo)
|
||||
{
|
||||
return new Object('-1', 'msg_exist_selected_module');
|
||||
return new BaseObject('-1', 'msg_exist_selected_module');
|
||||
}
|
||||
|
||||
$args->redirect_mid = $redirectModuleInfo->mid;
|
||||
|
|
@ -353,18 +381,9 @@ class memberAdminController extends member
|
|||
$args->signupForm = $signupForm;
|
||||
|
||||
// create Ruleset
|
||||
$this->_createSignupRuleset($signupForm, $args->agreement);
|
||||
$this->_createSignupRuleset($signupForm);
|
||||
$this->_createLoginRuleset($args->identifier);
|
||||
|
||||
// check agreement value exist
|
||||
if($args->agreement)
|
||||
{
|
||||
$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt';
|
||||
$output = FileHandler::writeFile($agreement_file, $args->agreement);
|
||||
|
||||
unset($args->agreement);
|
||||
}
|
||||
|
||||
$output = $oModuleController->updateModuleConfig('member', $args);
|
||||
|
||||
// default setting end
|
||||
|
|
@ -473,7 +492,7 @@ class memberAdminController extends member
|
|||
$signupItem->required = in_array($key, $orgRequireds);
|
||||
$signupItem->isUse = ($config->{$key} == 'Y') || in_array($key, $orgUse);
|
||||
$signupItem->isPublic = ($signupItem->isUse) ? 'Y' : 'N';
|
||||
if($key == 'password')
|
||||
if(in_array($key, array('find_account_question', 'password', 'email_address')))
|
||||
{
|
||||
$signupItem->isPublic = 'N';
|
||||
}
|
||||
|
|
@ -517,10 +536,9 @@ class memberAdminController extends member
|
|||
/**
|
||||
* Create ruleset file of signup
|
||||
* @param object $signupForm (user define signup form)
|
||||
* @param string $agreement
|
||||
* @return void
|
||||
*/
|
||||
function _createSignupRuleset($signupForm, $agreement = null){
|
||||
function _createSignupRuleset($signupForm){
|
||||
$xml_file = './files/ruleset/insertMember.xml';
|
||||
$buff = '<?xml version="1.0" encoding="utf-8"?>' . PHP_EOL.
|
||||
'<ruleset version="1.5.0">' . PHP_EOL.
|
||||
|
|
@ -531,10 +549,6 @@ class memberAdminController extends member
|
|||
|
||||
$fields = array();
|
||||
|
||||
if ($agreement)
|
||||
{
|
||||
$fields[] = '<field name="accept_agreement"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /></field>';
|
||||
}
|
||||
foreach($signupForm as $formInfo)
|
||||
{
|
||||
if($formInfo->required || $formInfo->mustRequired)
|
||||
|
|
@ -715,7 +729,7 @@ class memberAdminController extends member
|
|||
// Check ID duplicated
|
||||
if (Context::isReservedWord($args->column_name))
|
||||
{
|
||||
return new Object(-1, 'msg_column_id_not_available');
|
||||
return $this->setError('msg_column_id_not_available');
|
||||
}
|
||||
$oMemberModel = getModel('member');
|
||||
$config = $oMemberModel->getMemberConfig();
|
||||
|
|
@ -724,7 +738,7 @@ class memberAdminController extends member
|
|||
if($item->name == $args->column_name)
|
||||
{
|
||||
if($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) continue;
|
||||
return new Object(-1,'msg_column_id_not_available');
|
||||
return $this->setError('msg_column_id_not_available');
|
||||
}
|
||||
}
|
||||
// Fix if member_join_form_srl exists. Add if not exists.
|
||||
|
|
@ -935,7 +949,7 @@ class memberAdminController extends member
|
|||
function procMemberAdminDeleteMembers()
|
||||
{
|
||||
$target_member_srls = Context::get('target_member_srls');
|
||||
if(!$target_member_srls) return new Object(-1, 'msg_invalid_request');
|
||||
if(!$target_member_srls) return $this->setError('msg_invalid_request');
|
||||
$member_srls = explode(',', $target_member_srls);
|
||||
$oMemberController = getController('member');
|
||||
|
||||
|
|
@ -959,7 +973,7 @@ class memberAdminController extends member
|
|||
function procMemberAdminUpdateMembersGroup()
|
||||
{
|
||||
$member_srl = Context::get('member_srl');
|
||||
if(!$member_srl) return new Object(-1,'msg_invalid_request');
|
||||
if(!$member_srl) return $this->setError('msg_invalid_request');
|
||||
$member_srls = explode(',',$member_srl);
|
||||
|
||||
$group_srl = Context::get('group_srls');
|
||||
|
|
@ -1232,7 +1246,7 @@ class memberAdminController extends member
|
|||
function updateGroup($args)
|
||||
{
|
||||
if(!$args->site_srl) $args->site_srl = 0;
|
||||
if(!$args->group_srl) return new Object(-1, 'lang->msg_not_founded');
|
||||
if(!$args->group_srl) return $this->setError('lang->msg_not_founded');
|
||||
|
||||
// Call trigger (before)
|
||||
$trigger_output = ModuleHandler::triggerCall('member.updateGroup', 'before', $args);
|
||||
|
|
@ -1276,8 +1290,8 @@ class memberAdminController extends member
|
|||
$columnList = array('group_srl', 'is_default');
|
||||
$group_info = $oMemberModel->getGroup($group_srl, $columnList);
|
||||
|
||||
if(!$group_info) return new Object(-1, 'lang->msg_not_founded');
|
||||
if($group_info->is_default == 'Y') return new Object(-1, 'msg_not_delete_default');
|
||||
if(!$group_info) return $this->setError('lang->msg_not_founded');
|
||||
if($group_info->is_default == 'Y') return $this->setError('msg_not_delete_default');
|
||||
|
||||
// Call trigger (before)
|
||||
$trigger_output = ModuleHandler::triggerCall('member.deleteGroup', 'before', $group_info);
|
||||
|
|
@ -1510,7 +1524,7 @@ class memberAdminController extends member
|
|||
// Get a list of all join forms
|
||||
$join_form_list = $oMemberModel->getJoinFormList();
|
||||
$join_form_srl_list = array_keys($join_form_list);
|
||||
if(count($join_form_srl_list)<2) return new Object();
|
||||
if(count($join_form_srl_list)<2) return new BaseObject();
|
||||
|
||||
$prev_member_join_form = NULL;
|
||||
foreach($join_form_list as $key => $val)
|
||||
|
|
@ -1519,7 +1533,7 @@ class memberAdminController extends member
|
|||
$prev_member_join_form = $val;
|
||||
}
|
||||
// Return if no previous join form exists
|
||||
if(!$prev_member_join_form) return new Object();
|
||||
if(!$prev_member_join_form) return new BaseObject();
|
||||
// Information of the join form
|
||||
$cur_args = new stdClass;
|
||||
$cur_args->member_join_form_srl = $member_join_form_srl;
|
||||
|
|
@ -1535,7 +1549,7 @@ class memberAdminController extends member
|
|||
executeQuery('member.updateMemberJoinFormListorder', $prev_args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1557,7 +1571,7 @@ class memberAdminController extends member
|
|||
// Get information of all join forms
|
||||
$join_form_list = $oMemberModel->getJoinFormList();
|
||||
$join_form_srl_list = array_keys($join_form_list);
|
||||
if(count($join_form_srl_list)<2) return new Object();
|
||||
if(count($join_form_srl_list)<2) return new BaseObject();
|
||||
|
||||
for($i=0;$i<count($join_form_srl_list);$i++)
|
||||
{
|
||||
|
|
@ -1566,7 +1580,7 @@ class memberAdminController extends member
|
|||
|
||||
$next_member_join_form_srl = $join_form_srl_list[$i+1];
|
||||
// Return if no previous join form exists
|
||||
if(!$next_member_join_form_srl) return new Object();
|
||||
if(!$next_member_join_form_srl) return new BaseObject();
|
||||
$next_member_join_form = $join_form_list[$next_member_join_form_srl];
|
||||
// Information of the join form
|
||||
$cur_args = new stdClass;
|
||||
|
|
@ -1583,7 +1597,7 @@ class memberAdminController extends member
|
|||
$output = executeQuery('member.updateMemberJoinFormListorder', $next_args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
return new Object();
|
||||
return new BaseObject();
|
||||
}
|
||||
}
|
||||
/* End of file member.admin.controller.php */
|
||||
|
|
|
|||
|
|
@ -147,6 +147,47 @@ class memberAdminView extends member
|
|||
$this->setTemplateFile('features_config');
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the agreements config.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function dispMemberAdminAgreementsConfig()
|
||||
{
|
||||
$this->setTemplateFile('agreements_config');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the agreements edit form.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function dispMemberAdminAgreementsEdit()
|
||||
{
|
||||
// Check parent input ID
|
||||
$parent_input_id = Context::get('parent_input_id');
|
||||
Context::addBodyClass('disable_debug_panel');
|
||||
|
||||
// Load editor
|
||||
$oEditorModel = getModel('editor');
|
||||
$option = $oEditorModel->getEditorConfig();
|
||||
$option->primary_key_name = 'primary_key';
|
||||
$option->content_key_name = 'content';
|
||||
$option->allow_fileupload = FALSE;
|
||||
$option->enable_autosave = FALSE;
|
||||
$option->enable_default_component = TRUE;
|
||||
$option->enable_component = FALSE;
|
||||
$option->height = 300;
|
||||
$option->editor_focus = 'Y';
|
||||
$editor = $oEditorModel->getEditor(0, $option);
|
||||
Context::set('editor', $editor);
|
||||
|
||||
// Set template
|
||||
$this->setLayoutPath('./common/tpl/');
|
||||
$this->setLayoutFile("default_layout");
|
||||
$this->setTemplateFile('agreements_edit');
|
||||
}
|
||||
|
||||
public function dispMemberAdminSignUpConfig()
|
||||
{
|
||||
$config = $this->memberConfig;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue