Skip to content

Commit

Permalink
v 0.2.2 r4
Browse files Browse the repository at this point in the history
strict 모드 호환화
  • Loading branch information
Prev committed Jul 21, 2013
1 parent e0df90c commit 9abaaa2
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 15 deletions.
4 changes: 3 additions & 1 deletion config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

function getDBInfo() {
$dt = debug_backtrace();
if ((ROOT_DIR . DIRECTORY_SEPARATOR . 'index.php' != $dt[0]['file']) && (SSO_DIR . DIRECTORY_SEPARATOR . 'conf.database.php' != $dt[0]['file']) ) {
$allow = (defined('ROOT_DIR') && ROOT_DIR . DIRECTORY_SEPARATOR . 'index.php' == $dt[0]['file']) ||
(defined('SSO_DIR') && SSO_DIR . DIRECTORY_SEPARATOR . 'conf.database.php' == $dt[0]['file']);
if (!$allow) {
if (class_exists(Context))
Context::printWarning('SandBox error : call getDBInfo in other file');
else
Expand Down
9 changes: 5 additions & 4 deletions lib/classes/Context.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,16 @@ static function getMenu($level) {
}

static $topMenus;
if ($selectedMenuData->level == 1) $topMenus = array($selectedMenuData->id);
else if (!$topMenus) $topMenus = explode(',', self::getParentMenus($selectedMenuData->id));
if ($selectedMenuData !== false) {
if ($selectedMenuData->level == 1) $topMenus = array($selectedMenuData->id);
else if (!$topMenus) $topMenus = explode(',', self::getParentMenus($selectedMenuData->id));
}

for ($i=0; $i<count($arr); $i++) {
$arr[$i] = $arr[$i]->getData();
$arr[$i]->className = 'pmc-menu' . $level . '-' . $arr[$i]->title;

if (array_search($arr[$i]->id, $topMenus) !== false) {
if (isset($topMenus) && array_search($arr[$i]->id, $topMenus) !== false) {
$arr[$i]->selected = true;
$arr[$i]->className .= ' pmc-menu' . $level . '-selected';
}
Expand Down Expand Up @@ -461,7 +463,6 @@ public function checkSSO() {
}

$ssoData = json_decode($urlData);

if (!$ssoData || $ssoData->result === 'fail') {
Context::printErrorPage(array(
'en' => 'fail loading sso data',
Expand Down
7 changes: 1 addition & 6 deletions modules/page/PageView.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ public function dispDefault() {
}

private function loadPage($page) {
CacheHandler::execTemplate(
(substr($templateName, 0, 1) == '/') ?
ROOT_DIR . $templateName :
$this->model->getPagePath($page)
, $this->module);

CacheHandler::execTemplate($this->model->getPagePath($page), $this->module);
}

}
2 changes: 1 addition & 1 deletion modules/page/pages/about/about.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ul>
{@ foreach(Context::getMenu(2) as $key => $menu): }
<li class="{$menu->className}">
<condition do="$menu->selected">*</condition>
<condition do="isset($menu->selected)">*</condition>
<a href="/{@ if (!USE_SHORT_URL) echo '?menu='; }{$menu->title}" class="no-deco">{$menu->title_locale}</a>
</li>
{@ endforeach; }
Expand Down
2 changes: 1 addition & 1 deletion modules/page/pages/counter/counter.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ul>
{@ foreach(Context::getMenu(2) as $key => $menu): }
<li class="{$menu->className}">
<condition do="$menu->selected">*</condition>
<condition do="isset($menu->selected)">*</condition>
<a href="/{@ if (!USE_SHORT_URL) echo '?menu='; }{$menu->title}" class="no-deco">{$menu->title_locale}</a>
</li>
{@ endforeach; }
Expand Down
2 changes: 1 addition & 1 deletion modules/page/pages/others/others.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ul>
{@ foreach(Context::getMenu(2) as $key => $menu): }
<li class="{$menu->className}">
<condition do="$menu->selected">*</condition>
<condition do="isset($menu->selected)">*</condition>
<a href="/{@ if (!USE_SHORT_URL) echo '?menu='; }{$menu->title}" class="no-deco">{$menu->title_locale}</a>
</li>
{@ endforeach; }
Expand Down
2 changes: 1 addition & 1 deletion sso-server/conf.functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function execQuery($query) {
}

function execQueryOne($query) {
$result = execQuery($query, $fetchType);
$result = execQuery($query);
if (is_array($result) && count($result) !== 0)
return $result[0];
else
Expand Down

0 comments on commit 9abaaa2

Please sign in to comment.