Bug fixes
This commit is contained in:
parent
bb481498be
commit
5b63241d10
|
@ -23,8 +23,7 @@ checkRole(array('admin'));
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
$themeDirname = $layout['parameters'];
|
$themeDirname = $layout['parameters'];
|
||||||
|
|
||||||
if( Sanitize::pathFile(PATH_THEMES.$themeDirname) ) {
|
if (Sanitize::pathFile(PATH_THEMES.$themeDirname)) {
|
||||||
// Set the theme
|
|
||||||
$site->set(array('theme'=>$themeDirname));
|
$site->set(array('theme'=>$themeDirname));
|
||||||
|
|
||||||
// Add to syslog
|
// Add to syslog
|
||||||
|
|
|
@ -126,7 +126,7 @@ function table($type) {
|
||||||
echo '<td class="pt-3 d-none d-lg-table-cell"><a target="_blank" href="'.$page->permalink().'">'.$friendlyURL.'</a></td>';
|
echo '<td class="pt-3 d-none d-lg-table-cell"><a target="_blank" href="'.$page->permalink().'">'.$friendlyURL.'</a></td>';
|
||||||
|
|
||||||
echo '<td class="pt-3 text-center d-none d-sm-table-cell">'.PHP_EOL;
|
echo '<td class="pt-3 text-center d-none d-sm-table-cell">'.PHP_EOL;
|
||||||
echo '<a type="button" class="btn btn-secondary btn-sm" href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$page->key().'">Edit</a>'.PHP_EOL;
|
echo '<a class="btn btn-secondary btn-sm" href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$page->key().'">Edit</a>'.PHP_EOL;
|
||||||
echo '<button type="button" class="btn btn-secondary btn-sm deletePageButton" data-toggle="modal" data-target="#jsdeletePageModal" data-key="'.$page->key().'"><span class="oi oi-trash"></span> Delete</button>'.PHP_EOL;
|
echo '<button type="button" class="btn btn-secondary btn-sm deletePageButton" data-toggle="modal" data-target="#jsdeletePageModal" data-key="'.$page->key().'"><span class="oi oi-trash"></span> Delete</button>'.PHP_EOL;
|
||||||
echo '</td>';
|
echo '</td>';
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,9 @@ echo Bootstrap::pageTitle(array('title'=>$L->g('Settings'), 'icon'=>'cog'));
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link " id="advanced-tab" data-toggle="tab" href="#advanced" role="tab" aria-controls="advanced" aria-selected="false">Advanced</a>
|
<a class="nav-link " id="advanced-tab" data-toggle="tab" href="#advanced" role="tab" aria-controls="advanced" aria-selected="false">Advanced</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link " id="seo-tab" data-toggle="tab" href="#seo" role="tab" aria-controls="seo" aria-selected="false">SEO</a>
|
||||||
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link " id="social-tab" data-toggle="tab" href="#social" role="tab" aria-controls="social" aria-selected="false">Social Networks</a>
|
<a class="nav-link " id="social-tab" data-toggle="tab" href="#social" role="tab" aria-controls="social" aria-selected="false">Social Networks</a>
|
||||||
</li>
|
</li>
|
||||||
|
@ -158,13 +161,65 @@ echo Bootstrap::pageTitle(array('title'=>$L->g('Settings'), 'icon'=>'cog'));
|
||||||
'placeholder'=>'https://'
|
'placeholder'=>'https://'
|
||||||
));
|
));
|
||||||
|
|
||||||
|
echo Bootstrap::formTitle(array('title'=>$L->g('URL Filters')));
|
||||||
|
|
||||||
|
echo Bootstrap::formInputText(array(
|
||||||
|
'name'=>'uriPage',
|
||||||
|
'label'=>$L->g('Pages'),
|
||||||
|
'value'=>$site->uriFilters('page'),
|
||||||
|
'class'=>'',
|
||||||
|
'placeholder'=>'',
|
||||||
|
'tip'=>DOMAIN_PAGES
|
||||||
|
));
|
||||||
|
|
||||||
|
echo Bootstrap::formInputText(array(
|
||||||
|
'name'=>'uriTag',
|
||||||
|
'label'=>$L->g('Tags'),
|
||||||
|
'value'=>$site->uriFilters('tag'),
|
||||||
|
'class'=>'',
|
||||||
|
'placeholder'=>'',
|
||||||
|
'tip'=>DOMAIN_TAGS
|
||||||
|
));
|
||||||
|
|
||||||
|
echo Bootstrap::formInputText(array(
|
||||||
|
'name'=>'uriCategory',
|
||||||
|
'label'=>$L->g('Category'),
|
||||||
|
'value'=>$site->uriFilters('category'),
|
||||||
|
'class'=>'',
|
||||||
|
'placeholder'=>'',
|
||||||
|
'tip'=>DOMAIN_CATEGORIES
|
||||||
|
));
|
||||||
|
|
||||||
|
echo Bootstrap::formInputText(array(
|
||||||
|
'name'=>'uriBlog',
|
||||||
|
'label'=>$L->g('Blog'),
|
||||||
|
'value'=>$site->uriFilters('blog'),
|
||||||
|
'class'=>'',
|
||||||
|
'placeholder'=>'',
|
||||||
|
'tip'=>DOMAIN.$site->uriFilters('blog'),
|
||||||
|
'disabled'=>!$site->uriFilters('blog')
|
||||||
|
));
|
||||||
|
|
||||||
|
echo '
|
||||||
|
<div class="form-group mt-4">
|
||||||
|
<button type="submit" class="btn btn-primary mr-2" name="save">'.$L->g('Save').'</button>
|
||||||
|
<a class="btn btn-secondary" href="'.HTML_PATH_ADMIN_ROOT.'dashboard" role="button">'.$L->g('Cancel').'</a>
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- TABS SEO -->
|
||||||
|
<div class="tab-pane" id="seo" role="tabpanel" aria-labelledby="seo-tab">
|
||||||
|
<?php
|
||||||
echo Bootstrap::formTitle(array('title'=>$L->g('Extreme friendly URL')));
|
echo Bootstrap::formTitle(array('title'=>$L->g('Extreme friendly URL')));
|
||||||
|
|
||||||
echo Bootstrap::formSelect(array(
|
echo Bootstrap::formSelect(array(
|
||||||
'name'=>'extremeFriendly',
|
'name'=>'extremeFriendly',
|
||||||
'label'=>'Allow Unicode',
|
'label'=>'Allow Unicode',
|
||||||
'options'=>array('true'=>'Enabled', 'false'=>'Disable'),
|
'options'=>array('true'=>'Enabled', 'false'=>'Disable'),
|
||||||
'selected'=>$site->extremeFriendly(),
|
'selected'=>($site->extremeFriendly()?'true':'false'),
|
||||||
'class'=>'',
|
'class'=>'',
|
||||||
'tip'=>'Allow unicode characters in the URL and some part of the system.'
|
'tip'=>'Allow unicode characters in the URL and some part of the system.'
|
||||||
));
|
));
|
||||||
|
@ -211,45 +266,6 @@ echo Bootstrap::pageTitle(array('title'=>$L->g('Settings'), 'icon'=>'cog'));
|
||||||
'placeholder'=>''
|
'placeholder'=>''
|
||||||
));
|
));
|
||||||
|
|
||||||
echo Bootstrap::formTitle(array('title'=>$L->g('URL Filters')));
|
|
||||||
|
|
||||||
echo Bootstrap::formInputText(array(
|
|
||||||
'name'=>'uriPage',
|
|
||||||
'label'=>$L->g('Pages'),
|
|
||||||
'value'=>$site->uriFilters('page'),
|
|
||||||
'class'=>'',
|
|
||||||
'placeholder'=>'',
|
|
||||||
'tip'=>DOMAIN_PAGES
|
|
||||||
));
|
|
||||||
|
|
||||||
echo Bootstrap::formInputText(array(
|
|
||||||
'name'=>'uriTag',
|
|
||||||
'label'=>$L->g('Tags'),
|
|
||||||
'value'=>$site->uriFilters('tag'),
|
|
||||||
'class'=>'',
|
|
||||||
'placeholder'=>'',
|
|
||||||
'tip'=>DOMAIN_TAGS
|
|
||||||
));
|
|
||||||
|
|
||||||
echo Bootstrap::formInputText(array(
|
|
||||||
'name'=>'uriCategory',
|
|
||||||
'label'=>$L->g('Category'),
|
|
||||||
'value'=>$site->uriFilters('category'),
|
|
||||||
'class'=>'',
|
|
||||||
'placeholder'=>'',
|
|
||||||
'tip'=>DOMAIN_CATEGORIES
|
|
||||||
));
|
|
||||||
|
|
||||||
echo Bootstrap::formInputText(array(
|
|
||||||
'name'=>'uriBlog',
|
|
||||||
'label'=>$L->g('Blog'),
|
|
||||||
'value'=>$site->uriFilters('blog'),
|
|
||||||
'class'=>'',
|
|
||||||
'placeholder'=>'',
|
|
||||||
'tip'=>DOMAIN.$site->uriFilters('blog'),
|
|
||||||
'disabled'=>!$site->uriFilters('blog')
|
|
||||||
));
|
|
||||||
|
|
||||||
echo '
|
echo '
|
||||||
<div class="form-group mt-4">
|
<div class="form-group mt-4">
|
||||||
<button type="submit" class="btn btn-primary mr-2" name="save">'.$L->g('Save').'</button>
|
<button type="submit" class="btn btn-primary mr-2" name="save">'.$L->g('Save').'</button>
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -3,42 +3,42 @@
|
||||||
class dbSite extends dbJSON
|
class dbSite extends dbJSON
|
||||||
{
|
{
|
||||||
public $dbFields = array(
|
public $dbFields = array(
|
||||||
'title'=> array('inFile'=>false, 'value'=>'I am Guybrush Threepwood, mighty developer'),
|
'title'=> 'I am Guybrush Threepwood, mighty developer',
|
||||||
'slogan'=> array('inFile'=>false, 'value'=>''),
|
'slogan'=> '',
|
||||||
'description'=> array('inFile'=>false, 'value'=>''),
|
'description'=> '',
|
||||||
'footer'=> array('inFile'=>false, 'value'=>'I wanna be a pirate!'),
|
'footer'=> 'I wanna be a pirate!',
|
||||||
'itemsPerPage'=> array('inFile'=>false, 'value'=>6),
|
'itemsPerPage'=> 6,
|
||||||
'language'=> array('inFile'=>false, 'value'=>'en'),
|
'language'=> 'en',
|
||||||
'locale'=> array('inFile'=>false, 'value'=>'en, en_US, en_AU, en_CA, en_GB, en_IE, en_NZ'),
|
'locale'=> 'en, en_US, en_AU, en_CA, en_GB, en_IE, en_NZ',
|
||||||
'timezone'=> array('inFile'=>false, 'value'=>'America/Argentina/Buenos_Aires'),
|
'timezone'=> 'America/Argentina/Buenos_Aires',
|
||||||
'theme'=> array('inFile'=>false, 'value'=>'pure'),
|
'theme'=> 'pure',
|
||||||
'adminTheme'=> array('inFile'=>false, 'value'=>'default'),
|
'adminTheme'=> 'default',
|
||||||
'homepage'=> array('inFile'=>false, 'value'=>''),
|
'homepage'=> '',
|
||||||
'pageNotFound'=> array('inFile'=>false, 'value'=>''),
|
'pageNotFound'=> '',
|
||||||
'uriPage'=> array('inFile'=>false, 'value'=>'/'),
|
'uriPage'=> '/',
|
||||||
'uriTag'=> array('inFile'=>false, 'value'=>'/tag/'),
|
'uriTag'=> '/tag/',
|
||||||
'uriCategory'=> array('inFile'=>false, 'value'=>'/category/'),
|
'uriCategory'=> '/category/',
|
||||||
'uriBlog'=> array('inFile'=>false, 'value'=>'/blog/'),
|
'uriBlog'=> '/blog/',
|
||||||
'url'=> array('inFile'=>false, 'value'=>''),
|
'url'=> '',
|
||||||
'emailFrom'=> array('inFile'=>false, 'value'=>''),
|
'emailFrom'=> '',
|
||||||
'dateFormat'=> array('inFile'=>false, 'value'=>'F j, Y'),
|
'dateFormat'=> 'F j, Y',
|
||||||
'timeFormat'=> array('inFile'=>false, 'value'=>'g:i a'),
|
'timeFormat'=> 'g:i a',
|
||||||
'currentBuild'=> array('inFile'=>false, 'value'=>0),
|
'currentBuild'=> 0,
|
||||||
'twitter'=> array('inFile'=>false, 'value'=>''),
|
'twitter'=> '',
|
||||||
'facebook'=> array('inFile'=>false, 'value'=>''),
|
'facebook'=> '',
|
||||||
'codepen'=> array('inFile'=>false, 'value'=>''),
|
'codepen'=> '',
|
||||||
'googlePlus'=> array('inFile'=>false, 'value'=>''),
|
'googlePlus'=> '',
|
||||||
'instagram'=> array('inFile'=>false, 'value'=>''),
|
'instagram'=> '',
|
||||||
'github'=> array('inFile'=>false, 'value'=>''),
|
'github'=> '',
|
||||||
'gitlab'=> array('inFile'=>false, 'value'=>''),
|
'gitlab'=> '',
|
||||||
'linkedin'=> array('inFile'=>false, 'value'=>''),
|
'linkedin'=> '',
|
||||||
'orderBy'=> array('inFile'=>false, 'value'=>'date'), // date or position
|
'orderBy'=> 'date', // date or position
|
||||||
'extremeFriendly'=> array('inFile'=>false, 'value'=>true),
|
'extremeFriendly'=> true,
|
||||||
'autosaveInterval'=> array('inFile'=>false, 'value'=>2),
|
'autosaveInterval'=> 2, // minutes
|
||||||
'titleFormatHomepage'=> array('inFile'=>false, 'value'=>'{{site-slogan}} | {{site-title}}'),
|
'titleFormatHomepage'=> '{{site-slogan}} | {{site-title}}',
|
||||||
'titleFormatPages'=> array('inFile'=>false, 'value'=>'{{page-title}} | {{site-title}}'),
|
'titleFormatPages'=> '{{page-title}} | {{site-title}}',
|
||||||
'titleFormatCategory'=> array('inFile'=>false, 'value'=>'{{category-name}} | {{site-title}}'),
|
'titleFormatCategory'=> '{{category-name}} | {{site-title}}',
|
||||||
'titleFormatTag'=> array('inFile'=>false, 'value'=>'{{tag-name}} | {{site-title}}')
|
'titleFormatTag'=> '{{tag-name}} | {{site-title}}'
|
||||||
);
|
);
|
||||||
|
|
||||||
function __construct()
|
function __construct()
|
||||||
|
@ -60,12 +60,15 @@ class dbSite extends dbJSON
|
||||||
|
|
||||||
public function set($args)
|
public function set($args)
|
||||||
{
|
{
|
||||||
foreach ($args as $field=>$value) {
|
// Check values on args or set default values
|
||||||
if (isset($this->dbFields[$field])) {
|
foreach ($this->dbFields as $field=>$value) {
|
||||||
$this->db[$field] = Sanitize::html($value);
|
if (isset($args[$field])) {
|
||||||
|
// Sanitize if will be stored on database
|
||||||
|
$finalValue = Sanitize::html($args[$field]);
|
||||||
|
settype($finalValue, gettype($value));
|
||||||
|
$this->db[$field] = $finalValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->save();
|
return $this->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -568,6 +568,8 @@ function editSettings($args) {
|
||||||
$args['uriBlog'] = '';
|
$args['uriBlog'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$args['extremeFriendly'] = (($args['extremeFriendly']=='true')?true:false);
|
||||||
|
|
||||||
if ($site->set($args)) {
|
if ($site->set($args)) {
|
||||||
// Check current order-by if changed it reorder the content
|
// Check current order-by if changed it reorder the content
|
||||||
if ($site->orderBy()!=ORDER_BY) {
|
if ($site->orderBy()!=ORDER_BY) {
|
||||||
|
|
File diff suppressed because one or more lines are too long
15
install.php
15
install.php
|
@ -317,7 +317,7 @@ function install($adminPassword, $timezone)
|
||||||
'description'=>'',
|
'description'=>'',
|
||||||
'username'=>'admin',
|
'username'=>'admin',
|
||||||
'tags'=>array(),
|
'tags'=>array(),
|
||||||
'type'=>'published',
|
'type'=>(($slug=='example-page-4-slug')?'static':'published'),
|
||||||
'date'=>$currentDate,
|
'date'=>$currentDate,
|
||||||
'dateModified'=>'',
|
'dateModified'=>'',
|
||||||
'allowComments'=>true,
|
'allowComments'=>true,
|
||||||
|
@ -378,7 +378,11 @@ function install($adminPassword, $timezone)
|
||||||
'linkedin'=>'',
|
'linkedin'=>'',
|
||||||
'dateFormat'=>'F j, Y',
|
'dateFormat'=>'F j, Y',
|
||||||
'extremeFriendly'=>true,
|
'extremeFriendly'=>true,
|
||||||
'autosaveInterval'=>2
|
'autosaveInterval'=>2,
|
||||||
|
'titleFormatHomepage'=>'{{site-slogan}} | {{site-title}}',
|
||||||
|
'titleFormatPages'=>'{{page-title}} | {{site-title}}',
|
||||||
|
'titleFormatCategory'=>'{{category-name}} | {{site-title}}',
|
||||||
|
'titleFormatTag'=>'{{tag-name}} | {{site-title}}'
|
||||||
);
|
);
|
||||||
file_put_contents(PATH_DATABASES.'site.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX);
|
file_put_contents(PATH_DATABASES.'site.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX);
|
||||||
|
|
||||||
|
@ -389,6 +393,7 @@ function install($adminPassword, $timezone)
|
||||||
|
|
||||||
$data = array(
|
$data = array(
|
||||||
'admin'=>array(
|
'admin'=>array(
|
||||||
|
'nickname'=>'Admin',
|
||||||
'firstName'=>$Language->get('Administrator'),
|
'firstName'=>$Language->get('Administrator'),
|
||||||
'lastName'=>'',
|
'lastName'=>'',
|
||||||
'role'=>'admin',
|
'role'=>'admin',
|
||||||
|
@ -402,7 +407,11 @@ function install($adminPassword, $timezone)
|
||||||
'twitter'=>'',
|
'twitter'=>'',
|
||||||
'facebook'=>'',
|
'facebook'=>'',
|
||||||
'googlePlus'=>'',
|
'googlePlus'=>'',
|
||||||
'instagram'=>''
|
'instagram'=>'',
|
||||||
|
'codepen'=>'',
|
||||||
|
'linkedin'=>'',
|
||||||
|
'github'=>'',
|
||||||
|
'gitlab'=>''
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
file_put_contents(PATH_DATABASES.'users.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX);
|
file_put_contents(PATH_DATABASES.'users.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX);
|
||||||
|
|
36
things-to-do
36
things-to-do
|
@ -6,25 +6,29 @@ Things to do:
|
||||||
- settings->advanced->Predefined pages->Page not found
|
- settings->advanced->Predefined pages->Page not found
|
||||||
-- Search and select a page
|
-- Search and select a page
|
||||||
|
|
||||||
- settings->plugins->settings
|
|
||||||
-- Update plugins to use Bootstrap on the CSS
|
|
||||||
|
|
||||||
- settings->plugins->change order of plugins
|
|
||||||
-- not implemented
|
|
||||||
|
|
||||||
- manage->users->edit user
|
- manage->users->edit user
|
||||||
-- Change profile avatar
|
-- Change profile avatar
|
||||||
|
|
||||||
- new content -> options -> Advanced
|
- Add to Settings
|
||||||
-- Date, javascript for select the date
|
|
||||||
--
|
|
||||||
|
|
||||||
- Fix Tinymce plugin
|
|
||||||
|
|
||||||
- Edit content
|
|
||||||
-- If the parent is set, the
|
|
||||||
|
|
||||||
- add to settings
|
|
||||||
-- time for autosave
|
-- time for autosave
|
||||||
-- time for check user logged
|
-- time for check user logged
|
||||||
-- thumbnails sizes and compression
|
-- thumbnails sizes and compression
|
||||||
|
|
||||||
|
- Plugin Links
|
||||||
|
-- Update CSS for Bootstrap
|
||||||
|
|
||||||
|
- Plugin sitemap
|
||||||
|
-- Update CSS for Bootstrap
|
||||||
|
|
||||||
|
- Plugin remote content
|
||||||
|
-- Refactor with the new database
|
||||||
|
|
||||||
|
- Filter by tags is not working
|
||||||
|
|
||||||
|
- Plugin timemachine
|
||||||
|
-- Update CSS for Bootstrap
|
||||||
|
|
||||||
|
- Plugin updater
|
||||||
|
|
||||||
|
- Cover Image
|
||||||
|
-- Check better way to select an image
|
Loading…
Reference in New Issue