bludit/bl-kernel/admin/controllers/dashboard.php

112 lines
2.8 KiB
PHP
Raw Normal View History

2015-06-26 06:31:53 +02:00
<?php defined('BLUDIT') or die('Bludit CMS.');
2015-03-27 02:00:01 +01:00
2015-06-26 06:31:53 +02:00
// ============================================================================
// Functions
// ============================================================================
2017-05-16 00:46:20 +02:00
// function updateBludit()
// {
// global $Site;
// global $dbPosts;
// global $dbPages;
// // Check if Bludit need to be update.
// if( ($Site->currentBuild() < BLUDIT_BUILD) || isset($_GET['update']) )
// {
// // LOG
// Log::set('UPDATE SYSTEM - Starting...');
// // LOG
// Log::set('UPDATE SYSTEM - Checking posts.');
// // Update posts
// foreach($dbPosts->db as $key=>$post) {
// // Dates
// $date = Date::format($post['date'], 'Y-m-d H:i', DB_DATE_FORMAT);
// if($date !== false) {
// $dbPosts->setPostDb($key, 'date', $date);
// }
// // Checksum
// if( empty($post['md5file']) ) {
// $checksum = md5_file(PATH_POSTS.$key.DS.FILENAME);
// $dbPosts->setPostDb($key, 'md5file', $checksum);
// }
// }
// $dbPosts->save();
// // LOG
// Log::set('UPDATE SYSTEM - Checking pages.');
// // Update pages
// foreach($dbPages->db as $key=>$page) {
// $date = Date::format($page['date'], 'Y-m-d H:i', DB_DATE_FORMAT);
// if($date !== false) {
// $dbPages->setField($key, 'date', $date);
// }
// // Checksum
// if( empty($post['md5file']) ) {
// $checksum = md5_file(PATH_PAGES.$key.DS.FILENAME);
// $dbPages->setField($key, 'md5file', $checksum);
// }
// }
// $dbPages->save();
// // LOG
// Log::set('UPDATE SYSTEM - Checking directories.');
// // --- Update directories ---
// $directories = array(
// PATH_POSTS,
// PATH_PAGES,
// PATH_PLUGINS_DATABASES,
// PATH_UPLOADS_PROFILES,
// PATH_UPLOADS_THUMBNAILS,
// PATH_TMP
// );
// foreach($directories as $dir) {
// // Check if the directory is already created.
// if(!file_exists($dir)) {
// // Create the directory recursive.
// mkdir($dir, DIR_PERMISSIONS, true);
// }
// }
// // Set and save the database.
// $Site->set(array('currentBuild'=>BLUDIT_BUILD));
// // LOG
// Log::set('UPDATE SYSTEM - Updated...');
// }
// }
2015-03-27 02:00:01 +01:00
2015-08-03 02:49:12 +02:00
// ============================================================================
// Main before POST
// ============================================================================
2015-06-26 06:31:53 +02:00
// ============================================================================
// POST Method
// ============================================================================
// ============================================================================
2015-08-03 02:49:12 +02:00
// Main after POST
2015-06-26 06:31:53 +02:00
// ============================================================================
// Try update Bludit
2017-05-16 00:46:20 +02:00
//updateBludit();
2015-07-27 02:29:47 +02:00
// Get draft pages
2015-07-27 02:29:47 +02:00
$_draftPages = array();
foreach($pages as $Page)
{
if(!$Page->published()) {
array_push($_draftPages, $Page);
}
2015-08-29 07:02:09 +02:00
}