function CT_Start_Default($target) { importlib("model.blog.attachment"); $context = Model_Context::getInstance(); $blogURL = $context->getProperty('uri.blog'); $blogid = $context->getProperty('blog.id'); $target .= '<ul>'; $target .= '<li><a href="' . $blogURL . '/owner/entry/post">' . _t('새 글을 씁니다') . '</a></li>' . CRLF; $latestEntryId = Setting::getBlogSettingGlobal('LatestEditedEntry_user' . getUserId(), 0); if ($latestEntryId !== 0) { $latestEntry = CT_Start_Default_getEntry($blogid, $latestEntryId); if ($latestEntry != false) { $target .= '<li><a href="' . $blogURL . '/owner/entry/edit/' . $latestEntry['id'] . '">' . _f('최근글(%1) 수정', htmlspecialchars(Utils_Unicode::lessenAsEm($latestEntry['title'], 10))) . '</a></li>'; } } if (Acl::check('group.administrators')) { $target .= '<li><a href="' . $blogURL . '/owner/skin">' . _t('스킨을 변경합니다') . '</a></li>' . CRLF; $target .= '<li><a href="' . $blogURL . '/owner/skin/sidebar">' . _t('사이드바 구성을 변경합니다') . '</a></li>' . CRLF; $target .= '<li><a href="' . $blogURL . '/owner/skin/setting">' . _t('블로그에 표시되는 값들을 변경합니다') . '</a></li>' . CRLF; $target .= '<li><a href="' . $blogURL . '/owner/entry/category">' . _t('카테고리를 변경합니다') . '</a></li>' . CRLF; $target .= '<li><a href="' . $blogURL . '/owner/plugin">' . _t('플러그인을 켜거나 끕니다') . '</a></li>' . CRLF; } if ($context->getProperty('service.reader', false) != false) { $target .= '<li><a href="' . $blogURL . '/owner/network/reader">' . _t('RSS 리더를 봅니다') . '</a></li>' . CRLF; } $target .= '</ul>'; return $target; }
function CT_Start_Default($target) { requireModel("blog.attachment"); requireComponent("Eolin.PHP.Core"); requireComponent("Textcube.Function.misc"); global $blogid, $blogURL, $database, $service; $target .= '<ul>'; $target .= '<li><a href="' . $blogURL . '/owner/entry/post">' . _t('새 글을 씁니다') . '</a></li>' . CRLF; $latestEntryId = Setting::getBlogSettingGlobal('LatestEditedEntry_user' . getUserId(), 0); if ($latestEntryId !== 0) { $latestEntry = CT_Start_Default_getEntry($blogid, $latestEntryId); if ($latestEntry != false) { $target .= '<li><a href="' . $blogURL . '/owner/entry/edit/' . $latestEntry['id'] . '">' . _f('최근글(%1) 수정', htmlspecialchars(Utils_Unicode::lessenAsEm($latestEntry['title'], 10))) . '</a></li>'; } } if (Acl::check('group.administrators')) { $target .= '<li><a href="' . $blogURL . '/owner/skin">' . _t('스킨을 변경합니다') . '</a></li>' . CRLF; $target .= '<li><a href="' . $blogURL . '/owner/skin/sidebar">' . _t('사이드바 구성을 변경합니다') . '</a></li>' . CRLF; $target .= '<li><a href="' . $blogURL . '/owner/skin/setting">' . _t('블로그에 표시되는 값들을 변경합니다') . '</a></li>' . CRLF; $target .= '<li><a href="' . $blogURL . '/owner/entry/category">' . _t('카테고리를 변경합니다') . '</a></li>' . CRLF; $target .= '<li><a href="' . $blogURL . '/owner/plugin">' . _t('플러그인을 켜거나 끕니다') . '</a></li>' . CRLF; } if ($service['reader'] != false) { $target .= '<li><a href="' . $blogURL . '/owner/network/reader">' . _t('RSS 리더를 봅니다') . '</a></li>' . CRLF; } $target .= '</ul>'; return $target; }
public function post_reorder() { if (!Acl::check('parts.reorder')) { return; } $ids = $this->param('ids', array()); ORM::factory('page_part')->sort($ids); }
function getEntriesCountByCategory($blogid, $id) { $context = Model_Context::getInstance(); if ($context->getProperty('category.raw') === null) { getCategories($blogid, 'raw'); } //To cache category information. $result = MMCache::queryRow($context->getProperty('category.raw'), 'id', $id); if ($id === 0 || $result == '' || $id === null) { return 0; } else { if (doesHaveOwnership() && Acl::check('group.editors')) { return $result['entriesinlogin']; } else { return $result['entries']; } } }
private function _edit(ORM $role) { $data = $this->request->post('role'); $this->auto_render = FALSE; try { $role = $role->values($data)->update(); if (Acl::check('roles.change_permissions') and !empty($data['permissions'])) { $role->set_permissions($data['permissions']); } Messages::success(__('Role has been saved!')); } catch (ORM_Validation_Exception $e) { Messages::errors($e->errors('validation')); $this->go_back(); } if ($this->request->post('commit') !== NULL) { $this->go(); } else { $this->go(array('action' => 'edit', 'id' => $role->id)); } }
} else { if ($blogVisibility == 0) { requireOwnership(); } else { if ($blogVisibility == 1) { requireMembership(); } } } } if (in_array($context->getProperty('uri.interfaceType'), array('owner', 'reader'))) { requireOwnership(); // Check access control list if (!empty($_SESSION['acl'])) { $requiredPriv = Aco::getRequiredPrivFromUrl($context->getProperty('suri.directive')); if (!empty($requiredPriv) && !Acl::check($requiredPriv)) { if (in_array('group.administrators', $requiredPriv)) { header("location:" . $context->getProperty('uri.blog') . "/owner/center/dashboard"); exit; } else { header("location:" . $context->getProperty('uri.blog') . "/owner/entry"); exit; } } } } /** INITIALIZE : Cookie prefix * ----------------------------------- * Determines cookie prefix. */ if ($context->getProperty('service.cookie_prefix', '') == '') {
function getRecentComments($blogid, $count = false, $isGuestbook = false, $guestShip = false) { global $skinSetting, $database; $comments = array(); if (!$isGuestbook && !Acl::check("group.editors")) { $userLimit = ' AND e.userid = ' . getUserId(); } else { $userLimit = ''; } $sql = doesHaveOwnership() && !$guestShip ? "SELECT r.*, e.title, e.slogan\n\t\tFROM\n\t\t\t{$database['prefix']}Comments r\n\t\t\tINNER JOIN {$database['prefix']}Entries e ON r.blogid = e.blogid AND r.entry = e.id AND e.draft = 0{$userLimit}\n\t\tWHERE\n\t\t\tr.blogid = {$blogid}" . ($isGuestbook != false ? " AND r.entry=0" : " AND r.entry>0") . " AND r.isfiltered = 0\n\t\tORDER BY\n\t\t\tr.written\n\t\tDESC LIMIT " . ($count != false ? $count : $skinSetting['commentsOnRecent']) : "SELECT r.*, e.title, e.slogan\n\t\tFROM\n\t\t\t{$database['prefix']}Comments r\n\t\t\tINNER JOIN {$database['prefix']}Entries e ON r.blogid = e.blogid AND r.entry = e.id AND e.draft = 0\n\t\t\tLEFT OUTER JOIN {$database['prefix']}Categories c ON e.blogid = c.blogid AND e.category = c.id\n\t\tWHERE\n\t\t\tr.blogid = {$blogid} AND e.draft = 0 AND e.visibility >= 2" . getPrivateCategoryExclusionQuery($blogid) . ($isGuestbook != false ? " AND r.entry = 0" : " AND r.entry > 0") . " AND r.isfiltered = 0\n\t\tORDER BY\n\t\t\tr.written\n\t\tDESC LIMIT " . ($count != false ? $count : $skinSetting['commentsOnRecent']); if ($result = POD::queryAllWithDBCache($sql, 'comment')) { foreach ($result as $comment) { if ($comment['secret'] == 1 && !doesHaveOwnership()) { if (!doesHaveOpenIDPriv($comment)) { $comment['name'] = _text('비밀방문자'); $comment['homepage'] = ''; $comment['comment'] = _text('관리자만 볼 수 있는 댓글입니다.'); } } array_push($comments, $comment); } } return $comments; }
function getDefaultCenterPanel($mapping) { $ctx = Model_Context::getInstance(); $blogid = $ctx->getProperty('blog.id'); ?> <div id="<?php echo $mapping['plugin']; ?> " class="section"> <h3 class="caption<?php echo isset($_REQUEST['edit']) ? ' visible' : ' invisible'; ?> "> <span><?php echo _t('알림판'); if (isset($_REQUEST['edit'])) { ?> <a id="<?php echo $mapping['plugin']; ?> widgetup" href="<?php echo $ctx->getProperty('uri.blog'); ?> /owner/center/dashboard?edit&pos=<?php echo $positionCounter; ?> &rel=-1&edit"><?php echo _t('위로'); ?> </a> <a id="<?php echo $mapping['plugin']; ?> widgetdown" href="<?php echo $ctx->getProperty('uri.blog'); ?> /owner/center/dashboard?edit&pos=<?php echo $positionCounter; ?> &rel=1&edit"><?php echo _t('아래로'); ?> </a> <?php } ?> </span> </h3> <?php if (isset($_REQUEST['edit'])) { ?> </div> <?php return true; } else { // Get default data $stats = Statistics::getStatistics($blogid); $latestEntryId = Setting::getBlogSettingGlobal('LatestEditedEntry_user' . getUserId(), 0); $comments = getRecentComments($blogid, 10); $guestbooks = getRecentGuestbook($blogid, 10); list($commentNotifies, $paging) = getCommentsNotifiedWithPagingForOwner($blogid, 0, null, null, null, 1, 10); $trackbacks = getRecentTrackbacks($blogid, 10); $recents = array(); // title, date, link, category foreach ($comments as $comment) { array_push($recents, array('title' => $comment['comment'], 'date' => $comment['written'], 'link' => $ctx->getProperty('uri.blog') . "/" . $comment['entry'] . "#comment" . $comment['id'], 'category' => 'comment')); } foreach ($commentNotifies as $comment) { array_push($recents, array('title' => $comment['comment'], 'date' => $comment['written'], 'link' => $ctx->getProperty('uri.blog') . "/owner/communication/notify", 'category' => 'commentNotify')); } foreach ($guestbooks as $guestbook) { array_push($recents, array('title' => $guestbook['comment'], 'date' => $guestbook['written'], 'link' => $ctx->getProperty('uri.blog') . "/guestbook/" . $guestbook['id'] . "#guestbook" . $guestbook['id'], 'category' => 'guestbook')); } foreach ($trackbacks as $trackback) { array_push($recents, array('title' => $trackback['subject'], 'date' => $trackback['written'], 'link' => $ctx->getProperty('uri.blog') . "/" . $trackback['entry'] . "#trackback" . $trackback['id'], 'category' => 'trackback')); } $sort_array = array(); foreach ($recents as $uniqid => $row) { // Sorting. foreach ($row as $key => $value) { if (!array_key_exists($key, $sort_array)) { $sort_array[$key] = array(); } $sort_array[$key][$uniqid] = $value; } } if (!empty($sort_array)) { array_multisort($sort_array['date'], SORT_DESC, $recents); } $recents = array_slice($recents, 0, 14); ?> <div id="shortcut-collection"> <h4 class="caption"><span><?php echo _t('바로가기'); ?> </span></h4> <ul> <li class="newPost"><a class="newPost" href="<?php echo $ctx->getProperty('uri.blog'); ?> /owner/entry/post"><span><?php echo _t('새 글 쓰기'); ?> </span></a></li> <?php if ($latestEntryId !== 0) { $latestEntry = getEntry($blogid, $latestEntryId); if (!is_null($latestEntry)) { ?> <li class="modifyPost"><a href="<?php echo $ctx->getProperty('uri.blog'); ?> /owner/entry/edit/<?php echo $latestEntry['id']; ?> "><?php echo _f('최근글(%1) 수정', htmlspecialchars(Utils_Unicode::lessenAsEm($latestEntry['title'], 10))); ?> </a></li> <?php } } if ($ctx->getProperty('service.reader') == true) { ?> <li class="rssReader"><a href="<?php echo $ctx->getProperty('uri.blog'); ?> /owner/network/reader"><?php echo _t('RSS로 등록한 이웃 글 보기'); ?> </a></li> <?php } if (Acl::check("group.administrators")) { ?> <li class="deleteCache"><a href="<?php echo $ctx->getProperty('uri.blog'); ?> /owner/center/dashboard/cleanup" onclick="cleanupCache();return false;"><?php echo _t('캐시 지우기'); ?> </a></li> <?php if (Acl::check("group.creators")) { ?> <li class="optimizeStorage"><a href="<?php echo $ctx->getProperty('uri.blog'); ?> /owner/data" onclick="optimizeData();return false;"><?php echo _t('저장소 최적화'); ?> </a></li> <?php } } ?> <li class="clear"></li> </ul> </div> <div id="total-information"> <h4 class="caption"><span><?php echo _t('요약'); ?> </span></h4> <table class="posts-line"> <caption><?php echo _t('글'); ?> </caption> <thead> <th>type</th> <th>sum</th> </thead> <tbody> <tr> <td class="type"><?php echo _t('글'); ?> </td> <td class="sum"><?php echo number_format(getEntriesTotalCount($blogid)); ?> </td> </tr> <tr> <td class="type"><?php echo _t('댓글'); ?> </td> <td class="sum"><?php echo number_format(getCommentCount($blogid)); ?> </td> </tr> <tr> <td class="type"><?php echo _t('방명록'); ?> </td> <td class="sum"><?php echo number_format(getGuestbookCount($blogid)); ?> </td> </tr> <tr> <td class="type"><?php echo _t('걸린 글'); ?> </td> <td class="sum"><?php echo number_format(getTrackbackCount($blogid)); ?> </td> </tr> </tbody> </table> <table class="visitors-line"> <caption><?php echo _t('방문자'); ?> </caption> <thead> <th>type</th> <th>sum</th> </thead> <tbody> <tr> <td class="type"><?php echo _t('오늘'); ?> </td> <td class="sum"><?php echo number_format($stats['today']); ?> </td> </tr> <tr> <td class="type"><?php echo _t('어제'); ?> </td> <td class="sum"><?php echo number_format($stats['yesterday']); ?> </td> </tr> <tr> <td class="type"><?php echo _t('7일 평균'); ?> </td> <td class="sum"><?php $weekly = Statistics::getWeeklyStatistics(); $weeklycount = 0; foreach ($weekly as $day) { $weeklycount += $day['visits']; } echo number_format($weeklycount / 7); unset($weekly); unset($weeklycount); ?> </td> </tr> <tr> <td class="type"><?php echo _t('총방문자'); ?> </td> <td class="sum"><?php echo number_format($stats['total']); ?> </td> </tr> </tbody> </table> </div> <div id="myBlogInfo"> <h4 class="caption"><span><a href="<?php echo $ctx->getProperty('uri.blog') . '/owner/communication/comment'; ?> "><?php echo _t('알림판'); ?> </a></span></h4> <table class="recent"> <caption>asdasd</caption> <thead> <tr> <th scope="col" class="date"><?php echo _t('날짜'); ?> </th> <th scope="col" class="category"><?php echo _t('종류'); ?> </th> <th scope="col"><?php echo _t('내용'); ?> </th> </tr> </thead> <tbody> <?php foreach ($recents as $item) { ?> <tr class="<?php echo $item['category']; ?> "> <td class="date"><?php echo Timestamp::format('%m/%d', $item['date']); ?> </td> <td class="category"> <?php switch ($item['category']) { case 'trackback': echo '<a href="' . $ctx->getProperty('uri.blog') . '/owner/communication/trackback?status=received">' . _t('걸린글') . '</a>'; break; case 'comment': echo '<a href="' . $ctx->getProperty('uri.blog') . '/owner/communication/comment?status=comment">' . _t('댓글') . '</a>'; break; case 'commentNotify': echo '<a href="' . $ctx->getProperty('uri.blog') . '/owner/communication/notify">' . _t('알리미') . '</a>'; break; case 'guestbook': echo '<a href="' . $ctx->getProperty('uri.blog') . '/owner/communication/comment?status=guestbook">' . _t('방명록') . '</a>'; break; } ?> </td> <td class="title"><a href="<?php echo $item['link']; ?> "><?php echo htmlspecialchars(Utils_Unicode::lessenAsEm($item['title'], 20)); ?> </a></td> </tr> <?php } ?> </tbody> </table> </div> <?php $noticeURL = TEXTCUBE_NOTICE_URL; $noticeURLRSS = $noticeURL . ($ctx->getProperty('blog.language') ? $ctx->getProperty('blog.language') : "ko") . "/rss"; $noticeEntries = array(); if (!is_null(Setting::getServiceSetting('TextcubeNotice' . $ctx->getProperty('blog.language')))) { $noticeEntries = unserialize(Setting::getServiceSetting('TextcubeNotice' . $ctx->getProperty('blog.language'))); } else { list($result, $feed, $xml) = getRemoteFeed($noticeURLRSS); if ($result == 0) { $xmls = new XMLStruct(); $xmls->setXPathBaseIndex(1); $noticeEntries = array(); if ($xmls->open($xml, $ctx->getProperty('service.encoding'))) { if ($xmls->getAttribute('/rss', 'version')) { for ($i = 1; $link = $xmls->getValue("/rss/channel/item[{$i}]/link"); $i++) { $item = array('permalink' => rawurldecode($link)); $item['title'] = $xmls->getValue("/rss/channel/item[{$i}]/title"); if ($xmls->getValue("/rss/channel/item[{$i}]/pubDate")) { $item['written'] = parseDate($xmls->getValue("/rss/channel/item[{$i}]/pubDate")); } else { if ($xmls->getValue("/rss/channel/item[{$i}]/dc:date")) { $item['written'] = parseDate($xmls->getValue("/rss/channel/item[{$i}]/dc:date")); } else { $item['written'] = 0; } } array_push($noticeEntries, $item); } } } Setting::setServiceSetting('TextcubeNotice' . $ctx->getProperty('blog.language'), serialize($noticeEntries)); } } ?> <div id="textcube-notice"> <h4 class="caption"><span><a href="<?php echo $noticeURL . ($ctx->getProperty('blog.language') ? $ctx->getProperty('blog.language') : "ko"); ?> "><?php echo _t('공지사항'); ?> </a></span></h4> <?php if (count($noticeEntries) > 0) { array_splice($noticeEntries, 3, count($noticeEntries) - 3); ?> <table> <tbody> <?php foreach ($noticeEntries as $item) { ?> <tr> <td class="date"><?php echo Timestamp::format2($item['written']); ?> </td> <td class="title"><a href="<?php echo $item['permalink']; ?> " onclick="return openLinkInNewWindow(this);" ><?php echo htmlspecialchars(Utils_Unicode::lessenAsEm($item['title'], 35)); ?> </a></td> </tr> <?php } ?> </tbody> </table> <?php } else { ?> <div id="fail-notice"> <?php echo _t('공지사항을 가져올 수 없습니다. 잠시 후 다시 시도해 주십시오.'); ?> </div> <?php } ?> </div> <?php } ?> </div> <?php }
function setDefaultBlog($blogid) { if (!Acl::check("group.creators")) { return false; } $result = Setting::setServiceSettingGlobal("defaultBlogId", $_GET['blogid']); return $result; }
?> </div> <div class="profile-row"> <div class="left-col"> <div class="profile-block"> <div class="panel profile-photo"> <?php echo HTML::anchor('http://gravatar.com/emails/', $user->gravatar(100, NULL), array('target' => '_blank')); ?> </div> <br /> <?php if (Acl::check('users.edit') or $user->id == Auth::get_id()) { ?> <?php echo HTML::anchor(Route::get('backend')->uri(array('controller' => 'users', 'action' => 'edit', 'id' => $user->id)), __('Edit profile'), array('class' => 'btn btn-success btn-sm', 'data-icon' => 'user')); ?> <?php } ?> </div> </div> <div class="right-col"> <hr class="profile-content-hr no-grid-gutter-h"> <div class="profile-content tabbable"> <?php
function getEntryWithPagingBySlogan($blogid, $slogan, $isNotice = false, $categoryId = false) { global $database; global $blogURL; requireModel('blog.category'); $entries = array(); $paging = $isNotice ? Paging::init("{$blogURL}/notice", '/') : Paging::init("{$blogURL}/entry", '/'); $visibility = doesHaveOwnership() ? '' : 'AND e.visibility > 0'; $visibility .= $isNotice || doesHaveOwnership() ? '' : getPrivateCategoryExclusionQuery($blogid); $visibility .= doesHaveOwnership() && !Acl::check('group.editors') ? ' AND (e.userid = ' . getUserId() . ' OR e.visibility > 0)' : ''; $category = $isNotice ? 'e.category = -2' : 'e.category >= 0'; if ($categoryId !== false) { if (!$categoryId == 0) { // Not a 'total' category. $childCategories = getChildCategoryId($blogid, $categoryId); if (!empty($childCategories)) { $category = 'e.category IN (' . $categoryId . ',' . implode(",", $childCategories) . ')'; } else { $category = 'e.category = ' . $categoryId; } } } $currentEntry = POD::queryRow("SELECT e.*, c.label AS categoryLabel \n\t\tFROM {$database['prefix']}Entries e \n\t\tLEFT JOIN {$database['prefix']}Categories c ON e.blogid = c.blogid AND e.category = c.id \n\t\tWHERE e.blogid = {$blogid} \n\t\t\tAND e.slogan = '" . POD::escapeString($slogan) . "' \n\t\t\tAND e.draft = 0 {$visibility} AND {$category}"); $result = POD::query("SELECT e.id, e.slogan \n\t\tFROM {$database['prefix']}Entries e \n\t\tLEFT JOIN {$database['prefix']}Categories c ON e.blogid = c.blogid AND e.category = c.id \n\t\tWHERE e.blogid = {$blogid} \n\t\t\tAND e.draft = 0 {$visibility} AND {$category} \n\t\tORDER BY e.published DESC"); if (!$result || !$currentEntry) { return array($entries, $paging); } if ($categoryId !== false) { $paging['pages'] = $categoryId == 0 ? getEntriesTotalCount($blogid) : getEntriesCountByCategory($blogid, $categoryId); $paging['postfix'] = '?category=' . $categoryId; } else { $paging['pages'] = $isNotice ? getNoticesTotalCount($blogid) : getEntriesTotalCount($blogid); } for ($i = 1; $entry = POD::fetch($result); $i++) { if ($entry['slogan'] != $slogan) { if (array_push($paging['before'], $entry['slogan']) > 4) { if ($i == 5) { $paging['first'] = array_shift($paging['before']); } else { array_shift($paging['before']); } } continue; } $paging['page'] = $i; array_push($entries, $currentEntry); $paging['after'] = array(); for ($i++; count($paging['after']) < 4 && ($entry = POD::fetch($result)); $i++) { array_push($paging['after'], $entry['slogan']); } if ($i < $paging['pages']) { while ($entry = POD::fetch($result)) { $paging['last'] = $entry['slogan']; } } if (count($paging['before']) > 0) { $paging['prev'] = $paging['before'][count($paging['before']) - 1]; } if (isset($paging['after'][0])) { $paging['next'] = $paging['after'][0]; } return array($entries, $paging); } $paging['page'] = $paging['pages'] + 1; return array($entries, $paging); }
function getEntriesCountByCategory($blogid, $id) { requireComponent('Needlworks.Cache.PageCache'); global $__gCacheCategoryRaw; if (empty($__gCacheCategoryRaw)) { getCategories($blogid, 'raw'); } //To cache category information. $result = MMCache::queryRow($__gCacheCategoryRaw, 'id', $id); if ($id === 0 || $result == '' || $id === null) { return 0; } else { if (doesHaveOwnership() && Acl::check('group.editors')) { return $result['entriesinlogin']; } else { return $result['entries']; } } }
function recurse_pages($pages, $spaces = 0, $layouts_blocks = array(), $page_widgets = array(), $pages_widgets = array()) { $data = ''; foreach ($pages as $page) { // Блок $current_block = Arr::path($page_widgets, $page['id'] . '.0'); $current_position = Arr::path($page_widgets, $page['id'] . '.1'); $data .= '<tr data-id="' . $page['id'] . '" data-parent-id="' . $page['parent_id'] . '">'; $data .= '<td>'; if (!empty($page['childs'])) { $data .= '<div class="input-group">'; } $data .= Form::hidden('blocks[' . $page['id'] . '][name]', $current_block, array('class' => 'widget-blocks form-control', 'data-layout' => $page['layout_file'])); if (!empty($page['childs'])) { $data .= "<div class=\"input-group-btn\">" . Form::button(NULL, UI::icon('level-down'), array('class' => 'set_to_inner_pages btn', 'title' => __('Select to child pages'))) . '</div></div>'; } $data .= '</td><td>'; $data .= Form::input('blocks[' . $page['id'] . '][position]', (int) $current_position, array('maxlength' => 4, 'size' => 4, 'class' => 'form-control text-right widget-position')); $data .= '</td><td></td>'; if (Acl::check('page.edit')) { $data .= '<th>' . str_repeat("- ", $spaces) . HTML::anchor(Route::get('backend')->uri(array('controller' => 'page', 'action' => 'edit', 'id' => $page['id'])), $page['title']) . '</th>'; } else { $data .= '<th>' . str_repeat("- ", $spaces) . $page['title'] . '</th>'; } $data .= '</tr>'; if (!empty($page['childs'])) { $data .= recurse_pages($page['childs'], $spaces + 5, $layouts_blocks, $page_widgets, $pages_widgets); } } return $data; }
?> </th> <th><?php echo __('Actions'); ?> </th> </tr> </thead> <tbody> <?php foreach ($roles as $role) { ?> <tr class="item"> <td class="name"> <?php if (Acl::check('roles.edit')) { ?> <?php echo HTML::anchor(Route::get('backend')->uri(array('controller' => 'roles', 'action' => 'edit', 'id' => $role->id)), $role->name, array('data-icon' => 'unlock')); ?> <?php } else { ?> <?php echo UI::icon('lock'); ?> <?php echo $role->name; ?> <?php }
<?php /// Copyright (c) 2004-2012, Needlworks / Tatter Network Foundation /// All rights reserved. Licensed under the GPL. /// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT) $IV = array('GET' => array('visibility' => array('int', 0, 3, 'default' => 0), 'command' => array('string', 'mandatory' => false)), 'POST' => array('visibility' => array('int', 0, 3, 'default' => 0), 'command' => array('string', 'mandatory' => false))); require ROOT . '/library/preprocessor.php'; requireModel("blog.entry"); requireStrictRoute(); // TeamBlog ACL check whether or not current user can edit this post. if (Acl::check('group.writers') === false && !empty($suri['id'])) { if (getUserIdOfEntry(getBlogId(), $suri['id']) != getUserId()) { @header("location:" . $context->getProperty('uri.blog') . "/owner/entry"); exit; } } //$isAjaxRequest = checkAjaxRequest(); if (!isset($_GET['command'])) { $temp = setEntryVisibility($suri['id'], isset($_GET['visibility']) ? $_GET['visibility'] : 0) == true ? 0 : 1; $countResult = POD::queryExistence("SELECT id \n\t\t\tFROM {$database['prefix']}Entries \n\t\t\tWHERE blogid = " . getBlogId() . " AND visibility = 3"); if ($countResult == false) { $countResult = 0; } else { $countResult = 1; } Respond::PrintResult(array('error' => $temp, 'countSyndicated' => $countResult), false); } else { switch ($_GET['command']) { case "protect": $_GET['command'] = 1; break;
function requirePrivilege($AC) { if (Acl::check($AC)) { return true; } else { header('HTTP/1.1 404 Not found'); } exit; }
?> /owner/data/correct" target="blackhole"></form> <div id="correctingDataDialog" class="system-dialog" style="position: absolute; display: none; z-index: 110;"> <h3 id="correctingDataDialogTitle"></h3> <div class="message-sub"> <span id="correctingText"></span> <span id="correctingTextSub"></span> </div> <div id="correctingIndicator" class="progressBar" style="width: 0%; height: 18px; margin-top: 5px; background-color: #66DDFF;"></div> </div> </div> <hr class="hidden" /> <?php if (Acl::check("group.creators")) { ?> <div id="part-data-optimize" class="part"> <h2 class="caption"><span class="main-text"><?php echo _t('데이터베이스를 최적화합니다'); ?> </span></h2> <div class="data-inbox main-explain-box"> <div class="image" onclick="optimizeData()"> <img src="<?php echo $context->getProperty('service.path') . $context->getProperty('panel.skin'); ?> /image/dbOptimize.png" alt="<?php echo _t('데이터베이스 최적화 이미지'); ?>
} else { ?> <?php echo HTML::anchor($page->get_url(), $page->title, array('data-icon' => 'home fa-lg fa-fw')); ?> <?php } ?> <?php echo $page->get_public_anchor(); ?> </div> <div class="actions col-xs-offset-4 col-xs-1 text-right"> <?php if (Acl::check('page.add')) { ?> <?php echo UI::button(NULL, array('icon' => UI::icon('plus'), 'href' => Route::get('backend')->uri(array('controller' => 'page', 'action' => 'add')), 'class' => 'btn-default btn-xs')); ?> <?php } ?> </div> <div class="clearfix"></div> </div> <?php echo $content_children; ?> </li> </ul>
function setOpenIDLogoDisplay($mode) { if (!Acl::check(array("group.administrators"))) { return false; } return Setting::setBlogSettingGlobal("OpenIDLogoDisplay", $mode); }
private function _edit($user) { $data = $this->request->post('user'); $profile = $this->request->post('profile'); $this->auto_render = FALSE; if (ACL::check('users.change_password') or $user->id == Auth::get_id()) { if (strlen($data['password']) == 0) { unset($data['password'], $data['password_confirm']); } } else { unset($data['password']); } if (empty($profile['notice'])) { $profile['notice'] = 0; } try { if ($user->update_user($data, array('email', 'username', 'password'))) { $profile['user_id'] = $user->id; $user->profile->values($profile)->save(); if (Acl::check('users.change_roles') and $user->id > 1) { // now we need to add permissions $user_roles = $this->request->post('user_roles'); if (!empty($user_roles)) { $user->update_related_ids('roles', explode(',', $user_roles)); } } Messages::success(__('User has been saved!')); } } catch (ORM_Validation_Exception $e) { Messages::errors($e->errors('validation')); $this->go_back(); } // save and quit or save and continue editing? if ($this->request->post('commit') !== NULL) { $this->go(); } else { $this->go(array('action' => 'edit', 'id' => $user->id)); } }
echo _t('삭제합니다.'); ?> "> <option value="delete"><?php echo _t('삭제합니다.'); ?> </option> </optgroup> </select> <input type="button" id="apply-button-top" class="apply-button input-button" value="<?php echo _t('적용'); ?> " onclick="processBatch(document.getElementById('commandBoxTop'));" /> <?php if (Acl::check('group.administrators')) { if (isset($teamblog_users) && count($teamblog_users) > 1) { ?> <?php echo _t('또는'); ?> <select name="author-to-entry" id="author-to-entry"> <option value=""><?php echo _t('글 작성자를 변경합니다.'); ?> </option> <?php foreach ($teamblog_users as $teamblog_user) { $tmpstr = ''; if ($teamblog_user['acl'] & BITWISE_ADMINISTRATOR) { $tmpstr .= _t('관리자');
if (is_null($entry)) { Respond::ErrorPage(_t('포스트 정보가 존재하지 않습니다.')); $isKeyword = $entry['category'] == -1; } if (defined('__TEXTCUBE_POST__') && isset($_GET['category'])) { $entry['category'] = $_GET['category']; } if (isset($_POST['slogan'])) { $_GET['slogan'] = $_POST['slogan']; } if (defined('__TEXTCUBE_POST__') && isset($_GET['slogan'])) { $entry['slogan'] = $_GET['slogan']; $entry['title'] = $_GET['slogan']; } // Check whether or not user has permission to edit. if (Acl::check('group.editors') === false && !empty($suri['id'])) { if (getUserIdOfEntry(getBlogId(), $suri['id']) != getUserId()) { @header("location:" . $context->getProperty('uri.blog') . "/owner/entry"); exit; } } $editors = getAllEditors(); if (isset($_GET['editor']) && in_array($_GET['editor'], array_keys($editors))) { $entry['contenteditor'] = $_GET['editor']; } $context->setProperty('editor.key', $entry['contenteditor']); if (isset($_GET['popupEditor'])) { require ROOT . '/interface/common/owner/headerForPopupEditor.php'; } else { require ROOT . '/interface/common/owner/header.php'; }
function moblog_manage() { global $blogURL; if (Acl::check('group.administrators') && $_SERVER['REQUEST_METHOD'] == 'POST') { Setting::setBlogSettingGlobal('MmsPop3Email', $_POST['pop3email']); Setting::setBlogSettingGlobal('MmsPop3Host', $_POST['pop3host']); Setting::setBlogSettingGlobal('MmsPop3Port', $_POST['pop3port']); Setting::setBlogSettingGlobal('MmsPop3Ssl', !empty($_POST['pop3ssl']) ? 1 : 0); Setting::setBlogSettingGlobal('MmsPop3Username', $_POST['pop3username']); Setting::setBlogSettingGlobal('MmsPop3Password', $_POST['pop3password']); Setting::setBlogSettingGlobal('MmsPop3Visibility', $_POST['pop3visibility']); Setting::setBlogSettingGlobal('MmsPop3Category', $_POST['pop3category']); Setting::setBlogSettingGlobal('MmsPop3Fallbackuserid', getUserId()); Setting::setBlogSettingGlobal('MmsPop3MinSize', 0); Setting::setBlogSettingGlobal('MmsPop3AllowOnly', !empty($_POST['pop3allowonly']) ? 1 : 0); Setting::setBlogSettingGlobal('MmsPop3Allow', $_POST['pop3allow']); Setting::setBlogSettingGlobal('MmsPop3Subject', $_POST['pop3subject']); } $pop3email = Setting::getBlogSettingGlobal('MmsPop3Email', ''); $pop3host = Setting::getBlogSettingGlobal('MmsPop3Host', 'localhost'); $pop3port = Setting::getBlogSettingGlobal('MmsPop3Port', 110); $pop3ssl = Setting::getBlogSettingGlobal('MmsPop3Ssl', 0) ? " checked=1 " : ""; $pop3username = Setting::getBlogSettingGlobal('MmsPop3Username', ''); $pop3password = Setting::getBlogSettingGlobal('MmsPop3Password', ''); $pop3minsize = Setting::getBlogSettingGlobal('MmsPop3MinSize', 0); $pop3category = Setting::getBlogSettingGlobal('MmsPop3Category', 0); $pop3fallheadercharset = Setting::getBlogSettingGlobal('MmsPop3Fallbackcharset', 'euc-kr'); $pop3visibility = Setting::getBlogSettingGlobal('MmsPop3Visibility', '2'); $pop3mmsallowonly = Setting::getBlogSettingGlobal('MmsPop3AllowOnly', '0'); $pop3mmsallow = Setting::getBlogSettingGlobal('MmsPop3Allow', ''); $pop3subject = Setting::getBlogSettingGlobal('MmsPop3Subject', '%Y-%M-%D'); ?> <hr class="hidden" /> <div id="part-setting-editor" class="part"> <h2 class="caption"><span class="main-text"><?php echo _t('MMS 메시지 확인용 메일 환경 설정'); ?> </span></h2> <?php if (!Acl::check("group.administrators")) { ?> <div id="editor-section" class="section"> <dl id="formatter-line" class="line"> <dt><span class="label"><?php echo _t('MMS 수신 이메일'); ?> </span></dt> <dd> <?php if (empty($pop3email)) { ?> <?php echo _t('비공개'); ?> <?php } else { ?> <?php echo $pop3email; ?> <?php } ?> </dd> <dd> <?php if (empty($pop3email)) { ?> <?php echo _t('이동전화에서 보내는 이메일을 수신할 주소가 공개되지 않았습니다'); ?> <?php } else { ?> <?php echo _t('이동전화를 이용하여 위 메일로 이메일을 보내면 블로그에 게시됩니다'); ?> <?php } ?> </dd> </dl> </div> <?php } else { ?> <script type="text/javascript"> function changehost(packedhost) { var h = packedhost.split( ':' ); document.forms['editor-form']['pop3host'].value = h[0]; document.forms['editor-form']['pop3port'].value = h[1]; document.forms['editor-form']['pop3ssl'].checked = !!parseInt(h[2]); } function renderhosts() { var hosts = "<?php echo _t('PREDEFINED POP3 HOSTS'); ?> "; if( hosts == 'PREDEFINED POP3 HOSTS' ) { hosts = "gmail:pop.gmail.com:995:1/hanmail:pop.hanmail.net:995:1/naver:pop.naver.com:110:0/nate:mail.nate.com:110:0"; } hosts = "Localhost:localhost:110:0/" + hosts; hosts = hosts.split('/'); for( var i=0; i<hosts.length; i++ ) { var h = hosts[i]; var n = h.split(':')[0]; var v = h.substr(n.length+1); document.write( "<option value=\""+v+"\">"+n+"</option>" ); } } </script> <form id="editor-form" class="data-inbox" method="post" action="<?php echo $blogURL; ?> /owner/plugin/adminMenu?name=CL_Moblog/moblog_manage"> <div id="editor-section" class="section"> <fieldset class="container"> <legend><?php echo _t('MMS 환경을 설정합니다'); ?> </legend> <dl id="formatter-line" class="line"> <dt><span class="label"><?php echo _t('MMS용 이메일'); ?> </span></dt> <dd> <input type="text" style="width:14em" class="input-text" name="pop3email" value="<?php echo $pop3email; ?> " /> <?php echo _t('(필진에 공개 됩니다. 사진을 찍어 이메일로 보내면 포스팅이 됩니다)'); ?> </dd> </dl> <dl id="formatter-line" class="line"> <dt><span class="label"><?php echo _t('POP3 호스트'); ?> </span></dt> <dd> <input type="text" style="width:14em" class="input-text" name="pop3host" value="<?php echo $pop3host; ?> " /> <select onchange="changehost(this.value)"> <option value=""><?php echo _t('선택하세요'); ?> </option> <script type="text/javascript">renderhosts()</script> </select> </dd> </dl> <dl id="editor-line" class="line"> <dt><span class="label"><?php echo _t('POP3 포트'); ?> </span></dt> <dd> <input type="text" style="width:14em" class="input-text" name="pop3port" value="<?php echo $pop3port; ?> " /> <input type="checkbox" name="pop3ssl" value="1" <?php echo $pop3ssl; ?> /> SSL </dd> </dl> <dl id="editor-line" class="line"> <dt><span class="label"><?php echo _t('POP3 아이디'); ?> </span></dt> <dd> <input type="text" style="width:14em" class="input-text" name="pop3username" value="<?php echo $pop3username; ?> " /> </dd> </dl> <dl id="editor-line" class="line"> <dt><span class="label"><?php echo _t('POP3 비밀번호'); ?> </span></dt> <dd> <input type="password" style="width:14em" class="input-text" name="pop3password" value="<?php echo $pop3password; ?> " /> </dd> </dl> <div class="button-box"> <input type="submit" class="save-button input-button wide-button" value="<?php echo _t('저장하기'); ?> " /> </div> </div> <h2 class="caption"><span class="main-text"><?php echo _t('글 쓰기 환경 설정'); ?> </span></h2> <div id="editor-section" class="section"> <dl id="editor-line" class="line"> <dt><span class="label"><?php echo _t('제목'); ?> </span></dt> <dd> <input type="text" style="width:24em" class="input-text" id="pop3subject" name="pop3subject" value="<?php echo $pop3subject; ?> " /> (<?php echo _t('%Y:년, %M:월, %D:일'); ?> ) <input type="button" value="<?php echo _t("초기화"); ?> " onclick="document.getElementById('pop3subject').value='%Y-%M-%D';return false;" /> </dd> </dl> <dl id="editor-line" class="line"> <dt><span class="label"><?php echo _t('공개여부'); ?> </span></dt> <dd> <span id="status-private" class="status-private"><input type="radio" id="visibility_private" class="radio" name="pop3visibility" value="0"<?php echo $pop3visibility == 0 ? ' checked="checked"' : ''; ?> /><label for="visibility_private"><?php echo _t('비공개'); ?> </label></span> <span id="status-protected" class="status-protected"><input type="radio" id="visibility_protected" class="radio" name="pop3visibility" value="1"<?php echo $pop3visibility == 1 ? ' checked="checked"' : ''; ?> /><label for="visibility_protected"><?php echo _t('보호'); ?> </label></span> <span id="status-public" class="status-public"><input type="radio" id="visibility_public" class="radio" name="pop3visibility" value="2"<?php echo $pop3visibility == 2 ? ' checked="checked"' : ''; ?> /><label for="visibility_public"><?php echo _t('공개'); ?> </label></span> <span id="status-syndicated" class="status-syndicated"><input type="radio" id="visibility_syndicated" class="radio" name="pop3visibility" value="3"<?php echo $pop3visibility == 3 ? ' checked="checked"' : ''; ?> /><label for="visibility_syndicated"><?php echo _t('발행'); ?> </label></span> </dd> </dl> <dl id="editor-line" class="line"> <dt><span class="label"><?php echo _t('분류'); ?> </span></dt> <dd> <select id="category" name="pop3category"> <optgroup class="category" label="<?php echo _t('분류'); ?> "> <?php foreach (getCategories(getBlogId()) as $category) { ?> <?php if ($category['id'] != 0) { ?> <option value="<?php echo $category['id']; ?> " <?php echo $category['id'] == $pop3category ? 'selected' : ''; ?> > <?php echo ($category['visibility'] > 1 ? '' : _t('(비공개)')) . htmlspecialchars($category['name']); ?> </option> <?php } ?> <?php foreach ($category['children'] as $child) { ?> <?php if ($category['id'] != 0) { ?> <option value="<?php echo $child['id']; ?> " <?php echo $child['id'] == $pop3category ? 'selected' : ''; ?> > ― <?php echo ($category['visibility'] > 1 && $child['visibility'] > 1 ? '' : _t('(비공개)')) . htmlspecialchars($child['name']); ?> </option> <?php } ?> <?php } ?> <?php } ?> </optgroup> </select> </dd> </dl> <div class="button-box"> <input type="submit" class="save-button input-button wide-button" value="<?php echo _t('저장하기'); ?> " /> </div> </div> <h2 class="caption"><span class="main-text"><?php echo _t('메일 필터링 설정'); ?> </span></h2> <div id="editor-section" class="section"> <dl id="formatter-line" class="line"> <dt><span class="label"><?php echo _t('허용 목록'); ?> </span></dt> <dd> <input type="radio" id="pop3allowonly" name="pop3allowonly" value="1" <?php echo $pop3mmsallowonly ? 'checked="checked"' : ''; ?> /> <label for="pop3allowonly"><?php echo _t('다음 송신자로부터 전송된 메일만 MMS로 인식하여 처리합니다'); ?> </label> </dd> <dd> <input type="radio" id="pop3allowlist" name="pop3allowonly" value="0" <?php echo $pop3mmsallowonly ? '' : 'checked="checked"'; ?> /> <label for="pop3allowlist"><?php echo _t('다음 송신자로부터 전송된 메일도 MMS로 인식하여 처리합니다'); ?> </label> </dd> <dd> <input type="text" maxlength="128" name="pop3allow" value="<?php echo htmlentities($pop3mmsallow); ?> " style="width:90%" /> </dd> <dd> <?php echo _t('여러 개인 경우 전화번호 혹은 이메일 주소를 쉼표나 공백으로 구별하여 나열합니다'); ?> </dd> <dd> </dd> </dl> <div class="button-box"> <input type="submit" class="save-button input-button wide-button" value="<?php echo _t('저장하기'); ?> " /> </div> </div> </form> <h2 class="caption"><span class="main-text"><?php echo _t('MMS 메시지 테스트'); ?> </span></h2> <div id="editor-section" class="section"> <dl id="formatter-line" class="line"> <dt><span class="label"><?php echo _t('명령'); ?> </span></dt> <dd> <input type="button" class="save-button input-button wide-button" value="<?php echo _t('로그보기'); ?> " onclick="document.getElementById('pop3_debug').src='<?php echo $blogURL; ?> /plugin/moblog/check?check=1&rnd='+((new Date()).getTime())" /> <input type="button" class="save-button input-button wide-button" value="<?php echo _t('시험하기'); ?> " onclick="document.getElementById('pop3_debug').src='<?php echo $blogURL; ?> /plugin/moblog/check?rnd='+((new Date()).getTime())" /> </dd> </dl> </div> <iframe src="about:blank" class="debug_message" id="pop3_debug" style="width:100%; height:400px"> </iframe> <?php } ?> </div> <?php }
<?php /// Copyright (c) 2004-2012, Needlworks / Tatter Network Foundation /// All rights reserved. Licensed under the GPL. /// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT) require ROOT . '/library/preprocessor.php'; require ROOT . '/interface/common/owner/header.php'; if (Acl::check('group.creators')) { ?> <script type="text/javascript"> //<![CDATA[ function deletePluginTable(name, type) { if(!confirm("<?php echo _t('해당 테이블을 정말 삭제하시겠습니까? 사용중인 플러그인은 자동으로 해제됩니다.'); ?> ")) return; var queryURL = "<?php echo $context->getProperty('uri.blog'); ?> /owner/plugin/tableSetting/delete"; queryURL += '?name=' + encodeURI(name); queryURL += '&type=' + type; var request = new HTTPRequest("POST", queryURL); request.onSuccess = function() { alert("<?php echo _t('테이블이 삭제되었습니다.'); ?> "); changeList(); }
function PN_Visitor_Default() { global $pluginMenuURL, $pluginHandlerURL; $blogid = getBlogId(); $stats = Statistics::getStatistics($blogid); $date = isset($_GET['date']) ? $_GET['date'] : date('Ym', strtotime("now")); ?> <!-- This tab space below this line is inserted for the indentation of original admin page --> <script type="text/javascript"> //<![CDATA[ <?php if (Acl::check('group.owners')) { ?> function setTotalStatistics() { if (confirm("방문자의 수를 초기화하면 방문객의 수가 0이 됩니다.\n정말 초기화하시겠습니까?")) { var request = new HTTPRequest("GET", "<?php echo $pluginHandlerURL; ?> /PN_Visitor_Default_set&ajaxcall"); request.onSuccess = function() { //document.getElementById("total").innerHTML = 0; window.location = '<?php echo $pluginMenuURL; ?> '; return true; } request.onError = function() { alert("저장하지 못했습니다."); return false; } request.send(); } } <?php } ?> function addCommas(nStr) { nStr += ''; x = nStr.split('.'); x1 = x[0]; x2 = x.length > 1 ? '.' + x[1] : ''; var rgx = /(\d+)(\d{3})/; while (rgx.test(x1)) { x1 = x1.replace(rgx, '$1' + ',' + '$2'); } return x1 + x2; } window.addEventListener("load", execLoadFunction, false); function execLoadFunction() { tempDiv = document.createElement("DIV"); tempDiv.style.clear = "both"; document.getElementById("part-statistics-visitor").appendChild(tempDiv); } //]]> </script> <form method="post" action="<?php echo $pluginHandlerURL; ?> PN_Visitor_Default_set"> <div id="part-statistics-visitor" class="part"> <h2 class="caption"><span class="main-text">방문자 통계정보를 보여줍니다</span></h2> <div id="statistics-counter-inbox" class="data-inbox"> <div class="title"> <span class="label"><span class="text">현재까지의 방문자 수</span></span> <span class="divider"> : </span> <span id="total"><?php echo number_format($stats['total']); ?> </span> </div> <?php if (Acl::check('group.owners')) { ?> <a class="init-button button" href="<?php echo $pluginHandlerURL; ?> /PN_Visitor_Default_set" onclick="setTotalStatistics(); return false;"><span class="text">초기화</span></a> <?php } ?> </div> <hr class="hidden" /> <table id="statistics-month-inbox" class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><span class="text">월별 방문자 수</span></th> </tr> </thead> <tbody> <?php $temp = Statistics::getMonthlyStatistics($blogid); for ($i = 0; $i < sizeof($temp); $i++) { $record = $temp[$i]; $className = $i % 2 == 1 ? 'even-line' : 'odd-line'; $className .= $i == sizeof($temp) - 1 ? ' last-line' : ''; ?> <tr class="<?php echo $className; ?> inactive-class" onmouseover="rolloverClass(this, 'over')" onmouseout="rolloverClass(this, 'out')" onclick="window.location.href='<?php echo $pluginMenuURL; ?> &date=<?php echo $record['datemark']; ?> '"> <td class="date"><a href="<?php echo $pluginMenuURL; ?> &date=<?php echo $record['datemark']; ?> "><?php echo Timestamp::formatDate2(Utils_Misc::getTimeFromPeriod($record['datemark'])); ?> </a></td> <td class="count"><a href="<?php echo $pluginMenuURL; ?> &date=<?php echo $record['datemark']; ?> "><?php echo $record['visits']; ?> </a></td> </tr> <?php } ?> </tbody> </table> <hr class="hidden" /> <table id="statistics-day-inbox" class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><span class="text">일별 방문자 수</span></th> </tr> </thead> <tbody> <?php if (isset($date)) { $temp = Statistics::getDailyStatistics($date); for ($i = 0; $i < sizeof($temp); $i++) { $record = $temp[$i]; $className = $i % 2 == 1 ? 'even-line' : 'odd-line'; $className .= $i == sizeof($temp) - 1 ? ' last-line' : ''; ?> <tr class="<?php echo $className; ?> inactive-class"> <td class="date"><?php echo Timestamp::formatDate(Utils_Misc::getTimeFromPeriod($record['datemark'])); ?> </td> <td class="count"><?php echo $record['visits']; ?> </td> </tr> <?php } } ?> </tbody> </table> </div> </form> <?php }
/** * Список прав пользователя * * @return array */ public function permissions_list() { $permissions = array(); foreach (Acl::get_permissions() as $section_title => $actions) { foreach ($actions as $action => $title) { if (Acl::check($action, $this)) { $permissions[$section_title][$action] = $title; } } } return $permissions; }
echo $child->get_status(); ?> </div> <div class="actions col-xs-1 text-right"> <div class="btn-group"> <?php if (Acl::check('page.add')) { ?> <?php echo UI::button(NULL, array('href' => Route::get('backend')->uri(array('controller' => 'page', 'action' => 'add', 'id' => $child->id)), 'icon' => UI::icon('plus'), 'class' => 'btn-default btn-xs')); ?> <?php } ?> <?php if (Acl::check('page.delete')) { ?> <?php echo UI::button(NULL, array('href' => Route::get('backend')->uri(array('controller' => 'page', 'action' => 'delete', 'id' => $child->id)), 'icon' => UI::icon('times fa-inverse'), 'class' => 'btn-xs btn-confirm btn-danger')); ?> <?php } ?> </div> </div> <div class="clearfix"></div> </div> <?php if ($child->is_expanded) {
<?php } ?> </td> </tr> <?php $count++; } } ?> </tbody> </table> </div> </div> <?php if (Acl::check('group.owners')) { $urlRule = getBlogURLRule(); ?> <div id="part-setting-invite" class="part"> <h2 class="caption"><span class="main-text"><?php echo _t('새로운 사람을 블로그의 필진으로 초대합니다'); ?> </span></h2> <?php if (!function_exists('mail') && !getServiceSetting('useCustomSMTP', 0)) { ?> <div class="main-explain-box"> <p class="explain"><?php echo _t('시스템에 자체에서 메일을 보낼 수가 없습니다. 외부 메일 서버를 지정해주세요.'); ?>
if (!Acl::check("group.editors")) { if (getUserIdOfEntry(getBlogId(), $suri['id']) != getUserId()) { Respond::ResultPage(-1); exit; } } if ($isAjaxRequest) { if (deleteEntry($blogid, $suri['id']) === true) { Respond::ResultPage(0); } else { Respond::ResultPage(-1); } } else { deleteEntry($blogid, $suri['id']); header("Location: " . $_SERVER['HTTP_REFERER']); } } else { foreach (explode(',', $_POST['targets']) as $target) { // TeamBlog check if (!Acl::check('group.writers', 'entry.delete.' . $target)) { if (getUserIdOfEntry(getBlogId(), $suri['id']) != getUserId()) { Respond::ResultPage(-1); exit; } } if (!deleteEntry($blogid, $target)) { Respond::ResultPage(-1); } } Respond::ResultPage(0); }
function getRecentComments($blogid, $count = false, $isGuestbook = false, $guestShip = false) { $context = Model_Context::getInstance(); $pool = DBModel::getInstance(); $comments = array(); $pool->init("Comments"); if (!(doesHaveOwnership() && !$guestShip)) { $pool = getPrivateCategoryExclusionQualifier($pool, $blogid); } $pool->setAlias("Comments", "r"); $pool->setAlias("Entries", "e"); $joint = array(array("r.blogid", "eq", "e.blogid"), array("r.entry", "eq", "e.id"), array("e.draft", "eq", 0)); if (doesHaveOwnership() && !$guestShip) { if (!$isGuestbook && !Acl::check("group.editors")) { array_push($joint, array("e.userid", "eq", getUserId())); } $pool->join("Entries", "inner", $joint); $pool->setQualifier("r.blogid", "eq", $blogid); } else { $pool->setAlias("Categories", "c"); $pool->join("Entries", "inner", $joint); $pool->join("Categories", "left outer", array(array("e.blogid", "eq", "c.blogid"), array("e.category", "eq", "c.id"))); $pool->setQualifier("r.blogid", "eq", $blogid); $pool->setQualifier("e.draft", "eq", 0); $pool->setQualifier("e.visibility", ">=", 2); } if ($isGuestbook != false) { $pool->setQualifier("r.entry", "eq", 0); } else { $pool->setQualifier("r.entry", ">", 0); } $pool->setQualifier("r.isfiltered", "eq", 0); $pool->setOrder("r.written", "desc"); $pool->setLimit($count != false ? $count : $context->getProperty('skin.commentsOnRecent')); if ($result = $pool->getAll("r.*, e.title, e.slogan", array("usedbcache" => true, "dbprefix" => 'comment'))) { foreach ($result as $comment) { if ($comment['secret'] == 1 && !doesHaveOwnership()) { if (!doesHaveOpenIDPriv($comment)) { $comment['name'] = _text('비밀방문자'); $comment['homepage'] = ''; $comment['comment'] = _text('관리자만 볼 수 있는 댓글입니다.'); } } array_push($comments, $comment); } } return $comments; }