function deletePage($key) { global $dbPages; global $Language; if ($dbPages->delete($key)) { // Call the plugins after post created. Theme::plugins('afterPageDelete'); Alert::set($Language->g('The page has been deleted successfully')); Redirect::page('admin', 'manage-pages'); } else { Log::set(__METHOD__ . LOG_SEP . 'Error occurred when trying to delete the page.'); } }
function deletePost($key) { global $dbPosts; global $Language; if ($dbPosts->delete($key)) { // Reindex tags, this function is in 70.posts.php reIndexTagsPosts(); // Call the plugins after post created. Theme::plugins('afterPostDelete'); Alert::set($Language->g('The post has been deleted successfully')); Redirect::page('admin', 'manage-posts'); } else { Log::set(__METHOD__ . LOG_SEP . 'Error occurred when trying to delete the post.'); } }
function addPage($args) { global $dbPages; global $Language; // Add the page, if the $key is FALSE the creation of the post failure. $key = $dbPages->add($args); if ($key) { // Call the plugins after page created. Theme::plugins('afterPageCreate'); // Alert the user Alert::set($Language->g('Page added successfully')); Redirect::page('admin', 'manage-pages'); } else { Log::set(__METHOD__ . LOG_SEP . 'Error occurred when trying to create the page.'); } }
function addPost($args) { global $dbPosts; global $Language; // Add the page, if the $key is FALSE the creation of the post failure. $key = $dbPosts->add($args); if ($key) { // Reindex tags, this function is in 70.posts.php reIndexTagsPosts(); // Call the plugins after post created. Theme::plugins('afterPostCreate'); // Alert for the user Alert::set($Language->g('Post added successfully')); Redirect::page('admin', 'manage-posts'); } else { Log::set(__METHOD__ . LOG_SEP . 'Error occurred when trying to create the post.'); } return false; }
<?php echo $Post->content(); ?> <div class="foot-post"> <div class="units-row"> <div class="unit-100"> <strong><?php $Language->p('Tags'); ?> </strong> <?php $links = array(); $tags = $Post->tags(true); foreach ($tags as $tagKey => $tagName) { $links[] = '<a href="' . HTML_PATH_ROOT . $Url->filters('tag') . '/' . $tagKey . '">' . $tagName . '</a>'; } echo implode(', ', $links); ?> </div> </div> </div> <!-- Plugins Post End --> <?php Theme::plugins('postEnd'); ?> </div> <!-- /post -->
Theme::plugins('pageBegin'); ?> <!-- Post's header --> <header> <div class="title"> <h2><a href="<?php echo $Page->permalink(); ?> "><?php echo $Page->title(); ?> </a></h2> <p><?php echo $Page->description(); ?> </p> </div> </header> <!-- Post's content, the first part if has pagebrake --> <?php echo $Page->content(); ?> <!-- Plugins Page End --> <?php Theme::plugins('pageEnd'); ?> </article>
?> </head> <body class="uk-height-1-1"> <!-- Plugins --> <?php Theme::plugins('loginBodyBegin'); ?> <div class="uk-vertical-align uk-text-center uk-height-1-1"> <div class="uk-vertical-align-middle login-box"> <h1>BLUDIT</h1> <?php if (Alert::defined()) { echo '<div class="uk-alert uk-alert-danger">' . Alert::get() . '</div>'; } if (Sanitize::pathFile(PATH_ADMIN_VIEWS, $layout['view'] . '.php')) { include PATH_ADMIN_VIEWS . $layout['view'] . '.php'; } ?> </div> </div> <!-- Plugins --> <?php Theme::plugins('loginBodyEnd'); ?> </body> </html>
echo HTML_PATH_ADMIN_ROOT . 'about'; ?> "><?php $L->p('About'); ?> </a></li> </ul> </div> </div> <!-- View --> <div class="uk-container uk-container-center"> <?php if (Sanitize::pathFile(PATH_ADMIN_VIEWS, $layout['view'] . '.php')) { include PATH_ADMIN_VIEWS . $layout['view'] . '.php'; } ?> </div> <!-- Javascript --> <?php include PATH_JS . 'functions.php'; ?> <!-- Plugins --> <?php Theme::plugins('adminBodyEnd'); ?> </body> </html>
if ($Url->whereAmI() == 'home') { include 'php/home.php'; } elseif ($Url->whereAmI() == 'post') { include 'php/post.php'; } elseif ($Url->whereAmI() == 'page') { include 'php/page.php'; } ?> </div> <!-- Footer --> <div class="footer"> <p><?php echo $Site->footer(); ?> | <?php echo $Language->get('Powered by'); ?> <a target="_blank" href="http://www.bludit.com">Bludit</a></p> </div> </div> <!-- Plugins Site Body End --> <?php Theme::plugins('siteBodyEnd'); ?> </body> </html>
</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content="<?php echo $Site->description(); ?> "> <meta name="author" content="Bludit - Theme design by Afnizar Nur Ghifari"> <?php // <meta name="keywords" content="HTML,CSS,XML,JavaScript"> if ($Url->whereAmI() == 'post') { Theme::keywords($Post->tags()); } elseif ($Url->whereAmI() == 'page') { Theme::keywords($Page->tags()); } /* <link rel="stylesheet" href="css/kube.min.css" /> <link rel="stylesheet" href="css/font-awesome.min.css" /> <link rel="stylesheet" href="css/custom.min.css" /> */ Theme::css(array('kube.min.css', 'font-awesome.min.css', 'custom.css')); /* <link href="http://fonts.googleapis.com/css?family=Lato:400,700" rel="stylesheet" type="text/css"> <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,700" rel="stylesheet" type="text/css"> */ Theme::css(array('http://fonts.googleapis.com/css?family=Lato:400,700', 'http://fonts.googleapis.com/css?family=Open+Sans:400,700'), false); Theme::favicon(); // Plugins Site Head Theme::plugins('siteHead');
<div class="sidebar-content"> <h1 class="title"><?php echo $Site->title(); ?> </h1> <h2 class="slogan"><?php echo $Site->slogan(); ?> </h2> <!-- Plugins Sidebar --> <?php Theme::plugins('siteSidebar'); ?> </div>
<?php defined('BLUDIT') or die('Bludit CMS.'); // Boot rules include PATH_RULES . '70.posts.php'; include PATH_RULES . '70.pages.php'; include PATH_RULES . '80.plugins.php'; include PATH_RULES . '99.header.php'; include PATH_RULES . '99.paginator.php'; include PATH_RULES . '99.themes.php'; // Plugins before site loaded Theme::plugins('beforeSiteLoad'); // Theme init.php if (Sanitize::pathFile(PATH_THEMES, $Site->theme() . DS . 'init.php')) { include PATH_THEMES . $Site->theme() . DS . 'init.php'; } // Theme HTML if (Sanitize::pathFile(PATH_THEMES, $Site->theme() . DS . 'index.php')) { include PATH_THEMES . $Site->theme() . DS . 'index.php'; } else { $Language->p('Please check your theme configuration'); } // Plugins after site loaded Theme::plugins('afterSiteLoad');
// User not logged. // Slug is login. // Slug is login-email. if ($Url->notFound() || !$Login->isLogged() || $Url->slug() === 'login' || $Url->slug() === 'login-email') { $layout['controller'] = 'login'; $layout['view'] = 'login'; $layout['template'] = 'login.php'; if ($Url->slug() === 'login-email') { $layout['controller'] = 'login-email'; $layout['view'] = 'login-email'; } // Generate the tokenCSRF for the user not logged, when the user log-in the token will be change. $Security->generateTokenCSRF(); } // Load plugins before the admin area will be load. Theme::plugins('beforeAdminLoad'); // Load init.php if the theme has one. if (Sanitize::pathFile(PATH_ADMIN_THEMES, $Site->adminTheme() . DS . 'init.php')) { include PATH_ADMIN_THEMES . $Site->adminTheme() . DS . 'init.php'; } // Load controller. if (Sanitize::pathFile(PATH_ADMIN_CONTROLLERS, $layout['controller'] . '.php')) { include PATH_ADMIN_CONTROLLERS . $layout['controller'] . '.php'; } // Load view and theme. if (Sanitize::pathFile(PATH_ADMIN_THEMES, $Site->adminTheme() . DS . $layout['template'])) { include PATH_ADMIN_THEMES . $Site->adminTheme() . DS . $layout['template']; } // Load plugins after the admin area is loaded. Theme::plugins('afterAdminLoad'); }
// Functions // ============================================================================ // ============================================================================ // Main before POST // ============================================================================ $_Plugin = false; $pluginClassName = $layout['parameters']; foreach ($plugins['all'] as $P) { if ($P->className() == $pluginClassName) { $_Plugin = $P; } } // Check if the plugin exists. if ($_Plugin === false) { Redirect::page('admin', 'plugins'); } // Check if the plugin has the method form() if (!method_exists($_Plugin, 'form')) { Redirect::page('admin', 'plugins'); } // ============================================================================ // POST Method // ============================================================================ if ($_SERVER['REQUEST_METHOD'] == 'POST') { $_Plugin->setDb($_POST); Theme::plugins('afterFormSave'); Alert::set($Language->g('the-changes-have-been-saved')); } // ============================================================================ // Main after POST // ============================================================================