Skip to content

Commit

Permalink
Merge pull request #2 from bludit/bluditv2
Browse files Browse the repository at this point in the history
Bluditv2
  • Loading branch information
clickwork-git committed Oct 9, 2017
2 parents 0408dcb + 62f81d7 commit 08ad590
Show file tree
Hide file tree
Showing 166 changed files with 15,336 additions and 15,363 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

// Check if out of range the pageNumber
if (empty($published) && $Url->pageNumber()>1) {
Redirect::page('pages');
Redirect::page('content');
}

// List of drafts pages
Expand All @@ -39,4 +39,4 @@
$static = $dbPages->getStaticDB();

// Title of the page
$layout['title'] .= ' - '.$Language->g('Manage Pages');
$layout['title'] .= ' - '.$Language->g('Manage content');
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
if( isset($_POST['delete-page']) ) {
if( deletePage($_POST['key']) ) {
Alert::set( $Language->g('The changes have been saved') );
Redirect::page('pages');
Redirect::page('content');
}
}
else {
$key = editPage($_POST);
if( $key!==false ) {
Alert::set( $Language->g('The changes have been saved') );
Redirect::page('edit-page/'.$key);
Redirect::page('edit-content/'.$key);
}
}

Redirect::page('pages');
Redirect::page('content');
}

// ============================================================================
Expand All @@ -41,8 +41,8 @@
$page = buildPage($pageKey);
if ($page===false) {
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to get the page: '.$pageKey);
Redirect::page('pages');
Redirect::page('content');
}

// Title of the page
$layout['title'] .= ' - '.$Language->g('Edit page').' - '.$page->title();
$layout['title'] .= ' - '.$Language->g('Edit content').' - '.$page->title();
3 changes: 1 addition & 2 deletions bl-kernel/admin/controllers/logout.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
// Main after POST
// ============================================================================

