changes variables names
This commit is contained in:
parent
b04587813e
commit
077bc21434
|
@ -28,6 +28,11 @@ class dbList extends dbJSON
|
||||||
parent::__construct($file);
|
parent::__construct($file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function keys()
|
||||||
|
{
|
||||||
|
return array_keys($this->db);
|
||||||
|
}
|
||||||
|
|
||||||
// Returns the list of keys filter by pageNumber
|
// Returns the list of keys filter by pageNumber
|
||||||
public function getList($key, $pageNumber, $amountOfItems)
|
public function getList($key, $pageNumber, $amountOfItems)
|
||||||
{
|
{
|
||||||
|
|
|
@ -65,23 +65,6 @@ class Plugin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DEPRECATED
|
|
||||||
// 2017-06-19
|
|
||||||
public function setDb($args)
|
|
||||||
{
|
|
||||||
foreach($this->dbFields as $key=>$value) {
|
|
||||||
if( isset($args[$key]) ) {
|
|
||||||
$value = Sanitize::html( $args[$key] );
|
|
||||||
if($value==='false') { $value = false; }
|
|
||||||
elseif($value==='true') { $value = true; }
|
|
||||||
settype($value, gettype($this->dbFields[$key]));
|
|
||||||
$this->db[$key] = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->save();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function save()
|
public function save()
|
||||||
{
|
{
|
||||||
$tmp = new dbJSON($this->filenameDb);
|
$tmp = new dbJSON($this->filenameDb);
|
||||||
|
@ -152,25 +135,6 @@ class Plugin {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// DEPRECATED
|
|
||||||
// 2017-06-16
|
|
||||||
public function getDbField($key, $html=true)
|
|
||||||
{
|
|
||||||
if(isset($this->db[$key])) {
|
|
||||||
|
|
||||||
if($html) {
|
|
||||||
// All fields from DBField are sanitized.
|
|
||||||
return $this->db[$key];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// Decode HTML tags, this action unsanitized the variable.
|
|
||||||
return Sanitize::htmlDecode($this->db[$key]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function label()
|
public function label()
|
||||||
{
|
{
|
||||||
return $this->getMetadata('label');
|
return $this->getMetadata('label');
|
||||||
|
|
|
@ -33,12 +33,12 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
$categoryKey = $layout['parameters'];
|
$categoryKey = $layout['parameters'];
|
||||||
|
|
||||||
if (!$dbCategories->exists($categoryKey)) {
|
if (!$categories->exists($categoryKey)) {
|
||||||
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to get the category: '.$categoryKey);
|
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to get the category: '.$categoryKey);
|
||||||
Redirect::page('categories');
|
Redirect::page('categories');
|
||||||
}
|
}
|
||||||
|
|
||||||
$categoryMap = $dbCategories->getMap($categoryKey);
|
$categoryMap = $categories->getMap($categoryKey);
|
||||||
|
|
||||||
// Title of the page
|
// Title of the page
|
||||||
$layout['title'] .= ' - '.$Language->g('Edit Category').' [ '.$categoryMap['name'] . ' ] ';
|
$layout['title'] .= ' - '.$Language->g('Edit Category').' [ '.$categoryMap['name'] . ' ] ';
|
|
@ -19,11 +19,11 @@ echo '
|
||||||
<tbody>
|
<tbody>
|
||||||
';
|
';
|
||||||
|
|
||||||
$categories = $dbCategories->getKeyNameArray();
|
foreach ($categories->keys() as $key) {
|
||||||
foreach ($categories as $categoryKey=>$category) {
|
$category = new Category($key);
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td><a href="'.HTML_PATH_ADMIN_ROOT.'edit-category/'.$categoryKey.'">'.$category.'</a></td>';
|
echo '<td><a href="'.HTML_PATH_ADMIN_ROOT.'edit-category/'.$key.'">'.$category->name().'</a></td>';
|
||||||
echo '<td><a href="'.DOMAIN_CATEGORIES.$categoryKey.'">'.$url->filters('category', false).$categoryKey.'</a></td>';
|
echo '<td><a href="'.$category->permalink().'">'.$url->filters('category', false).$key.'</a></td>';
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -296,7 +296,7 @@
|
||||||
'selected'=>$page->categoryKey(),
|
'selected'=>$page->categoryKey(),
|
||||||
'class'=>'',
|
'class'=>'',
|
||||||
'emptyOption'=>'- Uncategorized -',
|
'emptyOption'=>'- Uncategorized -',
|
||||||
'options'=>$dbCategories->getKeyNameArray()
|
'options'=>$categories->getKeyNameArray()
|
||||||
));
|
));
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -230,7 +230,7 @@
|
||||||
'selected'=>'',
|
'selected'=>'',
|
||||||
'class'=>'',
|
'class'=>'',
|
||||||
'emptyOption'=>'- Uncategorized -',
|
'emptyOption'=>'- Uncategorized -',
|
||||||
'options'=>$dbCategories->getKeyNameArray()
|
'options'=>$categories->getKeyNameArray()
|
||||||
));
|
));
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -121,9 +121,9 @@ if (file_exists(PATH_KERNEL.'bludit.pro.php')) {
|
||||||
|
|
||||||
// Objects
|
// Objects
|
||||||
$pages = $dbPages = new dbPages(); // DEPRECATED v3.0.0 $dbPages
|
$pages = $dbPages = new dbPages(); // DEPRECATED v3.0.0 $dbPages
|
||||||
$dbUsers = new dbUsers();
|
$users = $dbUsers = new dbUsers(); // DEPRECATED v3.0.0 $dbUsers
|
||||||
$dbTags = new dbTags();
|
$tags = $dbTags = new dbTags(); // DEPRECATED v3.0.0 $dbTags
|
||||||
$dbCategories = new dbCategories();
|
$categories = $dbCategories = new dbCategories(); // DEPRECATED v3.0.0 $dbCategories
|
||||||
$site = new dbSite();
|
$site = new dbSite();
|
||||||
$url = new Url();
|
$url = new Url();
|
||||||
$security = new Security();
|
$security = new Security();
|
||||||
|
|
|
@ -11,12 +11,12 @@ if($url->whereAmI()=='admin') {
|
||||||
elseif($url->whereAmI()=='tag') {
|
elseif($url->whereAmI()=='tag') {
|
||||||
$itemsPerPage = $site->itemsPerPage();
|
$itemsPerPage = $site->itemsPerPage();
|
||||||
$tagKey = $url->slug();
|
$tagKey = $url->slug();
|
||||||
$amountOfItems = $dbTags->countPagesByTag($tagKey);
|
$amountOfItems = $tags->countPagesByTag($tagKey);
|
||||||
}
|
}
|
||||||
elseif($url->whereAmI()=='category') {
|
elseif($url->whereAmI()=='category') {
|
||||||
$itemsPerPage = $site->itemsPerPage();
|
$itemsPerPage = $site->itemsPerPage();
|
||||||
$categoryKey = $url->slug();
|
$categoryKey = $url->slug();
|
||||||
$amountOfItems = $dbCategories->countPagesByCategory($categoryKey);
|
$amountOfItems = $categories->countPagesByCategory($categoryKey);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$itemsPerPage = $site->itemsPerPage();
|
$itemsPerPage = $site->itemsPerPage();
|
||||||
|
|
|
@ -6,14 +6,14 @@ class Category {
|
||||||
|
|
||||||
function __construct($key)
|
function __construct($key)
|
||||||
{
|
{
|
||||||
global $dbCategories;
|
global $categories;
|
||||||
if (isset($dbCategories->db[$key])) {
|
if (isset($categories->db[$key])) {
|
||||||
$this->vars['name'] = $dbCategories->db[$key]['name'];
|
$this->vars['name'] = $categories->db[$key]['name'];
|
||||||
$this->vars['template'] = $dbCategories->db[$key]['template'];
|
$this->vars['template'] = $categories->db[$key]['template'];
|
||||||
$this->vars['description'] = $dbCategories->db[$key]['description'];
|
$this->vars['description'] = $categories->db[$key]['description'];
|
||||||
$this->vars['key'] = $key;
|
$this->vars['key'] = $key;
|
||||||
$this->vars['permalink'] = DOMAIN_CATEGORIES . $key;
|
$this->vars['permalink'] = DOMAIN_CATEGORIES . $key;
|
||||||
$this->vars['list'] = $dbCategories->db[$key]['list'];
|
$this->vars['list'] = $categories->db[$key]['list'];
|
||||||
} else {
|
} else {
|
||||||
$errorMessage = 'Category not found in database by key ['.$key.']';
|
$errorMessage = 'Category not found in database by key ['.$key.']';
|
||||||
Log::set(__METHOD__.LOG_SEP.$errorMessage);
|
Log::set(__METHOD__.LOG_SEP.$errorMessage);
|
||||||
|
|
|
@ -3,15 +3,15 @@
|
||||||
// Re-index database of categories
|
// Re-index database of categories
|
||||||
// If you create/edit/remove a page is necessary regenerate the database of categories
|
// If you create/edit/remove a page is necessary regenerate the database of categories
|
||||||
function reindexCategories() {
|
function reindexCategories() {
|
||||||
global $dbCategories;
|
global $categories;
|
||||||
return $dbCategories->reindex();
|
return $categories->reindex();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Re-index database of tags
|
// Re-index database of tags
|
||||||
// If you create/edit/remove a page is necessary regenerate the database of tags
|
// If you create/edit/remove a page is necessary regenerate the database of tags
|
||||||
function reindexTags() {
|
function reindexTags() {
|
||||||
global $dbTags;
|
global $tags;
|
||||||
return $dbTags->reindex();
|
return $tags->reindex();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate the page 404 Not found
|
// Generate the page 404 Not found
|
||||||
|
@ -81,8 +81,8 @@ function buildPagesByTag() {
|
||||||
// This function is use for buildPagesForHome(), buildPagesByCategory(), buildPagesByTag()
|
// This function is use for buildPagesForHome(), buildPagesByCategory(), buildPagesByTag()
|
||||||
function buildPagesFor($for, $categoryKey=false, $tagKey=false) {
|
function buildPagesFor($for, $categoryKey=false, $tagKey=false) {
|
||||||
global $dbPages;
|
global $dbPages;
|
||||||
global $dbCategories;
|
global $categories;
|
||||||
global $dbTags;
|
global $tags;
|
||||||
global $site;
|
global $site;
|
||||||
global $url;
|
global $url;
|
||||||
|
|
||||||
|
@ -102,11 +102,11 @@ function buildPagesFor($for, $categoryKey=false, $tagKey=false) {
|
||||||
}
|
}
|
||||||
elseif ($for=='category') {
|
elseif ($for=='category') {
|
||||||
$amountOfItems = $site->itemsPerPage();
|
$amountOfItems = $site->itemsPerPage();
|
||||||
$list = $dbCategories->getList($categoryKey, $pageNumber, $amountOfItems);
|
$list = $categories->getList($categoryKey, $pageNumber, $amountOfItems);
|
||||||
}
|
}
|
||||||
elseif ($for=='tag') {
|
elseif ($for=='tag') {
|
||||||
$amountOfItems = $site->itemsPerPage();
|
$amountOfItems = $site->itemsPerPage();
|
||||||
$list = $dbTags->getList($tagKey, $pageNumber, $amountOfItems);
|
$list = $tags->getList($tagKey, $pageNumber, $amountOfItems);
|
||||||
}
|
}
|
||||||
|
|
||||||
// There are not items, invalid tag, invalid category, out of range, etc...
|
// There are not items, invalid tag, invalid category, out of range, etc...
|
||||||
|
@ -185,12 +185,6 @@ function getPlugin($pluginClassName) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// DEPRACTED
|
|
||||||
// Returns TRUE if the plugin is enabled and installed, FALSE otherwise
|
|
||||||
function pluginEnabled($pluginClassName) {
|
|
||||||
return pluginActivated($pluginClassName);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Returns TRUE if the plugin is activaed / installed, FALSE otherwise
|
// Returns TRUE if the plugin is activaed / installed, FALSE otherwise
|
||||||
function pluginActivated($pluginClassName) {
|
function pluginActivated($pluginClassName) {
|
||||||
global $plugins;
|
global $plugins;
|
||||||
|
@ -670,7 +664,7 @@ function checkRole($allowRoles, $redirect=true) {
|
||||||
// Add a new category to the system
|
// Add a new category to the system
|
||||||
// Returns TRUE is successfully added, FALSE otherwise
|
// Returns TRUE is successfully added, FALSE otherwise
|
||||||
function createCategory($category) {
|
function createCategory($category) {
|
||||||
global $dbCategories;
|
global $categories;
|
||||||
global $Language;
|
global $Language;
|
||||||
global $syslog;
|
global $syslog;
|
||||||
|
|
||||||
|
@ -679,7 +673,7 @@ function createCategory($category) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($dbCategories->add(array('name'=>$category))) {
|
if ($categories->add(array('name'=>$category))) {
|
||||||
// Add to syslog
|
// Add to syslog
|
||||||
$syslog->add(array(
|
$syslog->add(array(
|
||||||
'dictionaryKey'=>'new-category-created',
|
'dictionaryKey'=>'new-category-created',
|
||||||
|
@ -697,7 +691,7 @@ function createCategory($category) {
|
||||||
function editCategory($args) {
|
function editCategory($args) {
|
||||||
global $Language;
|
global $Language;
|
||||||
global $dbPages;
|
global $dbPages;
|
||||||
global $dbCategories;
|
global $categories;
|
||||||
global $syslog;
|
global $syslog;
|
||||||
|
|
||||||
if (Text::isEmpty($args['name']) || Text::isEmpty($args['newKey']) ) {
|
if (Text::isEmpty($args['name']) || Text::isEmpty($args['newKey']) ) {
|
||||||
|
@ -705,7 +699,7 @@ function editCategory($args) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$newCategoryKey = $dbCategories->edit($args);
|
$newCategoryKey = $categories->edit($args);
|
||||||
|
|
||||||
if ($newCategoryKey==false) {
|
if ($newCategoryKey==false) {
|
||||||
Alert::set($Language->g('The category already exists'));
|
Alert::set($Language->g('The category already exists'));
|
||||||
|
@ -727,11 +721,11 @@ function editCategory($args) {
|
||||||
|
|
||||||
function deleteCategory($args) {
|
function deleteCategory($args) {
|
||||||
global $Language;
|
global $Language;
|
||||||
global $dbCategories;
|
global $categories;
|
||||||
global $syslog;
|
global $syslog;
|
||||||
|
|
||||||
// Remove the category by key
|
// Remove the category by key
|
||||||
$dbCategories->remove($args['oldKey']);
|
$categories->remove($args['oldKey']);
|
||||||
|
|
||||||
// Remove the category from the pages ? or keep it if the user want to recovery the category ?
|
// Remove the category from the pages ? or keep it if the user want to recovery the category ?
|
||||||
|
|
||||||
|
@ -748,10 +742,10 @@ function deleteCategory($args) {
|
||||||
// Returns an array with all the categories
|
// Returns an array with all the categories
|
||||||
// By default, the database of categories is alphanumeric sorted
|
// By default, the database of categories is alphanumeric sorted
|
||||||
function getCategories() {
|
function getCategories() {
|
||||||
global $dbCategories;
|
global $categories;
|
||||||
|
|
||||||
$list = array();
|
$list = array();
|
||||||
foreach ($dbCategories->db as $key=>$fields) {
|
foreach ($categories->keys() as $key) {
|
||||||
$category = new Category($key);
|
$category = new Category($key);
|
||||||
array_push($list, $category);
|
array_push($list, $category);
|
||||||
}
|
}
|
||||||
|
@ -771,10 +765,10 @@ function getCategory($key) {
|
||||||
// Returns an array with all the tags
|
// Returns an array with all the tags
|
||||||
// By default, the database of tags is alphanumeric sorted
|
// By default, the database of tags is alphanumeric sorted
|
||||||
function getTags() {
|
function getTags() {
|
||||||
global $dbTags;
|
global $tags;
|
||||||
|
|
||||||
$list = array();
|
$list = array();
|
||||||
foreach ($dbTags->db as $key=>$fields) {
|
foreach ($tags->db as $key=>$fields) {
|
||||||
$tag = new Tag($key);
|
$tag = new Tag($key);
|
||||||
array_push($list, $tag);
|
array_push($list, $tag);
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,8 +66,8 @@ class Theme {
|
||||||
{
|
{
|
||||||
global $url;
|
global $url;
|
||||||
global $site;
|
global $site;
|
||||||
global $dbTags;
|
global $tags;
|
||||||
global $dbCategories;
|
global $categories;
|
||||||
global $WHERE_AM_I;
|
global $WHERE_AM_I;
|
||||||
global $page;
|
global $page;
|
||||||
|
|
||||||
|
@ -110,6 +110,7 @@ class Theme {
|
||||||
global $site;
|
global $site;
|
||||||
global $WHERE_AM_I;
|
global $WHERE_AM_I;
|
||||||
global $page;
|
global $page;
|
||||||
|
global $url;
|
||||||
|
|
||||||
$description = $site->description();
|
$description = $site->description();
|
||||||
|
|
||||||
|
|
|
@ -190,9 +190,9 @@ class Page {
|
||||||
// categoryMap = array( 'name'=>'', 'list'=>array() )
|
// categoryMap = array( 'name'=>'', 'list'=>array() )
|
||||||
public function categoryMap($field)
|
public function categoryMap($field)
|
||||||
{
|
{
|
||||||
global $dbCategories;
|
global $categories;
|
||||||
$categoryKey = $this->categoryKey();
|
$categoryKey = $this->categoryKey();
|
||||||
$map = $dbCategories->getMap($categoryKey);
|
$map = $categories->getMap($categoryKey);
|
||||||
|
|
||||||
if ($field=='key') {
|
if ($field=='key') {
|
||||||
return $this->categoryKey();
|
return $this->categoryKey();
|
||||||
|
|
|
@ -6,14 +6,14 @@ class Tag {
|
||||||
|
|
||||||
function __construct($key)
|
function __construct($key)
|
||||||
{
|
{
|
||||||
global $dbTags;
|
global $tags;
|
||||||
if (isset($dbTags->db[$key])) {
|
if (isset($tags->db[$key])) {
|
||||||
$this->vars['name'] = $dbTags->db[$key]['name'];
|
$this->vars['name'] = $tags->db[$key]['name'];
|
||||||
$this->vars['template'] = $dbTags->db[$key]['template'];
|
$this->vars['template'] = $tags->db[$key]['template'];
|
||||||
$this->vars['description'] = $dbTags->db[$key]['description'];
|
$this->vars['description'] = $tags->db[$key]['description'];
|
||||||
$this->vars['key'] = $key;
|
$this->vars['key'] = $key;
|
||||||
$this->vars['permalink'] = DOMAIN_TAGS . $key;
|
$this->vars['permalink'] = DOMAIN_TAGS . $key;
|
||||||
$this->vars['list'] = $dbTags->db[$key]['list'];
|
$this->vars['list'] = $tags->db[$key]['list'];
|
||||||
} else {
|
} else {
|
||||||
$errorMessage = 'Category not found in database by key ['.$key.']';
|
$errorMessage = 'Category not found in database by key ['.$key.']';
|
||||||
Log::set(__METHOD__.LOG_SEP.$errorMessage);
|
Log::set(__METHOD__.LOG_SEP.$errorMessage);
|
||||||
|
|
|
@ -41,7 +41,7 @@ class pluginCategories extends Plugin {
|
||||||
public function siteSidebar()
|
public function siteSidebar()
|
||||||
{
|
{
|
||||||
global $Language;
|
global $Language;
|
||||||
global $dbCategories;
|
global $categories;
|
||||||
|
|
||||||
// HTML for sidebar
|
// HTML for sidebar
|
||||||
$html = '<div class="plugin plugin-categories">';
|
$html = '<div class="plugin plugin-categories">';
|
||||||
|
@ -50,7 +50,7 @@ class pluginCategories extends Plugin {
|
||||||
$html .= '<ul>';
|
$html .= '<ul>';
|
||||||
|
|
||||||
// By default the database of categories are alphanumeric sorted
|
// By default the database of categories are alphanumeric sorted
|
||||||
foreach ($dbCategories->db as $key=>$fields) {
|
foreach ($categories->db as $key=>$fields) {
|
||||||
$count = count($fields['list']);
|
$count = count($fields['list']);
|
||||||
if (!$this->getValue('hideCero') || $count>0) {
|
if (!$this->getValue('hideCero') || $count>0) {
|
||||||
$html .= '<li>';
|
$html .= '<li>';
|
||||||
|
|
|
@ -54,8 +54,8 @@ class pluginDisqus extends Plugin {
|
||||||
|
|
||||||
if ( !$url->notFound() &&
|
if ( !$url->notFound() &&
|
||||||
( $url->whereAmI()=='page' &&
|
( $url->whereAmI()=='page' &&
|
||||||
(($this->getDbField('enablePosts') && $page->published()) ||
|
(($this->getValue('enablePosts') && $page->published()) ||
|
||||||
($this->getDbField('enablePages') && $page->static()))
|
($this->getValue('enablePages') && $page->static()))
|
||||||
) &&
|
) &&
|
||||||
$page->allowComments() ) {
|
$page->allowComments() ) {
|
||||||
$html = '<div id="disqus_thread"></div>';
|
$html = '<div id="disqus_thread"></div>';
|
||||||
|
|
|
@ -28,7 +28,7 @@ class pluginMaintenanceMode extends Plugin {
|
||||||
|
|
||||||
$html .= '<div>';
|
$html .= '<div>';
|
||||||
$html .= '<label>'.$Language->get('Message').'</label>';
|
$html .= '<label>'.$Language->get('Message').'</label>';
|
||||||
$html .= '<input name="message" id="jsmessage" type="text" value="'.$this->getDbField('message').'">';
|
$html .= '<input name="message" id="jsmessage" type="text" value="'.$this->getValue('message').'">';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
return $html;
|
return $html;
|
||||||
|
@ -36,8 +36,8 @@ class pluginMaintenanceMode extends Plugin {
|
||||||
|
|
||||||
public function beforeAll()
|
public function beforeAll()
|
||||||
{
|
{
|
||||||
if ($this->getDbField('enable')) {
|
if ($this->getValue('enable')) {
|
||||||
exit( $this->getDbField('message') );
|
exit( $this->getValue('message') );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -22,12 +22,12 @@ class pluginsimpleMDE extends Plugin {
|
||||||
|
|
||||||
$html = '<div>';
|
$html = '<div>';
|
||||||
$html .= '<label>'.$Language->get('toolbar').'</label>';
|
$html .= '<label>'.$Language->get('toolbar').'</label>';
|
||||||
$html .= '<input name="toolbar" id="jstoolbar" type="text" value="'.$this->getDbField('toolbar').'">';
|
$html .= '<input name="toolbar" id="jstoolbar" type="text" value="'.$this->getValue('toolbar').'">';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
$html .= '<div>';
|
$html .= '<div>';
|
||||||
$html .= '<label>'.$Language->get('tab-size').'</label>';
|
$html .= '<label>'.$Language->get('tab-size').'</label>';
|
||||||
$html .= '<input name="tabSize" id="jstabSize" type="text" value="'.$this->getDbField('tabSize').'">';
|
$html .= '<input name="tabSize" id="jstabSize" type="text" value="'.$this->getValue('tabSize').'">';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
$html .= '<div>';
|
$html .= '<div>';
|
||||||
|
@ -62,7 +62,7 @@ class pluginsimpleMDE extends Plugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Spell Checker
|
// Spell Checker
|
||||||
$spellCheckerEnable = $this->getDbField('spellChecker')?'true':'false';
|
$spellCheckerEnable = $this->getValue('spellChecker')?'true':'false';
|
||||||
|
|
||||||
// Include plugin's Javascript files
|
// Include plugin's Javascript files
|
||||||
$html = $this->includeJS('simplemde.min.js');
|
$html = $this->includeJS('simplemde.min.js');
|
||||||
|
@ -100,9 +100,9 @@ class pluginsimpleMDE extends Plugin {
|
||||||
lineWrapping: true,
|
lineWrapping: true,
|
||||||
autoDownloadFontAwesome: false,
|
autoDownloadFontAwesome: false,
|
||||||
indentWithTabs: true,
|
indentWithTabs: true,
|
||||||
tabSize: '.$this->getDbField('tabSize').',
|
tabSize: '.$this->getValue('tabSize').',
|
||||||
spellChecker: '.$spellCheckerEnable.',
|
spellChecker: '.$spellCheckerEnable.',
|
||||||
toolbar: ['.Sanitize::htmlDecode($this->getDbField('toolbar')).',
|
toolbar: ['.Sanitize::htmlDecode($this->getValue('toolbar')).',
|
||||||
"|",
|
"|",
|
||||||
{
|
{
|
||||||
name: "pageBreak",
|
name: "pageBreak",
|
||||||
|
|
|
@ -29,18 +29,18 @@ class pluginTags extends Plugin {
|
||||||
public function siteSidebar()
|
public function siteSidebar()
|
||||||
{
|
{
|
||||||
global $Language;
|
global $Language;
|
||||||
global $dbTags;
|
global $tags;
|
||||||
global $url;
|
global $url;
|
||||||
|
|
||||||
$filter = $url->filters('tag');
|
$filter = $url->filters('tag');
|
||||||
|
|
||||||
$html = '<div class="plugin plugin-tags">';
|
$html = '<div class="plugin plugin-tags">';
|
||||||
$html .= '<h2 class="plugin-label">'.$this->getDbField('label').'</h2>';
|
$html .= '<h2 class="plugin-label">'.$this->getValue('label').'</h2>';
|
||||||
$html .= '<div class="plugin-content">';
|
$html .= '<div class="plugin-content">';
|
||||||
$html .= '<ul>';
|
$html .= '<ul>';
|
||||||
|
|
||||||
// By default the database of tags are alphanumeric sorted
|
// By default the database of tags are alphanumeric sorted
|
||||||
foreach( $dbTags->db as $key=>$fields ) {
|
foreach( $tags->db as $key=>$fields ) {
|
||||||
$html .= '<li>';
|
$html .= '<li>';
|
||||||
$html .= '<a href="'.DOMAIN_TAGS.$key.'">';
|
$html .= '<a href="'.DOMAIN_TAGS.$key.'">';
|
||||||
$html .= $fields['name'];
|
$html .= $fields['name'];
|
||||||
|
|
|
@ -22,17 +22,17 @@ class pluginTinymce extends Plugin {
|
||||||
|
|
||||||
$html = '<div>';
|
$html = '<div>';
|
||||||
$html .= '<label>'.$Language->get('Toolbar top').'</label>';
|
$html .= '<label>'.$Language->get('Toolbar top').'</label>';
|
||||||
$html .= '<input name="toolbar1" id="jstoolbar1" type="text" value="'.$this->getDbField('toolbar1').'">';
|
$html .= '<input name="toolbar1" id="jstoolbar1" type="text" value="'.$this->getValue('toolbar1').'">';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
$html .= '<div>';
|
$html .= '<div>';
|
||||||
$html .= '<label>'.$Language->get('Toolbar bottom').'</label>';
|
$html .= '<label>'.$Language->get('Toolbar bottom').'</label>';
|
||||||
$html .= '<input name="toolbar2" id="jstoolbar2" type="text" value="'.$this->getDbField('toolbar2').'">';
|
$html .= '<input name="toolbar2" id="jstoolbar2" type="text" value="'.$this->getValue('toolbar2').'">';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
$html .= '<div>';
|
$html .= '<div>';
|
||||||
$html .= '<label>'.$Language->get('Plugins').'</label>';
|
$html .= '<label>'.$Language->get('Plugins').'</label>';
|
||||||
$html .= '<input name="plugins" id="jsplugins" type="text" value="'.$this->getDbField('plugins').'">';
|
$html .= '<input name="plugins" id="jsplugins" type="text" value="'.$this->getValue('plugins').'">';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
return $html;
|
return $html;
|
||||||
|
@ -55,9 +55,9 @@ class pluginTinymce extends Plugin {
|
||||||
|
|
||||||
global $Language;
|
global $Language;
|
||||||
|
|
||||||
$toolbar1 = $this->getDbField('toolbar1');
|
$toolbar1 = $this->getValue('toolbar1');
|
||||||
$toolbar2 = $this->getDbField('toolbar2');
|
$toolbar2 = $this->getValue('toolbar2');
|
||||||
$plugins = $this->getDbField('plugins');
|
$plugins = $this->getValue('plugins');
|
||||||
|
|
||||||
$lang = 'en';
|
$lang = 'en';
|
||||||
if (file_exists($this->phpPath().'tinymce'.DS.'langs'.DS.$Language->currentLanguage().'.js')) {
|
if (file_exists($this->phpPath().'tinymce'.DS.'langs'.DS.$Language->currentLanguage().'.js')) {
|
||||||
|
|
12
install.php
12
install.php
|
@ -438,17 +438,17 @@ function install($adminPassword, $timezone)
|
||||||
|
|
||||||
// File categories.php
|
// File categories.php
|
||||||
$data = array(
|
$data = array(
|
||||||
'general'=>array('name'=>'General', 'list'=>array()),
|
'general'=>array('name'=>'General', 'description'=>'', 'template'=>'', 'list'=>array()),
|
||||||
'music'=>array('name'=>'Music', 'list'=>array()),
|
'music'=>array('name'=>'Music', 'description'=>'', 'template'=>'', 'list'=>array()),
|
||||||
'videos'=>array('name'=>'Videos', 'list'=>array())
|
'videos'=>array('name'=>'Videos', 'description'=>'', 'template'=>'', 'list'=>array())
|
||||||
);
|
);
|
||||||
file_put_contents(PATH_DATABASES.'categories.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX);
|
file_put_contents(PATH_DATABASES.'categories.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX);
|
||||||
|
|
||||||
// File tags.php
|
// File tags.php
|
||||||
$data = array(
|
$data = array(
|
||||||
'bludit'=>array('name'=>'Bludit', 'list'=>array('welcome')),
|
'bludit'=>array('name'=>'Bludit', 'description'=>'', 'template'=>'', 'list'=>array('welcome')),
|
||||||
'cms'=>array('name'=>'CMS', 'list'=>array('welcome')),
|
'cms'=>array('name'=>'CMS', 'description'=>'', 'template'=>'', 'list'=>array('welcome')),
|
||||||
'flat-files'=>array('name'=>'Flat files', 'list'=>array('welcome'))
|
'flat-files'=>array('name'=>'Flat files', 'description'=>'', 'template'=>'', 'list'=>array('welcome'))
|
||||||
);
|
);
|
||||||
file_put_contents(PATH_DATABASES.'tags.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX);
|
file_put_contents(PATH_DATABASES.'tags.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue