mirror of
https://github.com/monstra-cms/monstra.git
synced 2025-08-09 14:47:04 +02:00
Merge branch 'master'
This commit is contained in:
@@ -314,6 +314,59 @@ class Pages extends Frontend
|
|||||||
return Pages::$page['keywords'];
|
return Pages::$page['keywords'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get pages
|
||||||
|
*/
|
||||||
|
public static function getPages()
|
||||||
|
{
|
||||||
|
// Init vars
|
||||||
|
$pages_array = array();
|
||||||
|
$count = 0;
|
||||||
|
|
||||||
|
// Get pages table
|
||||||
|
$pages = new Table('pages');
|
||||||
|
|
||||||
|
// Get Pages List
|
||||||
|
$pages_list = $pages->select('[slug!="error404" and status="published"]');
|
||||||
|
|
||||||
|
foreach ($pages_list as $page) {
|
||||||
|
|
||||||
|
$pages_array[$count]['title'] = Html::toText($page['title']);
|
||||||
|
$pages_array[$count]['parent'] = $page['parent'];
|
||||||
|
$pages_array[$count]['date'] = $page['date'];
|
||||||
|
$pages_array[$count]['author'] = $page['author'];
|
||||||
|
$pages_array[$count]['slug'] = ($page['slug'] == Option::get('defaultpage')) ? '' : $page['slug'] ;
|
||||||
|
|
||||||
|
if (isset($page['parent'])) {
|
||||||
|
$c_p = $page['parent'];
|
||||||
|
} else {
|
||||||
|
$c_p = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($c_p != '') {
|
||||||
|
$_page = $pages->select('[slug="'.$page['parent'].'"]', null);
|
||||||
|
|
||||||
|
if (isset($_page['title'])) {
|
||||||
|
$_title = $_page['title'];
|
||||||
|
} else {
|
||||||
|
$_title = '';
|
||||||
|
}
|
||||||
|
$pages_array[$count]['sort'] = $_title . ' ' . $page['title'];
|
||||||
|
} else {
|
||||||
|
$pages_array[$count]['sort'] = $page['title'];
|
||||||
|
}
|
||||||
|
$_title = '';
|
||||||
|
$count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sort pages
|
||||||
|
$_pages_list = Arr::subvalSort($pages_array, 'sort');
|
||||||
|
|
||||||
|
// return
|
||||||
|
return $_pages_list;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -64,7 +64,7 @@ class Sitemap extends Frontend
|
|||||||
{
|
{
|
||||||
// Display view
|
// Display view
|
||||||
return View::factory('box/sitemap/views/frontend/index')
|
return View::factory('box/sitemap/views/frontend/index')
|
||||||
->assign('pages_list', Sitemap::getPages())
|
->assign('pages_list', Pages::getPages())
|
||||||
->assign('components', Sitemap::getComponents())
|
->assign('components', Sitemap::getComponents())
|
||||||
->render();
|
->render();
|
||||||
}
|
}
|
||||||
@@ -75,7 +75,7 @@ class Sitemap extends Frontend
|
|||||||
public static function create()
|
public static function create()
|
||||||
{
|
{
|
||||||
// Get pages list
|
// Get pages list
|
||||||
$pages_list = Sitemap::getPages();
|
$pages_list = Pages::getPages();
|
||||||
|
|
||||||
// Create sitemap content
|
// Create sitemap content
|
||||||
$map = '<?xml version="1.0" encoding="UTF-8"?>'."\n";
|
$map = '<?xml version="1.0" encoding="UTF-8"?>'."\n";
|
||||||
@@ -102,58 +102,6 @@ class Sitemap extends Frontend
|
|||||||
return File::setContent(ROOT . DS . 'sitemap.xml', $map);
|
return File::setContent(ROOT . DS . 'sitemap.xml', $map);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get pages
|
|
||||||
*/
|
|
||||||
protected static function getPages()
|
|
||||||
{
|
|
||||||
// Init vars
|
|
||||||
$pages_array = array();
|
|
||||||
$count = 0;
|
|
||||||
|
|
||||||
// Get pages table
|
|
||||||
$pages = new Table('pages');
|
|
||||||
|
|
||||||
// Get Pages List
|
|
||||||
$pages_list = $pages->select('[slug!="error404" and status="published"]');
|
|
||||||
|
|
||||||
foreach ($pages_list as $page) {
|
|
||||||
|
|
||||||
$pages_array[$count]['title'] = Html::toText($page['title']);
|
|
||||||
$pages_array[$count]['parent'] = $page['parent'];
|
|
||||||
$pages_array[$count]['date'] = $page['date'];
|
|
||||||
$pages_array[$count]['author'] = $page['author'];
|
|
||||||
$pages_array[$count]['slug'] = ($page['slug'] == Option::get('defaultpage')) ? '' : $page['slug'] ;
|
|
||||||
|
|
||||||
if (isset($page['parent'])) {
|
|
||||||
$c_p = $page['parent'];
|
|
||||||
} else {
|
|
||||||
$c_p = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($c_p != '') {
|
|
||||||
$_page = $pages->select('[slug="'.$page['parent'].'"]', null);
|
|
||||||
|
|
||||||
if (isset($_page['title'])) {
|
|
||||||
$_title = $_page['title'];
|
|
||||||
} else {
|
|
||||||
$_title = '';
|
|
||||||
}
|
|
||||||
$pages_array[$count]['sort'] = $_title . ' ' . $page['title'];
|
|
||||||
} else {
|
|
||||||
$pages_array[$count]['sort'] = $page['title'];
|
|
||||||
}
|
|
||||||
$_title = '';
|
|
||||||
$count++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sort pages
|
|
||||||
$_pages_list = Arr::subvalSort($pages_array, 'sort');
|
|
||||||
|
|
||||||
// return
|
|
||||||
return $_pages_list;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get components
|
* Get components
|
||||||
*/
|
*/
|
||||||
|
@@ -77,5 +77,6 @@
|
|||||||
'Main .htaccess file not writable' => 'Haupt .htaccess-Datei ist nicht beschreibbar',
|
'Main .htaccess file not writable' => 'Haupt .htaccess-Datei ist nicht beschreibbar',
|
||||||
'Official Support Forum' => 'Offizielles Support Forum',
|
'Official Support Forum' => 'Offizielles Support Forum',
|
||||||
'Documentation' => 'Dokumentation',
|
'Documentation' => 'Dokumentation',
|
||||||
|
'Your changes have been saved.' => 'Änderungen wurden gespeichert.',
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@@ -185,7 +185,7 @@ class UsersAdmin extends Backend
|
|||||||
// -------------------------------------
|
// -------------------------------------
|
||||||
case "delete":
|
case "delete":
|
||||||
|
|
||||||
if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin'))) {
|
if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin')) && (int)$_SESSION['user_id'] != (int)Request::get('user_id')) {
|
||||||
|
|
||||||
if (Security::check(Request::get('token'))) {
|
if (Security::check(Request::get('token'))) {
|
||||||
|
|
||||||
|
@@ -44,9 +44,12 @@
|
|||||||
<td>
|
<td>
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<?php echo Html::anchor(__('Edit', 'users'), 'index.php?id=users&action=edit&user_id='.$user['id'], array('class' => 'btn btn-small')); ?>
|
<?php echo Html::anchor(__('Edit', 'users'), 'index.php?id=users&action=edit&user_id='.$user['id'], array('class' => 'btn btn-small')); ?>
|
||||||
<?php echo Html::anchor(__('Delete', 'users'),
|
<?php
|
||||||
|
if ((int)$user['id'] != (int)$_SESSION['user_id']) {
|
||||||
|
echo Html::anchor(__('Delete', 'users'),
|
||||||
'index.php?id=users&action=delete&user_id='.$user['id'].'&token='.Security::token(),
|
'index.php?id=users&action=delete&user_id='.$user['id'].'&token='.Security::token(),
|
||||||
array('class' => 'btn btn-small', 'onclick' => "return confirmDelete('".__('Delete user: :user', 'users', array(':user' => Html::toText($user['login'])))."')"));
|
array('class' => 'btn btn-small', 'onclick' => "return confirmDelete('".__('Delete user: :user', 'users', array(':user' => Html::toText($user['login'])))."')"));
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
Reference in New Issue
Block a user