This repository has been archived by the owner on Jul 19, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathseo.admin.controller.php
75 lines (64 loc) · 2.19 KB
/
seo.admin.controller.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
class seoAdminController extends seo
{
function procSeoAdminSaveSetting()
{
$oModuleController = getController('module');
$vars = Context::getRequestVars();
$config = $this->getConfig();
if ($vars->setting_section == 'general') {
// 기본 설정
$config->enable = ($vars->enable === 'Y') ? 'Y' : 'N';
$config->use_optimize_title = $vars->use_optimize_title;
$config->site_name = $vars->site_name;
$config->site_slogan = $vars->site_slogan;
$config->site_description = $vars->site_description;
$config->site_keywords = $vars->site_keywords;
if ($vars->site_image) {
$path = _DAOL_PATH_ . 'files/attach/site_image/';
$ext = strtolower(array_pop(explode('.', $vars->site_image['name'])));
$timestamp = time();
$filename = "site_image.{$timestamp}.{$ext}";
FileHandler::copyFile($vars->site_image['tmp_name'], $path . $filename);
$config->site_image = $filename;
$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
if($oCacheHandler->isSupport()) {
list($width, $height) = @getimagesize($path . $filename);
$site_image_dimension = array(
'width' => $width,
'height' => $height
);
$cache_key = 'seo:site_image';
$oCacheHandler->put($cache_key, $site_image_dimension);
}
}
} elseif ($vars->setting_section == 'analytics') {
// analytics
// Google
$config->ga_id = trim($vars->ga_id);
$config->ga_except_admin = $vars->ga_except_admin;
// Naver
$config->na_id = trim($vars->na_id);
$config->na_except_admin = $vars->na_except_admin;
} elseif ($vars->setting_section == 'miscellaneous') {
// miscellaneous
// Facebook
$config->fb_app_id = trim($vars->fb_app_id);
$config->fb_admins = trim($vars->fb_admins);
}
$config->site_image_url = NULL;
$oModuleController->updateModuleConfig('seo', $config);
if($config->enable === 'Y') {
$this->moduleUpdate();
} else {
// Delete Triggers
$oModuleController = getController('module');
$oModuleController->deleteModuleTriggers('seo');
}
$this->setMessage('success_updated');
if (Context::get('success_return_url')) {
$this->setRedirectUrl(Context::get('success_return_url'));
}
}
}
/* !End of file */