DELETE FROM `#REPLACEME#_menu` WHERE `bib_menu`.`id` = 13;
INSERT INTO `#REPLACEME#_menu` (`id`, `text`, `action`, `icon`, `owner`, `group`, `rights`, `position`, `category`) VALUES (NULL, 'Groups', 'managegroups', 'users', '1', '1', 'rw-------', '5', 'manage');
UPDATE `#REPLACEME#_menu` SET `position` = '6' WHERE `bib_menu`.`id` = 16;
+UPDATE `#REPLACEME#_menu` SET `group` = '2', `rights` = 'rw-rw----' WHERE `bib_menu`.`id` = 14;
$TemplateData = array();
$TemplateData['pagination'] = array();
$TemplateData['searchAction'] = 'index.php';
+$TemplateData['pageTitle'] = 'Dashboard';
# the view
$View = Summoner::themefile('dashboard/dashboard.html', UI_THEME);
# the script
$View = Summoner::themefile($_requestMode.'/'.$_requestMode.'.html', UI_THEME);
}
-# now inlcude the script
+# now include the script
# this sets information into $Data and can overwrite $View
if(!empty($ViewScript)) {
require_once $ViewScript;
$this->_DB->query($queryStrEntry);
$this->_DB->query($queryStrFields);
+ Summoner::recursive_remove_directory(PATH_STORAGE.'/'.$id);
+
$ret = true;
}
catch (Exception $e) {
}
/**
- * delete and/or empty a diretory
+ * delete and/or empty a directory
*
- * $empty = true => empty the diretory but do not delete it
+ * $empty = true => empty the directory but do not delete it
*
* @param string $directory
* @param bool $empty
* Validate if given action is a valid tool and if the user has access
*
* @param string $identifier
- * @return bool
+ * @return bool|mixed
*/
public function validate($identifier) {
$ret = false;
if(!empty($result['value'])) {
$ret[$result['id']]['entries'][$result['value']] = $result['value'];
}
+ elseif(!isset($ret[$result['id']]['entries'])) {
+ $ret[$result['id']]['entries'] = array();
+ }
}
}
} catch (Exception $e) {
$_collection = Summoner::validate($_collection,'digit') ? $_collection : false;
}
+$TemplateData['pageTitle'] = 'Advanced search';
$TemplateData['loadedCollection'] = array();
$TemplateData['collections'] = array();
$TemplateData['collectionFields'] = array();
// passwords used here: password_hash("somePassword", PASSWORD_DEFAULT);
+$TemplateData['pageTitle'] = 'Auth';
+
if(isset($_GET['m']) && !empty($_GET['m'])) {
if($_GET['m'] == "logout") {
$Doomguy->logOut();
require_once(Summoner::themefile('system/pagination_before.php',UI_THEME));
+$TemplateData['pageTitle'] = "Collection overview";
$TemplateData['loadedCollection'] = array();
$TemplateData['storagePath'] = '';
$TemplateData['entries'] = array();
if (!empty($_search)) {
$TemplateData['search'] = $_search;
}
+
+ $TemplateData['pageTitle'] = $Trite->param('name');
+
}
else {
$TemplateData['message']['content'] = "Can not load given collection.";
$_id = Summoner::validate($_id,'digit') ? $_id : false;
}
+$TemplateData['pageTitle'] = '?';
$TemplateData['fieldViewDefault'] = Summoner::themefile('entry/field-unknown.html', UI_THEME);
$TemplateData['entry'] = array();
$TemplateData['loadedCollection'] = array();
$ManageEntry->setCollection($Trite->param('id'));
$TemplateData['showEdit'] = $ManageEntry->canEditEntry($_id);
+
+ if(isset($TemplateData['entry']['fields']['title'])) {
+ $TemplateData['pageTitle'] = $TemplateData['entry']['fields']['title']['value'].' - '.$Trite->param('name');
+ }
+ else {
+ $TemplateData['pageTitle'] = ' - '.$Trite->param('name');
+ }
}
else {
$TemplateData['message']['content'] = 'Can not load given collection.';
<script type="text/javascript" src="view/default/ui/js/uikit-icons.min.js"></script>
<meta name="author" content="https://www.bananas-playground.net/projekt/bibliotheca" />
- <title>Bibliotheca</title>
+ <title><?php echo $TemplateData['pageTitle']; ?> - Bibliotheca</title>
</head>
<body>
<header>
$TemplateData['availableFields'] = $ManangeCollectionFields->getAvailableFields();
$TemplateData['existingFields'] = array();
+$TemplateData['pageTitle'] = 'Manage collection fields';
+
$_id = false;
if(isset($_GET['id']) && !empty($_GET['id'])) {
$_id = trim($_GET['id']);
$TemplateData['editData']['tool'] = array();
$TemplateData['existingFields'] = array();
+$TemplateData['pageTitle'] = 'Manage collection';
+
// @todo providing the id is enough
$_editMode = false;
if(isset($_GET['m']) && !empty($_GET['m'])) {
if(!empty($TemplateData['editData']['_isOwner'])) {
?>
+ <hr class="uk-margin-medium">
<div class="uk-margin">
<div class="uk-form-label">Rights</div>
<div class="uk-form-controls uk-form-controls-text">
require_once 'lib/manageentry.class.php';
$ManangeEntry = new Manageentry($DB,$Doomguy);
+$TemplateData['pageTitle'] = 'Manage entry - ';
$TemplateData['editFields'] = array();
$TemplateData['editData'] = array();
$TemplateData['loadedCollection'] = '';
$TemplateData['editFields'] = $ManangeEntry->getEditFields();
$TemplateData['availableTools'] = $Trite->getAvailableTools();
+ $TemplateData['pageTitle'] = 'Add - '.$Trite->param('name');
+
if(!empty($_id)) {
$TemplateData['storagePath'] = PATH_WEB_STORAGE . '/' . $_collection . '/' . $_id;
$TemplateData['message']['content'] = "Entry has no value in title field.";
$TemplateData['message']['status'] = "error";
}
+ else {
+ $TemplateData['pageTitle'] = 'Edit - '.$TemplateData['editData']['title'].' - '.$Trite->param('name');
+ }
}
if(isset($_POST['submitForm'])) {
}
}
else {
+ $TemplateData['pageTitle'] .= 'collection overview';
$TemplateData['existingCollections'] = $Trite->getCollections("write");
}
$TemplateData['existingGroups'] = $Possessed->getGroups();
$TemplateData['editData'] = false;
+$TemplateData['pageTitle'] = 'Manage groups';
+
$_id = false;
if(isset($_GET['id']) && !empty($_GET['id'])) {
$_id = trim($_GET['id']);
$TemplateData['loadedCollection'] = array();
$TemplateData['collections'] = array();
+$TemplateData['pageTitle'] = 'Manage tags';
if(!empty($_collection)) {
$TemplateData['loadedCollection'] = $Trite->load($_collection, "write");
$TemplateData['existingUsers'] = $Possessed->getUsers();
$TemplateData['editData'] = false;
$TemplateData['editData']['groups'] = array();
+$TemplateData['pageTitle'] = 'Manage users';
$_id = false;
if(isset($_GET['id']) && !empty($_GET['id'])) {
$Possessed = new Possessed($DB, $Doomguy);
$TemplateData['editData'] = $Doomguy->getAllUserData();
+$TemplateData['pageTitle'] = 'Profile';
if(!empty($TemplateData['editData'])) {
if(isset($_POST['submitForm'])) {
$_id = Summoner::validate($_id,'digit') ? $_id : false;
}
+$TemplateData['pageTitle'] = 'Tags - ';
$TemplateData['loadedCollection'] = array();
$TemplateData['tags'] = array();
$TemplateData['search'] = false;
}
$Trite->getTags();
+
+ $TemplateData['pageTitle'] = $Trite->param('name');
}
else {
$TemplateData['message']['content'] = "Can not load given collection.";
}
}
else {
+ $TemplateData['pageTitle'] .= 'collection overview';
$TemplateData['collections'] = $Trite->getCollections();
}
require_once 'lib/tentacle.class.php';
$Tools = new Tentacle($DB,$Doomguy);
-require_once 'lib/managecollections.class.php';
-$ManangeCollections = new ManageCollections($DB,$Doomguy);
require_once 'lib/managecollectionfields.class.php';
$ManangeCollectionsFields = new ManageCollectionFields($DB, $Doomguy);
require_once 'lib/manageentry.class.php';
$Manageentry = new Manageentry($DB,$Doomguy);
+require_once 'lib/trite.class.php';
+$Trite = new Trite($DB,$Doomguy);
+$TemplateData['pageTitle'] = 'Tool';
$TemplateData['tool'] = array();
$TemplateData['tool']['viewFile'] = '';
$TemplateData['collection'] = array();
}
if(!empty($_collection) && !empty($_t)) {
- $collection = $ManangeCollections->getCollection($_collection,"write");
+ $collection = $Trite->load($_collection,"write");
$toolInfo = $Tools->validate($_t);
if(!empty($collection) && !empty($toolInfo)) {
$TemplateData['tool'] = $toolInfo;
$TemplateData['collection'] = $collection;
- $ManangeCollectionsFields->setCollection($_collection);
- $Manageentry->setCollection($_collection);
+ $ManangeCollectionsFields->setCollection($Trite->param('id'));
+ $Manageentry->setCollection($Trite->param('id'));
if(!empty($_id)) {
$TemplateData['editEntry'] = $Manageentry->getEditData($_id);
if(file_exists($_toolFile) && file_exists($_toolViewFile)) {
require_once $_toolFile;
$TemplateData['tool']['viewFile'] = $_toolViewFile;
+
+ $TemplateData['pageTitle'] .= ' - '.$toolInfo['name'];
}
else {
$TemplateData['tool']['viewFile'] = '';