if( $Login->logout())
{
if ($Login->logout()) {
Redirect::home();
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@

if ($_SERVER['REQUEST_METHOD'] == 'POST') {
createPage($_POST);
Redirect::page('pages');
Redirect::page('content');
}

// ============================================================================
// Main after POST
// ============================================================================

// Title of the page
$layout['title'] .= ' - '.$Language->g('New page');
$layout['title'] .= ' - '.$Language->g('New content');
2 changes: 1 addition & 1 deletion bl-kernel/admin/controllers/settings-advanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
$allPublishedPages = buildAllpages(true);

// Homepage select options
$homepageOptions = array();
$homepageOptions = array(' '=>'- '.$L->g('Latest content').' -');
foreach($allPublishedPages as $key=>$page) {
$parentKey = $page->parentKey();
if ($parentKey) {
Expand Down
16 changes: 8 additions & 8 deletions bl-kernel/admin/themes/default/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
<div class="uk-offcanvas-bar">
<ul class="uk-nav uk-nav-offcanvas">
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'dashboard' ?>"><?php $L->p('Dashboard') ?></a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'new-page' ?>"><?php $L->p('New page') ?></a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'manage-pages' ?>"><?php $L->p('Manage pages') ?></a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'new-content' ?>"><?php $L->p('New content') ?></a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'content' ?>"><?php $L->p('Manage content') ?></a></li>
<?php if($Login->role() == 'admin') { ?>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'categories' ?>"><?php $L->p('Manage categories') ?></a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'users' ?>"><?php $L->p('Manage users') ?></a></li>
Expand Down Expand Up @@ -102,13 +102,13 @@
</li>

<li class="uk-nav-header"><?php $L->p('Publish') ?></li>
<li <?php echo ($layout['view']=='new-page')?'class="uk-active"':'' ?>>
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'new-page' ?>"><?php $L->p('New page') ?></a>
<li <?php echo ($layout['view']=='new-content')?'class="uk-active"':'' ?>>
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'new-content' ?>"><?php $L->p('New content') ?></a>
</li>

<li class="uk-nav-header"><?php $L->p('Manage') ?></li>
<li <?php echo ($layout['view']=='pages')?'class="uk-active"':'' ?>>
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'pages' ?>"><?php $L->p('Pages') ?></a>
<li <?php echo ($layout['view']=='content')?'class="uk-active"':'' ?>>
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'content' ?>"><?php $L->p('Content') ?></a>
</li>
<li <?php echo ($layout['view']=='categories')?'class="uk-active"':'' ?>>
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'categories' ?>"><?php $L->p('Categories') ?></a>
Expand Down Expand Up @@ -145,8 +145,8 @@
if( Sanitize::pathFile(PATH_ADMIN_VIEWS, $layout['view'].'.php') ) {
include(PATH_ADMIN_VIEWS.$layout['view'].'.php');
} else {
echo '<h1 style="width:100%; text-align:center">Hey!</h1>';
echo '<h2 style="width:100%; text-align:center">Have you seen my ball?</h2>';
echo '<h1 style="width:100%; text-align:center">'.$L->g('Page not found').'</h1>';
echo '<h2 style="width:100%; text-align:center">'.$L->g('Have you seen my ball').'</h2>';
}
?>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

HTML::title(array('title'=>$L->g('Manage pages'), 'icon'=>'folder'));
HTML::title(array('title'=>$L->g('Manage content'), 'icon'=>'folder'));

echo '<a href="'.HTML_PATH_ADMIN_ROOT.'new-page"><i class="uk-icon-plus"></i> '.$L->g('Add new page').'</a>';
echo '<a href="'.HTML_PATH_ADMIN_ROOT.'new-content"><i class="uk-icon-plus"></i> '.$L->g('Add new content').'</a>';

echo '
<table class="uk-table uk-table-striped">
Expand Down Expand Up @@ -50,7 +50,7 @@ function table($status, $icon='arrow-circle-o-down') {
$page = buildPage($pageKey);
echo '<tr>';
echo '<td>
<a href="'.HTML_PATH_ADMIN_ROOT.'edit-page/'.$page->key().'">'
<a href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$page->key().'">'
.($page->title()?$page->title():'<span class="label-empty-title">'.$Language->g('Empty title').'</span> ')
.'</a>
</td>';
Expand Down Expand Up @@ -82,9 +82,9 @@ function table($status, $icon='arrow-circle-o-down') {
<?php
// Show previus page link
if(Paginator::showPrev()) {
echo '<li><a href="'.Paginator::prevPageUrl().'" class="previous"><i class="fa fa-arrow-circle-o-left"></i> Previous</a></li>';
echo '<li><a href="'.Paginator::prevPageUrl().'" class="previous"><i class="fa fa-arrow-circle-o-left"></i> '.$Language->g('Previous').'</a></li>';
} else {
echo '<li class="disabled"><i class="fa fa-arrow-circle-o-left"></i> Previous</li>';
echo '<li class="disabled"><i class="fa fa-arrow-circle-o-left"></i> '.$Language->g('Previous').'</li>';
}

for($i=1; $i<=Paginator::amountOfPages(); $i++) {
Expand All @@ -93,9 +93,9 @@ function table($status, $icon='arrow-circle-o-down') {

// Show next page link
if(Paginator::showNext()) {
echo '<li><a href="'.Paginator::nextPageUrl().'" class="next">Next <i class="fa fa-arrow-circle-o-right"></i></a></li>';
echo '<li><a href="'.Paginator::nextPageUrl().'" class="next">'.$Language->g('Next').' <i class="fa fa-arrow-circle-o-right"></i></a></li>';
} else {
echo '<li class="disabled">Next <i class="fa fa-arrow-circle-o-right"></i></li>';
echo '<li class="disabled">'.$Language->g('Next').' <i class="fa fa-arrow-circle-o-right"></i></li>';
}
?>
</ul>
Expand Down
29 changes: 16 additions & 13 deletions bl-kernel/admin/views/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<div class="uk-width-medium-1-3">

<div class="uk-panel">
<h4><a href="<?php echo HTML_PATH_ADMIN_ROOT.'new-page' ?>"><i class="uk-icon-pencil"></i> <?php $L->p('New page') ?></a></h4>
<p><?php $L->p('Create a new page for your site') ?></p>
<h4><a href="<?php echo HTML_PATH_ADMIN_ROOT.'new-content' ?>"><i class="uk-icon-pencil"></i> <?php $L->p('New content') ?></a></h4>
<p><?php $L->p('Create new content for your site') ?></p>
</div>

<div class="uk-panel">
<h4><a href="<?php echo HTML_PATH_ADMIN_ROOT.'pages' ?>"><i class="uk-icon-folder-o"></i> <?php $L->p('Manage pages') ?></a></h4>
<p><?php $L->p('Edit or delete pages from your site') ?></p>
<h4><a href="<?php echo HTML_PATH_ADMIN_ROOT.'content' ?>"><i class="uk-icon-folder-o"></i> <?php $L->p('Manage content') ?></a></h4>
<p><?php $L->p('Edit or delete content from your site') ?></p>
</div>

</div>
Expand All @@ -19,7 +19,7 @@

<div class="uk-panel">
<h4><a href="<?php echo HTML_PATH_ADMIN_ROOT.'new-category' ?>"><i class="uk-icon-file-text-o"></i> <?php $L->p('New category') ?></a></h4>
<p><?php $L->p('Create a new category to organize your pages') ?></p>
<p><?php $L->p('Create a new category to organize your content') ?></p>
</div>

<div class="uk-panel">
Expand Down Expand Up @@ -99,18 +99,18 @@
<div class="uk-width-1-3">

<div class="uk-panel">
<h4 class="panel-title"><?php $L->p('Scheduled pages') ?></h4>
<h4 class="panel-title"><?php $L->p('Scheduled content') ?></h4>
<ul class="uk-list">
<?php
$scheduledPages = $dbPages->getScheduledDB();
if( empty($scheduledPages) ) {
echo '<li>'.$Language->g('There are no scheduled pages').'</li>';
echo '<li>'.$Language->g('There are no scheduled content').'</li>';
}
else {
$keys = array_keys($scheduledPages);
foreach($keys as $key) {
$page = buildPage($key);
echo '<li><span class="label-time">'.$page->dateRaw(SCHEDULED_DATE_FORMAT).'</span><a href="'.HTML_PATH_ADMIN_ROOT.'edit-page/'.$page->key().'">'.($page->title()?$page->title():'['.$Language->g('Empty title').'] ').'</a></li>';
echo '<li><span class="label-time">'.$page->dateRaw(SCHEDULED_DATE_FORMAT).'</span><a href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$page->key().'">'.($page->title()?$page->title():'['.$Language->g('Empty title').'] ').'</a></li>';
}
}
?>
Expand All @@ -122,10 +122,13 @@
<table class="uk-table statistics">
<tbody>
<tr>
<td><?php $Language->p('Pages') ?></td>
<td><?php echo $dbPages->count() ?></td>
<td><?php $Language->p('Published') ?></td>
<td><?php echo count($dbPages->getPublishedDB()) ?></td>
</tr>
<tr>
<td><?php $Language->p('Static') ?></td>
<td><?php echo count($dbPages->getStaticDB()) ?></td>
</tr>
<td><?php $Language->p('Users') ?></td>
<td><?php echo $dbUsers->count() ?></td>
</tr>
Expand All @@ -138,18 +141,18 @@
<div class="uk-width-1-3">

<div class="uk-panel">
<h4 class="panel-title"><?php $L->p('Drafts') ?></h4>
<h4 class="panel-title"><?php $L->p('Draft content') ?></h4>
<ul class="uk-list">
<?php
$draftPages = $dbPages->getDraftDB();
if( empty($draftPages) ) {
echo '<li>'.$Language->g('There are no draft pages').'</li>';
echo '<li>'.$Language->g('There are no draft content').'</li>';
}
else {
$keys = array_keys($draftPages);
foreach($keys as $key) {
$page = buildPage($key);
echo '<li><a href="'.HTML_PATH_ADMIN_ROOT.'edit-page/'.$page->key().'">'.($page->title()?$page->title():'['.$Language->g('Empty title').'] ').'</a></li>';
echo '<li><a href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$page->key().'">'.($page->title()?$page->title():'['.$Language->g('Empty title').'] ').'</a></li>';
}
}
?>
Expand Down
30 changes: 23 additions & 7 deletions bl-kernel/admin/views/developers.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,35 @@

echo '<h2>PHP version: '.phpversion().'</h2>';

// PHP Ini
$uploadOptions = array(
'upload_max_filesize'=>ini_get('upload_max_filesize'),
'post_max_size'=>ini_get('post_max_size'),
'upload_tmp_dir'=>ini_get('upload_tmp_dir')
);
printTable('File Uploads', $uploadOptions);

// Loaded extensions
printTable('Server information', $_SERVER);
printTable('Server information ( $_SERVER )', $_SERVER);

// Constanst defined by Bludit
$constants = get_defined_constants(true);
printTable('Constants', $constants['user']);
// PHP Ini
printTable('PHP Configuration options ( ini_get_all() )', ini_get_all());

// Loaded extensions
printTable('Loaded extensions',get_loaded_extensions());

// Site object
printTable('$Site object database',$Site->db);

// Locales installed
exec('locale -a', $locales);
printTable('Locales installed', $locales);

echo '<hr>';
echo '<h2>BLUDIT</h2>';
echo '<hr>';

// Constanst defined by Bludit
$constants = get_defined_constants(true);
printTable('Bludit Constants', $constants['user']);

// Site object
printTable('$Site object database',$Site->db);

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

HTML::title(array('title'=>$L->g('Edit page'), 'icon'=>'file-text-o'));
HTML::title(array('title'=>$L->g('Edit content'), 'icon'=>'file-text-o'));

HTML::formOpen(array('class'=>'uk-form-stacked'));

Expand Down Expand Up @@ -47,7 +47,7 @@
if(count($page->children())===0)
{
echo ' <button id="jsdelete" name="delete-page" class="uk-button" type="submit">'.$L->g('Delete').'</button>';
echo ' <a class="uk-button" href="'.HTML_PATH_ADMIN_ROOT.'pages">'.$L->g('Cancel').'</a>';
echo ' <a class="uk-button" href="'.HTML_PATH_ADMIN_ROOT.'content">'.$L->g('Cancel').'</a>';
}

echo '</div>';
Expand Down Expand Up @@ -154,14 +154,16 @@
'name'=>'date',
'value'=>$page->dateRaw(),
'class'=>'uk-width-1-1 uk-form-medium',
'tip'=>$L->g('To schedule the page select the date and time'),
'tip'=>$L->g('To schedule the content select the date and time'),
'label'=>$L->g('Date')
));

echo '<hr>';

// Parent input
// Check if the page has children
if(count($page->children())==0) {
$options = array();
$options = array(' '=>'- '.$L->g('No parent').' -');
$parentsList = $dbPages->getParents();
$parentsKey = array_keys($parentsList);
foreach($parentsKey as $pageKey) {
Expand All @@ -176,20 +178,23 @@
'class'=>'uk-width-1-1 uk-form-medium',
'options'=>$options,
'selected'=>$page->parentKey(),
'tip'=>'',
'addEmptySpace'=>true
'tip'=>''
));
}

echo '<hr>';

// Position input
HTML::formInputText(array(
'name'=>'position',
'value'=>$page->position(),
'class'=>'uk-width-1-1 uk-form-medium',
'label'=>$L->g('Position'),
'tip'=>$L->g('This field is used when you order the pages by position')
'tip'=>$L->g('This field is used when you order the content by position')
));

echo '<hr>';

// External Coverimage
HTML::formInputText(array(
'name'=>'externalCoverImage',
Expand All @@ -199,12 +204,14 @@
'tip'=>$L->g('Full image URL')
));

echo '<hr>';

// Slug input
HTML::formInputText(array(
'name'=>'slug',
'value'=>$page->slug(),
'class'=>'uk-width-1-1 uk-form-medium',
'tip'=>$L->g('URL associated with the page'),
'tip'=>$L->g('URL associated with the content'),
'label'=>$L->g('Friendly URL')
));

Expand Down

0 comments on commit 08ad590

Please sign in to comment.