From 3c072c02ad34051253703d7dd60ed9623c8377f3 Mon Sep 17 00:00:00 2001
From: Todd Zmijewski
Date: Fri, 11 Oct 2024 21:17:04 -0400
Subject: [PATCH] [tz-1] Resolve discrepencies between remote master and local
version.
---
.gitignore | 37 +
README | 0
mcp_config/MainExample.xml | 0
mcp_root/App/Config/Config.xml | 0
mcp_root/App/Config/Modules.xml | 0
mcp_root/App/Core/DAO.php | 0
mcp_root/App/Core/DB.php | 0
mcp_root/App/Core/Exception/Permission.php | 0
mcp_root/App/Core/MCP.php | 173 +--
mcp_root/App/Core/Resource.php | 0
mcp_root/App/Core/VDItem.php | 8 -
mcp_root/App/Lib/Console/Console.php | 0
mcp_root/App/Lib/Email/Emailer.php | 0
mcp_root/App/Lib/Import/Import.php | 0
mcp_root/App/Lib/Request/Request.php | 0
.../App/Lib/UI/Element/Common/Form/Form.php | 4 +-
.../App/Lib/UI/Element/Common/Form/Video.php | 20 +-
mcp_root/App/Lib/Validation/Validator.php | 0
mcp_root/App/Resource/Cache/CacheHandler.php | 0
.../App/Resource/Cache/DAO/DAODataCache.php | 0
.../App/Resource/Cache/DAO/DAOImageCache.php | 0
mcp_root/App/Resource/Config/Config.php | 0
.../App/Resource/Cookie/CookieManager.php | 0
mcp_root/App/Resource/DB/MySQL/MySQL.php | 0
mcp_root/App/Resource/DB/MySQLi/MySQLi.php | 0
mcp_root/App/Resource/DB/PDO/PDO.php | 0
mcp_root/App/Resource/Event/EventHandler.php | 0
mcp_root/App/Resource/File/DAO/DAOImage.php | 0
mcp_root/App/Resource/Module/Module.php | 0
.../Resource/Permission/PermissionBase.php | 703 -----------
.../App/Resource/Permission/Plugin/Admin.php | 5 -
.../Session/DAO/DAOSessionHandler.php | 0
.../App/Resource/Session/SessionHandler.php | 0
mcp_root/App/Resource/Site/DAO/DAOSite.php | 0
mcp_root/App/Resource/Site/Site.php | 0
mcp_root/App/Resource/Template/Template.php | 4 +-
mcp_root/App/Resource/User/User.php | 0
mcp_root/Component/Config/DAO/DAOConfig.php | 0
.../Component/Config/Module/Form/Form.php | 0
.../Component/Config/Template/Form/Form.php | 0
mcp_root/Component/Field/DAO/DAOField.php | 25 +-
mcp_root/Component/Field/Module/Form/Form.php | 0
mcp_root/Component/Field/Module/List/List.php | 0
.../Component/Field/Template/Form/Form.php | 0
.../Component/Field/Template/List/List.php | 0
.../Field/Template/List/Redirect.php | 0
mcp_root/Component/Menu/Theme/Menu.php | 7 -
.../Navigation/DAO/DAONavigation.php | 1079 -----------------
.../Navigation/Module/Form/Link/Link.php | 629 ----------
.../Navigation/Module/Form/Menu/Menu.php | 357 ------
.../Navigation/Module/List/Link/Link.php | 313 -----
.../Navigation/Module/List/Menu/Menu.php | 344 ------
.../Navigation/Module/Menu/Admin/Admin.php | 9 -
.../Component/Navigation/Module/Menu/Menu.php | 88 --
.../Navigation/Module/Router/Router.php | 327 -----
.../Navigation/Template/Form/Link/Layout.php | 8 -
.../Navigation/Template/Form/Link/Link.php | 176 ---
.../Navigation/Template/Form/Link/LinkNew.php | 15 -
.../Template/Form/Link/ModuleConfig.php | 76 --
.../Navigation/Template/Form/Menu/Menu.php | 9 -
.../Navigation/Template/List/Link/Edit.php | 2 -
.../Navigation/Template/List/Link/Link.php | 67 -
.../Navigation/Template/List/Menu/Menu.php | 26 -
.../Template/List/Menu/Redirect.php | 14 -
.../Navigation/Template/Menu/Admin/Admin.php | 13 -
.../Navigation/Template/Menu/Menu.php | 18 -
.../Template/Router/PageNotFound.php | 1 -
.../Template/Router/PermissionDenied.php | 1 -
.../Navigation/Template/Router/Redirect.php | 37 -
mcp_root/Component/Node/DAO/DAONode.php | 0
.../Node/Module/Form/Comment/Comment.php | 0
.../Node/Module/Form/Entry/Entry.php | 4 +-
.../Component/Node/Module/Form/Type/Type.php | 0
.../Node/Module/List/Comment/Comment.php | 0
.../Node/Module/List/Entry/Entry.php | 0
.../Component/Node/Module/List/Type/Type.php | 0
.../Node/Module/View/Entry/Entry.php | 0
.../Node/Template/Form/Comment/Comment.php | 0
.../Node/Template/Form/Entry/Entry.php | 0
.../Node/Template/Form/Type/Type.php | 0
.../Node/Template/List/Comment/Comment.php | 0
.../Node/Template/List/Entry/Entry.php | 0
.../Node/Template/List/Entry/Redirect.php | 0
.../Node/Template/List/Entry/View.php | 0
.../Node/Template/List/Type/Redirect.php | 0
.../Node/Template/List/Type/Type.php | 0
.../Node/Template/View/Entry/Edit.php | 0
.../Node/Template/View/Entry/Entry.php | 0
mcp_root/Component/Site/DAO/DAOSite.php | 0
mcp_root/Component/Site/Module/List/List.php | 0
.../Component/Site/Template/List/List.php | 0
.../Component/Taxonomy/DAO/DAOTaxonomy.php | 0
.../Taxonomy/Module/Form/Term/Term.php | 0
.../Module/Form/Vocabulary/Vocabulary.php | 0
.../Module/List/Vocabulary/Vocabulary.php | 0
.../Taxonomy/Module/Tree/Term/Term.php | 0
.../Taxonomy/Template/Form/Term/Term.php | 0
.../Template/Form/Vocabulary/Vocabulary.php | 0
.../Template/List/Vocabulary/Redirect.php | 0
.../Template/List/Vocabulary/Vocabulary.php | 0
.../Taxonomy/Template/Tree/Term/Redirect.php | 0
.../Taxonomy/Template/Tree/Term/Term.php | 0
mcp_root/Component/User/DAO/DAOUser.php | 0
mcp_root/Component/User/Module/List/List.php | 0
.../Component/User/Module/Login/Login.php | 0
.../Component/User/Module/Logout/Logout.php | 0
.../User/Module/Registration/Form/Form.php | 0
.../Component/User/Template/List/List.php | 0
.../Component/User/Template/List/Redirect.php | 0
.../Component/User/Template/Login/Login.php | 0
.../Component/User/Template/Logout/Logout.php | 0
.../User/Template/Registration/Form/Form.php | 0
mcp_root/Component/Util/DAO/DAOUtil.php | 0
.../Component/Util/Module/Admin/Admin.php | 0
.../Util/Module/Breadcrumb/Breadcrumb.php | 0
.../Component/Util/Module/Display/CSS/CSS.php | 0
.../Component/Util/Module/Display/JS/JS.php | 0
.../Util/Module/Display/Meta/Meta.php | 0
.../Component/Util/Module/Footer/Footer.php | 0
.../Component/Util/Module/Header/Header.php | 0
.../Component/Util/Module/Index/Index.php | 0
.../Util/Module/Master/Email/Email.php | 0
.../Component/Util/Module/Master/Master.php | 16 +
.../Util/Module/Pagination/Alphabetize.php | 0
.../Util/Module/Pagination/Pagination.php | 0
.../Module/SystemMessage/SystemMessage.php | 20 -
.../Component/Util/Template/Admin/Admin.php | 0
.../Util/Template/Breadcrumb/Breadcrumb.php | 0
.../Util/Template/Display/CSS/CSS.php | 0
.../Component/Util/Template/Display/JS/JS.php | 0
.../Util/Template/Display/Meta/Meta.php | 0
.../Component/Util/Template/Footer/Footer.php | 0
.../Component/Util/Template/Header/Header.php | 0
.../Component/Util/Template/Index/Index.php | 0
.../Component/Util/Template/Master/Blank.php | 0
.../Util/Template/Master/CSS/CSS.php | 0
.../Util/Template/Master/DAO/DAO.php | 0
.../Util/Template/Master/Email/HTML.php | 0
.../Util/Template/Master/Email/PlainText.php | 0
.../Util/Template/Master/File/File.php | 0
.../Util/Template/Master/Image/Image.php | 0
.../Component/Util/Template/Master/JS/JS.php | 0
.../Component/Util/Template/Master/Master.php | 0
.../Util/Template/Master/Public/Public.php | 0
.../Util/Template/Pagination/Alphabetize.php | 0
.../Util/Template/Pagination/Pagination.php | 0
.../Template/SystemMessage/SystemMessage.php | 20 -
www/base-airsoft-app.xml | 0
www/base.xml | 1 +
www/css.php | 0
www/dao.php | 0
www/file.php | 0
www/img.php | 0
www/index.php | 5 +
www/js.php | 0
www/mod.php | 0
www/public.php | 0
www/theme/admin/default/js/form.js | 2 +
158 files changed, 199 insertions(+), 4464 deletions(-)
create mode 100644 .gitignore
mode change 100755 => 100644 README
mode change 100755 => 100644 mcp_config/MainExample.xml
mode change 100755 => 100644 mcp_root/App/Config/Config.xml
mode change 100755 => 100644 mcp_root/App/Config/Modules.xml
mode change 100755 => 100644 mcp_root/App/Core/DAO.php
mode change 100755 => 100644 mcp_root/App/Core/DB.php
mode change 100755 => 100644 mcp_root/App/Core/Exception/Permission.php
mode change 100755 => 100644 mcp_root/App/Core/MCP.php
mode change 100755 => 100644 mcp_root/App/Core/Resource.php
delete mode 100644 mcp_root/App/Core/VDItem.php
mode change 100755 => 100644 mcp_root/App/Lib/Console/Console.php
mode change 100755 => 100644 mcp_root/App/Lib/Email/Emailer.php
mode change 100755 => 100644 mcp_root/App/Lib/Import/Import.php
mode change 100755 => 100644 mcp_root/App/Lib/Request/Request.php
mode change 100755 => 100644 mcp_root/App/Lib/Validation/Validator.php
mode change 100755 => 100644 mcp_root/App/Resource/Cache/CacheHandler.php
mode change 100755 => 100644 mcp_root/App/Resource/Cache/DAO/DAODataCache.php
mode change 100755 => 100644 mcp_root/App/Resource/Cache/DAO/DAOImageCache.php
mode change 100755 => 100644 mcp_root/App/Resource/Config/Config.php
mode change 100755 => 100644 mcp_root/App/Resource/Cookie/CookieManager.php
mode change 100755 => 100644 mcp_root/App/Resource/DB/MySQL/MySQL.php
mode change 100755 => 100644 mcp_root/App/Resource/DB/MySQLi/MySQLi.php
mode change 100755 => 100644 mcp_root/App/Resource/DB/PDO/PDO.php
mode change 100755 => 100644 mcp_root/App/Resource/Event/EventHandler.php
mode change 100755 => 100644 mcp_root/App/Resource/File/DAO/DAOImage.php
mode change 100755 => 100644 mcp_root/App/Resource/Module/Module.php
delete mode 100644 mcp_root/App/Resource/Permission/PermissionBase.php
delete mode 100644 mcp_root/App/Resource/Permission/Plugin/Admin.php
mode change 100755 => 100644 mcp_root/App/Resource/Session/DAO/DAOSessionHandler.php
mode change 100755 => 100644 mcp_root/App/Resource/Session/SessionHandler.php
mode change 100755 => 100644 mcp_root/App/Resource/Site/DAO/DAOSite.php
mode change 100755 => 100644 mcp_root/App/Resource/Site/Site.php
mode change 100755 => 100644 mcp_root/App/Resource/Template/Template.php
mode change 100755 => 100644 mcp_root/App/Resource/User/User.php
mode change 100755 => 100644 mcp_root/Component/Config/DAO/DAOConfig.php
mode change 100755 => 100644 mcp_root/Component/Config/Module/Form/Form.php
mode change 100755 => 100644 mcp_root/Component/Config/Template/Form/Form.php
mode change 100755 => 100644 mcp_root/Component/Field/DAO/DAOField.php
mode change 100755 => 100644 mcp_root/Component/Field/Module/Form/Form.php
mode change 100755 => 100644 mcp_root/Component/Field/Module/List/List.php
mode change 100755 => 100644 mcp_root/Component/Field/Template/Form/Form.php
mode change 100755 => 100644 mcp_root/Component/Field/Template/List/List.php
mode change 100755 => 100644 mcp_root/Component/Field/Template/List/Redirect.php
delete mode 100644 mcp_root/Component/Menu/Theme/Menu.php
delete mode 100755 mcp_root/Component/Navigation/DAO/DAONavigation.php
delete mode 100755 mcp_root/Component/Navigation/Module/Form/Link/Link.php
delete mode 100755 mcp_root/Component/Navigation/Module/Form/Menu/Menu.php
delete mode 100755 mcp_root/Component/Navigation/Module/List/Link/Link.php
delete mode 100755 mcp_root/Component/Navigation/Module/List/Menu/Menu.php
delete mode 100644 mcp_root/Component/Navigation/Module/Menu/Admin/Admin.php
delete mode 100755 mcp_root/Component/Navigation/Module/Menu/Menu.php
delete mode 100755 mcp_root/Component/Navigation/Module/Router/Router.php
delete mode 100644 mcp_root/Component/Navigation/Template/Form/Link/Layout.php
delete mode 100755 mcp_root/Component/Navigation/Template/Form/Link/Link.php
delete mode 100644 mcp_root/Component/Navigation/Template/Form/Link/LinkNew.php
delete mode 100755 mcp_root/Component/Navigation/Template/Form/Link/ModuleConfig.php
delete mode 100755 mcp_root/Component/Navigation/Template/Form/Menu/Menu.php
delete mode 100755 mcp_root/Component/Navigation/Template/List/Link/Edit.php
delete mode 100755 mcp_root/Component/Navigation/Template/List/Link/Link.php
delete mode 100644 mcp_root/Component/Navigation/Template/List/Menu/Menu.php
delete mode 100644 mcp_root/Component/Navigation/Template/List/Menu/Redirect.php
delete mode 100644 mcp_root/Component/Navigation/Template/Menu/Admin/Admin.php
delete mode 100755 mcp_root/Component/Navigation/Template/Menu/Menu.php
delete mode 100755 mcp_root/Component/Navigation/Template/Router/PageNotFound.php
delete mode 100755 mcp_root/Component/Navigation/Template/Router/PermissionDenied.php
delete mode 100755 mcp_root/Component/Navigation/Template/Router/Redirect.php
mode change 100755 => 100644 mcp_root/Component/Node/DAO/DAONode.php
mode change 100755 => 100644 mcp_root/Component/Node/Module/Form/Comment/Comment.php
mode change 100755 => 100644 mcp_root/Component/Node/Module/Form/Entry/Entry.php
mode change 100755 => 100644 mcp_root/Component/Node/Module/Form/Type/Type.php
mode change 100755 => 100644 mcp_root/Component/Node/Module/List/Comment/Comment.php
mode change 100755 => 100644 mcp_root/Component/Node/Module/List/Entry/Entry.php
mode change 100755 => 100644 mcp_root/Component/Node/Module/List/Type/Type.php
mode change 100755 => 100644 mcp_root/Component/Node/Module/View/Entry/Entry.php
mode change 100755 => 100644 mcp_root/Component/Node/Template/Form/Comment/Comment.php
mode change 100755 => 100644 mcp_root/Component/Node/Template/Form/Entry/Entry.php
mode change 100755 => 100644 mcp_root/Component/Node/Template/Form/Type/Type.php
mode change 100755 => 100644 mcp_root/Component/Node/Template/List/Comment/Comment.php
mode change 100755 => 100644 mcp_root/Component/Node/Template/List/Entry/Entry.php
mode change 100755 => 100644 mcp_root/Component/Node/Template/List/Entry/Redirect.php
mode change 100755 => 100644 mcp_root/Component/Node/Template/List/Entry/View.php
mode change 100755 => 100644 mcp_root/Component/Node/Template/List/Type/Redirect.php
mode change 100755 => 100644 mcp_root/Component/Node/Template/List/Type/Type.php
mode change 100755 => 100644 mcp_root/Component/Node/Template/View/Entry/Edit.php
mode change 100755 => 100644 mcp_root/Component/Node/Template/View/Entry/Entry.php
mode change 100755 => 100644 mcp_root/Component/Site/DAO/DAOSite.php
mode change 100755 => 100644 mcp_root/Component/Site/Module/List/List.php
mode change 100755 => 100644 mcp_root/Component/Site/Template/List/List.php
mode change 100755 => 100644 mcp_root/Component/Taxonomy/DAO/DAOTaxonomy.php
mode change 100755 => 100644 mcp_root/Component/Taxonomy/Module/Form/Term/Term.php
mode change 100755 => 100644 mcp_root/Component/Taxonomy/Module/Form/Vocabulary/Vocabulary.php
mode change 100755 => 100644 mcp_root/Component/Taxonomy/Module/List/Vocabulary/Vocabulary.php
mode change 100755 => 100644 mcp_root/Component/Taxonomy/Module/Tree/Term/Term.php
mode change 100755 => 100644 mcp_root/Component/Taxonomy/Template/Form/Term/Term.php
mode change 100755 => 100644 mcp_root/Component/Taxonomy/Template/Form/Vocabulary/Vocabulary.php
mode change 100755 => 100644 mcp_root/Component/Taxonomy/Template/List/Vocabulary/Redirect.php
mode change 100755 => 100644 mcp_root/Component/Taxonomy/Template/List/Vocabulary/Vocabulary.php
mode change 100755 => 100644 mcp_root/Component/Taxonomy/Template/Tree/Term/Redirect.php
mode change 100755 => 100644 mcp_root/Component/Taxonomy/Template/Tree/Term/Term.php
mode change 100755 => 100644 mcp_root/Component/User/DAO/DAOUser.php
mode change 100755 => 100644 mcp_root/Component/User/Module/List/List.php
mode change 100755 => 100644 mcp_root/Component/User/Module/Login/Login.php
mode change 100755 => 100644 mcp_root/Component/User/Module/Logout/Logout.php
mode change 100755 => 100644 mcp_root/Component/User/Module/Registration/Form/Form.php
mode change 100755 => 100644 mcp_root/Component/User/Template/List/List.php
mode change 100755 => 100644 mcp_root/Component/User/Template/List/Redirect.php
mode change 100755 => 100644 mcp_root/Component/User/Template/Login/Login.php
mode change 100755 => 100644 mcp_root/Component/User/Template/Logout/Logout.php
mode change 100755 => 100644 mcp_root/Component/User/Template/Registration/Form/Form.php
mode change 100755 => 100644 mcp_root/Component/Util/DAO/DAOUtil.php
mode change 100755 => 100644 mcp_root/Component/Util/Module/Admin/Admin.php
mode change 100755 => 100644 mcp_root/Component/Util/Module/Breadcrumb/Breadcrumb.php
mode change 100755 => 100644 mcp_root/Component/Util/Module/Display/CSS/CSS.php
mode change 100755 => 100644 mcp_root/Component/Util/Module/Display/JS/JS.php
mode change 100755 => 100644 mcp_root/Component/Util/Module/Display/Meta/Meta.php
mode change 100755 => 100644 mcp_root/Component/Util/Module/Footer/Footer.php
mode change 100755 => 100644 mcp_root/Component/Util/Module/Header/Header.php
mode change 100755 => 100644 mcp_root/Component/Util/Module/Index/Index.php
mode change 100755 => 100644 mcp_root/Component/Util/Module/Master/Email/Email.php
mode change 100755 => 100644 mcp_root/Component/Util/Module/Master/Master.php
mode change 100755 => 100644 mcp_root/Component/Util/Module/Pagination/Alphabetize.php
mode change 100755 => 100644 mcp_root/Component/Util/Module/Pagination/Pagination.php
delete mode 100644 mcp_root/Component/Util/Module/SystemMessage/SystemMessage.php
mode change 100755 => 100644 mcp_root/Component/Util/Template/Admin/Admin.php
mode change 100755 => 100644 mcp_root/Component/Util/Template/Breadcrumb/Breadcrumb.php
mode change 100755 => 100644 mcp_root/Component/Util/Template/Display/CSS/CSS.php
mode change 100755 => 100644 mcp_root/Component/Util/Template/Display/JS/JS.php
mode change 100755 => 100644 mcp_root/Component/Util/Template/Display/Meta/Meta.php
mode change 100755 => 100644 mcp_root/Component/Util/Template/Footer/Footer.php
mode change 100755 => 100644 mcp_root/Component/Util/Template/Header/Header.php
mode change 100755 => 100644 mcp_root/Component/Util/Template/Index/Index.php
mode change 100755 => 100644 mcp_root/Component/Util/Template/Master/Blank.php
mode change 100755 => 100644 mcp_root/Component/Util/Template/Master/CSS/CSS.php
mode change 100755 => 100644 mcp_root/Component/Util/Template/Master/DAO/DAO.php
mode change 100755 => 100644 mcp_root/Component/Util/Template/Master/Email/HTML.php
mode change 100755 => 100644 mcp_root/Component/Util/Template/Master/Email/PlainText.php
mode change 100755 => 100644 mcp_root/Component/Util/Template/Master/File/File.php
mode change 100755 => 100644 mcp_root/Component/Util/Template/Master/Image/Image.php
mode change 100755 => 100644 mcp_root/Component/Util/Template/Master/JS/JS.php
mode change 100755 => 100644 mcp_root/Component/Util/Template/Master/Master.php
mode change 100755 => 100644 mcp_root/Component/Util/Template/Master/Public/Public.php
mode change 100755 => 100644 mcp_root/Component/Util/Template/Pagination/Alphabetize.php
mode change 100755 => 100644 mcp_root/Component/Util/Template/Pagination/Pagination.php
delete mode 100644 mcp_root/Component/Util/Template/SystemMessage/SystemMessage.php
mode change 100755 => 100644 www/base-airsoft-app.xml
mode change 100755 => 100644 www/base.xml
mode change 100755 => 100644 www/css.php
mode change 100755 => 100644 www/dao.php
mode change 100755 => 100644 www/file.php
mode change 100755 => 100644 www/img.php
mode change 100755 => 100644 www/index.php
mode change 100755 => 100644 www/js.php
mode change 100755 => 100644 www/mod.php
mode change 100755 => 100644 www/public.php
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..caabccb
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,37 @@
+# ignore all cached items #
+mcp_cache/images/*
+
+# ignore main config #
+mcp_config/Main.xml
+
+# ignore all platforms #
+mcp_root/PlatForm/*
+
+# ignore all sites #
+mcp_root/Site/*
+
+# ignore all files #
+mcp_files/images/*
+mcp_files/files
+mcp_files/audio
+mcp_files/video
+
+# ignore remote and reserve #
+remote
+reserve
+
+# ignore lib, jason_fugh and other #
+www/jason_fugh
+www/lib
+www/other
+
+#ignore ghost . files
+**/*.php
+**/*.txt
+**/._*
+
+# IDE files
+org.eclipse.*
+.jsdtscope
+.project
+.buildpath
\ No newline at end of file
diff --git a/README b/README
old mode 100755
new mode 100644
diff --git a/mcp_config/MainExample.xml b/mcp_config/MainExample.xml
old mode 100755
new mode 100644
diff --git a/mcp_root/App/Config/Config.xml b/mcp_root/App/Config/Config.xml
old mode 100755
new mode 100644
diff --git a/mcp_root/App/Config/Modules.xml b/mcp_root/App/Config/Modules.xml
old mode 100755
new mode 100644
diff --git a/mcp_root/App/Core/DAO.php b/mcp_root/App/Core/DAO.php
old mode 100755
new mode 100644
diff --git a/mcp_root/App/Core/DB.php b/mcp_root/App/Core/DB.php
old mode 100755
new mode 100644
diff --git a/mcp_root/App/Core/Exception/Permission.php b/mcp_root/App/Core/Exception/Permission.php
old mode 100755
new mode 100644
diff --git a/mcp_root/App/Core/MCP.php b/mcp_root/App/Core/MCP.php
old mode 100755
new mode 100644
index 4a83a84..4573801
--- a/mcp_root/App/Core/MCP.php
+++ b/mcp_root/App/Core/MCP.php
@@ -263,81 +263,91 @@ private function _init() {
*/
$objDBConfig = array_pop($this->_objXMLMain->xpath("//site[@id='{$this->getSitesId()}']/db"));
- /*
- * Create database object and connect
- *
- * Different adapters may be used by changing the adapter XML config value. The value
- * should reflect the full path to the adpater. The adapter is required to implement
- * MCPDB and extend MCPResource. This is required so all the adapters can be interchanged.
- * Default adapters are stored inside App.Resource.DB. Custom adapters should not be placed
- * here. Instead you should dedicate a pkg or site directory to them so they aren't lost
- * when updating to new versions of MCP.
- */
- $this->_objDB = $this->getInstance((string) $objDBConfig->adapter,array($this));
- $this->_objDB->connect(
- (string) $objDBConfig->host
- ,(string) $objDBConfig->user
- ,(string) $objDBConfig->pass
- ,(string) $objDBConfig->db
- );
+ if(INSTALLED) {
+
+ /*
+ * Create database object and connect
+ *
+ * Different adapters may be used by changing the adapter XML config value. The value
+ * should reflect the full path to the adpater. The adapter is required to implement
+ * MCPDB and extend MCPResource. This is required so all the adapters can be interchanged.
+ * Default adapters are stored inside App.Resource.DB. Custom adapters should not be placed
+ * here. Instead you should dedicate a pkg or site directory to them so they aren't lost
+ * when updating to new versions of MCP.
+ */
+ $this->_objDB = $this->getInstance((string) $objDBConfig->adapter,array($this));
+ $this->_objDB->connect(
+ (string) $objDBConfig->host
+ ,(string) $objDBConfig->user
+ ,(string) $objDBConfig->pass
+ ,(string) $objDBConfig->db
+ );
+
+ }
/*
* Create MCP event handler
*/
$this->_objEventHandler = $this->getInstance('App.Resource.Event.EventHandler',array($this));
- /*
- * Set the current site
- */
- $this->_objSite = MCPSite::createInstance($this);
+ if(INSTALLED) {
+ /*
+ * Set the current site
+ */
+ $this->_objSite = MCPSite::createInstance($this);
+ }
/*
* Initiate cookie manager - required for proper session handling
*/
$this->_objCookieManager = $this->getInstance('App.Resource.Cookie.CookieManager',array($this));
-
- /*
- * Initiate cache handler
- */
- $this->import('App.Resource.Cache.CacheHandler');
- $this->_objCacheHandler = MCPCacheHandler::createInstance($this);
-
- /*
- * Initiate session handler
- */
- $this->import('App.Resource.Session.SessionHandler');
- $this->_objSessionHandler = MCPSessionHandler::createInstance($this);
-
- /*
- * Required for garbage collector to function appropriatly
- */
- ini_set('session.gc_probability', 100);
- ini_set('session.gc_divisor', 100);
+
+ if(INSTALLED) {
+ /*
+ * Initiate cache handler
+ */
+ $this->import('App.Resource.Cache.CacheHandler');
+ $this->_objCacheHandler = MCPCacheHandler::createInstance($this);
+
+ /*
+ * Initiate session handler
+ */
+ $this->import('App.Resource.Session.SessionHandler');
+ $this->_objSessionHandler = MCPSessionHandler::createInstance($this);
+
+ /*
+ * Required for garbage collector to function appropriatly
+ */
+ ini_set('session.gc_probability', 100);
+ ini_set('session.gc_divisor', 100);
+ }
/*
* Begin session once session handler has been created
*/
session_start();
- /*
- * Create config instance
- */
- $this->_objConfig = MCPConfig::createInstance($this);
+ if(INSTALLED) {
+ /*
+ * Create config instance
+ */
+ $this->_objConfig = MCPConfig::createInstance($this);
- /*
- * Create user instance
- */
- $this->_objUser = MCPUser::createInstance($this);
-
- /*
- * Create permission handler
- */
- $this->_objPermissionHandler = $this->getInstance('App.Resource.Permission.PermissionManager',array($this));
-
- /*
- * Create Template singleton
- */
- $this->_objTemplate = MCPTemplate::createInstance($this);
+ /*
+ * Create user instance
+ */
+ $this->_objUser = MCPUser::createInstance($this);
+
+ /*
+ * Create permission handler
+ */
+ $this->_objPermissionHandler = $this->getInstance('App.Resource.Permission.PermissionManager',array($this));
+ }
+
+ /*
+ * Create Template singleton
+ */
+ $this->_objTemplate = MCPTemplate::createInstance($this);
/*
* Instatiate UI drawing library
@@ -352,26 +362,30 @@ private function _init() {
*/
$this->_objUI->registerPath(ROOT.'/Component/Node/Theme');
- /*
- * Assign default master template path
- */
- //$this->_strMasterTemplatePath = 'Site'.DS.'*'.DS/*.'Template'.DS*/.'master.php';
- $this->_strMasterTemplatePath = $this->getConfigValue('site_master_template');
-
- /*
- * Assign default email master template path
- */
- $this->_strEmailHTMLMasterTemplatePath = $this->getConfigValue('site_email_html_master_template');
-
- /*
- * Assign default email plain text master template path
- */
- $this->_strEmailPlainTextMasterTemplatePath = $this->getConfigValue('site_email_plain_text_master_template');
-
+ if(INSTALLED) {
+ /*
+ * Assign default master template path
+ */
+ //$this->_strMasterTemplatePath = 'Site'.DS.'*'.DS/*.'Template'.DS*/.'master.php';
+ $this->_strMasterTemplatePath = $this->getConfigValue('site_master_template');
+
+ /*
+ * Assign default email master template path
+ */
+ $this->_strEmailHTMLMasterTemplatePath = $this->getConfigValue('site_email_html_master_template');
+
+ /*
+ * Assign default email plain text master template path
+ */
+ $this->_strEmailPlainTextMasterTemplatePath = $this->getConfigValue('site_email_plain_text_master_template');
+ }
+
/*
* Execute login
*/
- $this->executeLogin();
+ if(INSTALLED) {
+ $this->executeLogin();
+ }
}
@@ -1242,7 +1256,16 @@ public function getFrmConfig($strPkg,$strType='frm',$boolMixin=true,$arrDynamic=
if(strcmp('default',$objConfig->getName()) == 0) {
$mixValue = str_replace(array('SITES_ID','USERS_ID'),array($this->getSitesId(),$this->getUsersId()),(string) $objConfig);
- } else {
+
+
+ // nested children
+ } else if(strcmp('children',$objConfig->getName()) === 0) {
+
+ $objNestedXml = simplexml_load_string("{$objConfig->asXml()}");
+ $mixValue = $this->getFrmConfig($objNestedXml,'children');
+
+
+ } else {
$mixValue = (string) $objConfig;
}
diff --git a/mcp_root/App/Core/Resource.php b/mcp_root/App/Core/Resource.php
old mode 100755
new mode 100644
diff --git a/mcp_root/App/Core/VDItem.php b/mcp_root/App/Core/VDItem.php
deleted file mode 100644
index e4eb04c..0000000
--- a/mcp_root/App/Core/VDItem.php
+++ /dev/null
@@ -1,8 +0,0 @@
-
\ No newline at end of file
diff --git a/mcp_root/App/Lib/Console/Console.php b/mcp_root/App/Lib/Console/Console.php
old mode 100755
new mode 100644
diff --git a/mcp_root/App/Lib/Email/Emailer.php b/mcp_root/App/Lib/Email/Emailer.php
old mode 100755
new mode 100644
diff --git a/mcp_root/App/Lib/Import/Import.php b/mcp_root/App/Lib/Import/Import.php
old mode 100755
new mode 100644
diff --git a/mcp_root/App/Lib/Request/Request.php b/mcp_root/App/Lib/Request/Request.php
old mode 100755
new mode 100644
diff --git a/mcp_root/App/Lib/UI/Element/Common/Form/Form.php b/mcp_root/App/Lib/UI/Element/Common/Form/Form.php
index 5d4c50f..de1e41e 100644
--- a/mcp_root/App/Lib/UI/Element/Common/Form/Form.php
+++ b/mcp_root/App/Lib/UI/Element/Common/Form/Form.php
@@ -380,7 +380,9 @@ public function html($settings,\UI\Manager $ui) {
$element.= $ui->draw('Common.Form.Video',array(
- 'base_name'=>sprintf('%s[%s]%s',$name,$field,(isset($data['multi'])?"[$i]":''))
+ 'base_name'=>sprintf('%s[%s]%s',$name,$field,(isset($data['multi'])?"[$i][0]":'[0]')),
+ 'codec'=> $data['children']['codec'],
+ 'container'=> $data['children']['container']
));
} else {
diff --git a/mcp_root/App/Lib/UI/Element/Common/Form/Video.php b/mcp_root/App/Lib/UI/Element/Common/Form/Video.php
index 6ed29a0..b69ade3 100644
--- a/mcp_root/App/Lib/UI/Element/Common/Form/Video.php
+++ b/mcp_root/App/Lib/UI/Element/Common/Form/Video.php
@@ -7,6 +7,12 @@ public function settings() {
return array(
'base_name'=>array(
'required'=>true
+ ),
+ 'codec'=> array(
+ 'required'=> true
+ ),
+ 'container'=> array(
+ 'required'=> true
)
);
}
@@ -57,12 +63,7 @@ protected function _getCodecsElement($ui,$settings) {
'name'=>$base_name.'[codec]'
,'id'=>'xxx'
,'data'=>array(
- 'values'=>array(
- array('values'=>'','label'=>'Pick Codec')
- ,array('value'=>'1','label'=>'One')
- ,array('value'=>'2','label'=>'Two')
- ,array('value'=>'3','label'=>'Three')
- )
+ 'values'=> $codec['values']
)
,'value'=>''
));
@@ -82,12 +83,7 @@ protected function _getContainersElement($ui,$settings) {
'name'=>$base_name.'[container]'
,'id'=>'xxxccc'
,'data'=>array(
- 'values'=>array(
- array('values'=>'','label'=>'Pick Format')
- ,array('value'=>'1','label'=>'One')
- ,array('value'=>'2','label'=>'Two')
- ,array('value'=>'3','label'=>'Three')
- )
+ 'values'=> $container['values']
)
,'value'=>''
));
diff --git a/mcp_root/App/Lib/Validation/Validator.php b/mcp_root/App/Lib/Validation/Validator.php
old mode 100755
new mode 100644
diff --git a/mcp_root/App/Resource/Cache/CacheHandler.php b/mcp_root/App/Resource/Cache/CacheHandler.php
old mode 100755
new mode 100644
diff --git a/mcp_root/App/Resource/Cache/DAO/DAODataCache.php b/mcp_root/App/Resource/Cache/DAO/DAODataCache.php
old mode 100755
new mode 100644
diff --git a/mcp_root/App/Resource/Cache/DAO/DAOImageCache.php b/mcp_root/App/Resource/Cache/DAO/DAOImageCache.php
old mode 100755
new mode 100644
diff --git a/mcp_root/App/Resource/Config/Config.php b/mcp_root/App/Resource/Config/Config.php
old mode 100755
new mode 100644
diff --git a/mcp_root/App/Resource/Cookie/CookieManager.php b/mcp_root/App/Resource/Cookie/CookieManager.php
old mode 100755
new mode 100644
diff --git a/mcp_root/App/Resource/DB/MySQL/MySQL.php b/mcp_root/App/Resource/DB/MySQL/MySQL.php
old mode 100755
new mode 100644
diff --git a/mcp_root/App/Resource/DB/MySQLi/MySQLi.php b/mcp_root/App/Resource/DB/MySQLi/MySQLi.php
old mode 100755
new mode 100644
diff --git a/mcp_root/App/Resource/DB/PDO/PDO.php b/mcp_root/App/Resource/DB/PDO/PDO.php
old mode 100755
new mode 100644
diff --git a/mcp_root/App/Resource/Event/EventHandler.php b/mcp_root/App/Resource/Event/EventHandler.php
old mode 100755
new mode 100644
diff --git a/mcp_root/App/Resource/File/DAO/DAOImage.php b/mcp_root/App/Resource/File/DAO/DAOImage.php
old mode 100755
new mode 100644
diff --git a/mcp_root/App/Resource/Module/Module.php b/mcp_root/App/Resource/Module/Module.php
old mode 100755
new mode 100644
diff --git a/mcp_root/App/Resource/Permission/PermissionBase.php b/mcp_root/App/Resource/Permission/PermissionBase.php
deleted file mode 100644
index d521930..0000000
--- a/mcp_root/App/Resource/Permission/PermissionBase.php
+++ /dev/null
@@ -1,703 +0,0 @@
-import('App.Core.DAO');
-$this->import('App.Core.Permission');
-
-/*
-* Template permission. Extend this class when creating permissions. This
-* class provides several "helper" methods to build the SQL "commonly" associated
-* with permissions for different entity levels. The normal entity permissions
-* are represented as a three level tree.
-*
-*/
-abstract class MCPPermissionBase extends MCPDAO implements MCPPermission {
-
-
- /*
- * To level items are things like: vocabulary, Navigation, Node Type, Role, etc - anything
- * that does not have a virtual parent. For example, Terms have a virtual parent of a Vocabulary
- * so terms will not use this method to create a SQL permission statement. The same is true with
- * navigation links and nodes. Nodes have a virtual parent of node type and navigation links
- * have a virtual parent of navigation.
- *
- * This method exists because most if not all top level items use the same logic to
- * derive permissions. I am getting wick of copying and pasting the same SQL so
- * this method can now be used to create the statement for any entity were it is needed
- * without essentially replicating the same SQL statement and tweaking a few things.
- *
- * - note this uses variable binding. YOU MUST PASS :users_id and :entity_type from the callee
- * when executing the query. This method does not execute a query just provides a template
- * to do so. Template in this sense means a SQL statement ready to be executed w/ provided
- * placeholders for dynamic pieces such as users ID, entity type and messages.
- *
- * @return str SQL template
- *
- * placeholders:
- * - :users_id
- * - :entity_type
- * - :deny_add_msg_dev
- * - :deny_add_msg_user
- *
- */
- protected function _getTopLevelEntityCreateSQLTemplate() {
-
- return
- "SELECT
- CASE
-
- WHEN pu.add IS NOT NULL
- THEN pu.add
-
- WHEN MAX(pr.add) IS NOT NULL
- THEN MAX(pr.add)
-
- ELSE 0
- END allow_add
-
- ,:deny_add_msg_dev deny_add_msg_dev
- ,:deny_add_msg_user deny_add_msg_user
-
- FROM
- MCP_USERS u
-
- #user permission resolution#
- LEFT OUTER
- JOIN
- MCP_PERMISSIONS_USERS pu
- ON
- pu.item_type = :entity_type
- AND
- pu.item_id = 0
- AND
- u.users_id = pu.users_id
-
- # role management resolution#
- LEFT OUTER
- JOIN
- MCP_USERS_ROLES u2r
- ON
- u.users_id = u2r.users_id
- LEFT OUTER
- JOIN
- MCP_ROLES r
- ON
- u2r.roles_id = r.roles_id
- AND
- r.deleted = 0
- LEFT OUTER
- JOIN
- MCP_PERMISSIONS_ROLES pr #role permissions#
- ON
- pr.item_type = :entity_type
- AND
- pr.item_id = 0
- AND
- r.roles_id = pr.roles_id
- WHERE
- u.users_id = :users_id
- GROUP
- BY
- u.users_id";
-
- }
-
- /*
- * @param str base table name
- * @param str base table primary key column
- * @param int[] items ids
- * [@param] str base table creator column name
- * @return str SQL template
- *
- * palceholders:
- *
- * - :users_id
- * - :default_allow_delete
- * - :default_allow_edit
- * - :default_allow_read
- * - :item_type
- */
- protected function _getTopLevelEntityEditSQLTemplate($strBaseTable,$strPrimaryKey,$arrIds,$strCreator='creators_id') {
-
- return
- "SELECT
- b.{$this->_objMCP->escapeString($strPrimaryKey)} item_id #base item unique id#
-
- #can user delete role#
- ,CASE
-
- #user permission resolution (priority)#
- WHEN upe.`delete` IS NOT NULL
- THEN upe.`delete`
-
- WHEN b.`{$this->_objMCP->escapeString($strCreator)}` = upe.users_id AND upe.`delete_own` IS NOT NULL
- THEN upe.`delete_own`
-
- WHEN upp.`delete` IS NOT NULL
- THEN upp.delete
-
- WHEN b.`{$this->_objMCP->escapeString($strCreator)}` = upp.users_id AND upp.`delete_own` IS NOT NULL
- THEN upp.`delete_own`
-
- #role permission resolution#
- WHEN MAX(rpe.`delete`) IS NOT NULL
- THEN MAX(rpe.`delete`)
-
- WHEN b.`{$this->_objMCP->escapeString($strCreator)}` = :users_id AND MAX(rpe.`delete_own`) IS NOT NULL
- THEN MAX(rpe.`delete_own`)
-
- WHEN MAX(rpp.`delete`) IS NOT NULL
- THEN MAX(rpp.`delete`)
-
- WHEN b.`{$this->_objMCP->escapeString($strCreator)}` = :users_id AND MAX(rpp.`delete_own`) IS NOT NULL
- THEN MAX(rpp.`delete_own`)
-
- #by default the creator of the node is allowed to delete it#
- WHEN b.`{$this->_objMCP->escapeString($strCreator)}` = :users_id
- THEN 1
-
- #by default if user has no permissions to delete deny#
- ELSE
- :default_allow_delete
-
- END allow_delete
-
- #can the user edit role#
- ,CASE
-
- #user permission resolution (priority)#
- WHEN upe.`edit` IS NOT NULL
- THEN upe.`edit`
-
- WHEN b.`{$this->_objMCP->escapeString($strCreator)}` = upe.users_id AND upe.`edit_own` IS NOT NULL
- THEN upe.`edit_own`
-
- WHEN upp.`edit` IS NOT NULL
- THEN upp.`edit`
-
- WHEN b.`{$this->_objMCP->escapeString($strCreator)}` = upp.users_id AND upp.`edit_own` IS NOT NULL
- THEN upp.`edit_own`
-
- #role permission resolution#
- WHEN MAX(rpe.`edit`) IS NOT NULL
- THEN MAX(rpe.`edit`)
-
- WHEN b.`{$this->_objMCP->escapeString($strCreator)}` = :users_id AND MAX(rpe.`edit_own`) IS NOT NULL
- THEN MAX(rpe.`edit_own`)
-
- WHEN MAX(rpp.`edit`) IS NOT NULL
- THEN MAX(rpp.`edit`)
-
- WHEN b.`{$this->_objMCP->escapeString($strCreator)}` = :users_id AND MAX(rpp.`edit_own`) IS NOT NULL
- THEN MAX(rpp.`edit_own`)
-
- #by default creator of role is allowed to edit it#
- WHEN b.`{$this->_objMCP->escapeString($strCreator)}` = :users_id
- THEN 1
-
- #deny edit for everyone else#
- ELSE
- :default_allow_edit
-
- END allow_edit
-
- #can the user read role#
- ,CASE
-
- #user permission resolution (priority)#
- WHEN upe.`read` IS NOT NULL
- THEN upe.`read`
-
- WHEN b.`{$this->_objMCP->escapeString($strCreator)}` = upe.users_id AND upe.`read_own` IS NOT NULL
- THEN upe.`read_own`
-
- WHEN upp.`read` IS NOT NULL
- THEN upp.`read`
-
- WHEN b.`{$this->_objMCP->escapeString($strCreator)}` = upp.users_id AND upp.`read_own` IS NOT NULL
- THEN upp.`read_own`
-
- #role permission resolution#
- WHEN MAX(rpe.`read`) IS NOT NULL
- THEN MAX(rpe.`read`)
-
- WHEN b.`{$this->_objMCP->escapeString($strCreator)}` = :users_id AND MAX(rpe.`read_own`) IS NOT NULL
- THEN MAX(rpe.`read_own`)
-
- WHEN MAX(rpp.`read`) IS NOT NULL
- THEN MAX(rpp.`read`)
-
- WHEN b.`{$this->_objMCP->escapeString($strCreator)}` = :users_id AND MAX(rpp.`read_own`) IS NOT NULL
- THEN MAX(rpp.`read_own`)
-
- #by default author may read role#
- WHEN b.`{$this->_objMCP->escapeString($strCreator)}` = :users_id
- THEN 1
-
- #by default restrict read#
- ELSE
- :default_allow_read
-
- END allow_read
- FROM
- {$this->_objMCP->escapeString($strBaseTable)} b #base entity table#
- LEFT OUTER
- JOIN
- MCP_PERMISSIONS_USERS upe #user permission entity#
- ON
- b.{$this->_objMCP->escapeString($strPrimaryKey)} = upe.item_id
- AND
- upe.users_id = :users_id
- AND
- upe.item_type = :item_type
- LEFT OUTER
- JOIN
- MCP_PERMISSIONS_USERS upp #user parent permission entity#
- ON
- upp.item_id = 0
- AND
- upp.users_id = :users_id
- AND
- upp.item_type = :item_type
- LEFT OUTER
- JOIN
- MCP_USERS_ROLES u2r #roles user is assigned to#
- ON
- u2r.users_id = :users_id
- LEFT OUTER
- JOIN
- MCP_ROLES r #roles#
- ON
- u2r.roles_id = r.roles_id
- AND
- r.deleted = 0
- LEFT OUTER
- JOIN
- MCP_PERMISSIONS_ROLES rpe #role permission entity#
- ON
- b.{$this->_objMCP->escapeString($strPrimaryKey)} = rpe.item_id
- AND
- rpe.item_type = :item_type
- AND
- r.roles_id = rpe.roles_id
- LEFT OUTER
- JOIN
- MCP_USERS_ROLES u2r2 #parent role permission#
- ON
- u2r2.users_id = :users_id
- LEFT OUTER
- JOIN
- MCP_ROLES r2 #roles - resolving parent relationship#
- ON
- u2r2.roles_id = r2.roles_id
- AND
- r2.deleted = 0
- LEFT OUTER
- JOIN
- MCP_PERMISSIONS_ROLES rpp #role permission parent#
- ON
- rpp.item_type = :item_type
- AND
- rpp.item_id = 0
- AND
- r2.roles_id = rpp.roles_id
- WHERE
- b.{$this->_objMCP->escapeString($strPrimaryKey)} IN ({$this->_objMCP->escapeString(implode(',',$arrIds))})
- GROUP
- BY
- b.{$this->_objMCP->escapeString($strPrimaryKey)}";
-
- }
-
- /*
- * Child level create permissions will be granted based on the childs
- * context or parent. For example, a node may be created based on
- * its context. This makes it possible to allow creation of a "project"
- * and restrict creation of "blog" or anything. This allows a very granular
- * level of control over who can create what.
- *
- *
- * @param str base table
- * @param str base table primary key column name
- * @param array contextual ids
- * @param base table creators column
- * @return str SQL statement
- *
- * query placeholders:
- *
- * - :item_type
- * - :users_id
- * - :default_allow_add
- * - :deny_add_msg_dev
- * - :deny_add_msg_user
- */
- protected function _getChildLevelEntityCreateSQLTemplate($strBaseTable,$strPrimaryKey,$arrIds,$strCreator='creators_id') {
-
- return
- "SELECT
- b.{$this->_objMCP->escapeString($strPrimaryKey)} item_id #the generic entity id#
- ,CASE
-
- #user permissions have precedence over roles. Determoine whether user has explicit setting to create a node of the type#
- WHEN pu.add_child IS NOT NULL
- THEN pu.add_child
-
- #user permissions have precedence over roles. Determine whether user has explicit setting to create node of a type they created#
- WHEN b.{$this->_objMCP->escapeString($strCreator)} = pu.users_id AND pu.add_own_child IS NOT NULL
- THEN pu.add_own_child
-
- #determines whether user is assigned to role that has settings for creating node of type#
- WHEN MAX(pr.add_child) IS NOT NULL
- THEN MAX(pr.add_child)
-
- #Determines whether user is assigned to role that has settings for creating node of a type that they created#
- WHEN b.{$this->_objMCP->escapeString($strCreator)} = :users_id AND MAX(pr.add_own_child) IS NOT NULL
- THEN MAX(pr.add_own_child)
-
- #by default creator of node type can create nodes of that type#
- WHEN b.{$this->_objMCP->escapeString($strCreator)} = :users_id
- THEN 1
-
- #When nothing has been matched deny creation of node of specified type#
- ELSE
- :default_allow_add
-
- END allow_add
-
- ,:deny_add_msg_dev deny_add_msg_dev
- ,:deny_add_msg_user deny_add_msg_user
-
- FROM
- {$this->_objMCP->escapeString($strBaseTable)} b #base table entity#
- LEFT OUTER
- JOIN
- MCP_PERMISSIONS_USERS pu #current logged-in users explicit permission settings#
- ON
- pu.item_type = :item_type #base entity type#
- AND
- b.{$this->_objMCP->escapeString($strPrimaryKey)} = pu.item_id #base entity primary key#
- AND
- pu.users_id = :users_id
- LEFT OUTER
- JOIN
- MCP_USERS_ROLES u2r #roles that the current user is assigned to. This is the look-up table that assigns a role to a user#
- ON
- u2r.users_id = :users_id
- LEFT OUTER
- JOIN
- MCP_ROLES r
- ON
- u2r.roles_id = r.roles_id
- AND
- r.deleted = 0 #ignore roles that have been deleted ie. when deleted is null the role has beeen deleted#
- LEFT OUTER
- JOIN
- MCP_PERMISSIONS_ROLES pr #permission settings for the roles that the current user has been assigned to#
- ON
- pr.item_type = :item_type #base entity type#
- AND
- b.{$this->_objMCP->escapeString($strPrimaryKey)} = pr.item_id #base entity primary key#
- AND
- r.roles_id = pr.roles_id #role#
- WHERE
- b.{$this->_objMCP->escapeString($strPrimaryKey)} IN ({$this->_objMCP->escapeString(implode(',',$arrIds))})
- GROUP
- BY
- b.{$this->_objMCP->escapeString($strPrimaryKey)}";
-
- }
-
- /*
- * @param str base table
- * @param str base table primary key column
- * @param str parent table primary key column
- * @param array entity ids
- * @param str creators column name for base table
- * @return str SQL statement
- *
- * palceholders:
- *
- * - :users_id
- * - :default_allow_delete
- * - :default_allow_edit
- * - :default_allow_read
- * - :item_type
- * - :item_type_parent
- */
- protected function _getChildLevelEntityEditSQLTemplate($strBaseTable,$strPrimaryKey,$strParentPrimaryKey,$arrIds,$strCreator='creators_id') {
-
- return
- "SELECT
- b.{$this->_objMCP->escapeString($strPrimaryKey)} item_id #base item unique id#
-
- #can user delete node#
- ,CASE
-
- #user permission resolution (priority)#
- WHEN upe.`delete` IS NOT NULL
- THEN upe.`delete`
-
- WHEN b.{$this->_objMCP->escapeString($strCreator)} = upe.users_id AND upe.`delete_own` IS NOT NULL
- THEN upe.`delete_own`
-
- WHEN b.{$this->_objMCP->escapeString($strCreator)} = upp.users_id AND upp.`delete_own_child` IS NOT NULL
- THEN upp.`delete_own_child`
-
- WHEN upp.`delete_child` IS NOT NULL
- THEN upp.`delete_child`
-
- #role permission resolution#
- WHEN MAX(rpe.`delete`) IS NOT NULL
- THEN MAX(rpe.`delete`)
-
- WHEN b.{$this->_objMCP->escapeString($strCreator)} = :users_id AND MAX(rpe.`delete_own`) IS NOT NULL
- THEN MAX(rpe.`delete_own`)
-
- WHEN b.{$this->_objMCP->escapeString($strCreator)} = :users_id AND MAX(rpp.`delete_own_child`) IS NOT NULL
- THEN MAX(rpp.`delete_own_child`)
-
- WHEN MAX(rpp.`delete_child`) IS NOT NULL
- THEN MAX(rpp.`delete_child`)
-
- #by default the creator of the node is allowed to delete it#
- WHEN b.{$this->_objMCP->escapeString($strCreator)} = :users_id
- THEN 1
-
- #by default if user has no permissions to delete deny#
- ELSE
- :default_allow_delete
-
- END allow_delete
-
- #can the user edit node#
- ,CASE
-
- #user permission resolution (priority)#
- WHEN upe.`edit` IS NOT NULL
- THEN upe.`edit`
-
- WHEN b.{$this->_objMCP->escapeString($strCreator)} = upe.users_id AND upe.`edit_own` IS NOT NULL
- THEN upe.`edit_own`
-
- WHEN b.{$this->_objMCP->escapeString($strCreator)} = upp.users_id AND upp.`edit_own_child` IS NOT NULL
- THEN upp.`edit_own_child`
-
- WHEN upp.`edit_child` IS NOT NULL
- THEN upp.`edit_child`
-
- #role permission resolution#
- WHEN MAX(rpe.`edit`) IS NOT NULL
- THEN MAX(rpe.`edit`)
-
- WHEN b.{$this->_objMCP->escapeString($strCreator)} = :users_id AND MAX(rpe.`edit_own`) IS NOT NULL
- THEN MAX(rpe.`edit_own`)
-
- WHEN b.{$this->_objMCP->escapeString($strCreator)} = :users_id AND MAX(rpp.`edit_own_child`) IS NOT NULL
- THEN MAX(rpp.`edit_own_child`)
-
- WHEN MAX(rpp.`edit_child`) IS NOT NULL
- THEN MAX(rpp.`edit_child`)
-
- #by default creator of node is allowed to edit it#
- WHEN b.{$this->_objMCP->escapeString($strCreator)} = :users_id
- THEN 1
-
- #deny edit for everyone else#
- ELSE
- :default_allow_edit
-
- END allow_edit
-
- #can the user read node#
- ,CASE
-
- #user permission resolution (priority)#
- WHEN upe.`read` IS NOT NULL
- THEN upe.`read`
-
- WHEN b.{$this->_objMCP->escapeString($strCreator)} = upe.users_id AND upe.`read_own` IS NOT NULL
- THEN upe.`read_own`
-
- WHEN b.{$this->_objMCP->escapeString($strCreator)} = upp.users_id AND upp.`read_own_child` IS NOT NULL
- THEN upp.`read_own_child`
-
- WHEN upp.`read_child` IS NOT NULL
- THEN upp.`read_child`
-
- #role permission resolution#
- WHEN MAX(rpe.`read`) IS NOT NULL
- THEN MAX(rpe.`read`)
-
- WHEN b.{$this->_objMCP->escapeString($strCreator)} = :users_id AND MAX(rpe.`read_own`) IS NOT NULL
- THEN MAX(rpe.`read_own`)
-
- WHEN b.{$this->_objMCP->escapeString($strCreator)} = :users_id AND MAX(rpp.`read_own_child`) IS NOT NULL
- THEN MAX(rpp.`read_own_child`)
-
- WHEN MAX(rpp.`read_child`) IS NOT NULL
- THEN MAX(rpp.`read_child`)
-
- #by default author may read node#
- WHEN b.{$this->_objMCP->escapeString($strCreator)} = :users_id
- THEN 1
-
- #by default everyone may read the node#
- ELSE
- :default_allow_read
-
- END allow_read
-
- FROM
- {$this->_objMCP->escapeString($strBaseTable)} b #base entity table#
-
- # user entity permission#
- LEFT OUTER
- JOIN
- MCP_PERMISSIONS_USERS upe #explicit user node permissions(highest precedence) - user(u) permission(p) entity(e)#
- ON
- b.{$this->_objMCP->escapeString($strPrimaryKey)} = upe.item_id
- AND
- upe.users_id = :users_id
- AND
- upe.item_type = :item_type
-
- #user entity parent permission#
- LEFT OUTER
- JOIN
- MCP_PERMISSIONS_USERS upp #explicit user node type permissions (parent permission) - user(u) permission(p) parent(p)#
- ON
- b.{$this->_objMCP->escapeString($strParentPrimaryKey)} = upp.item_id
- AND
- upp.users_id = :users_id
- AND
- upp.item_type = :item_type_parent
-
- # entity role permission#
- LEFT OUTER
- JOIN
- MCP_USERS_ROLES u2r #roles user has been assigned to - for entity role permission resolution#
- ON
- u2r.users_id = :users_id
- LEFT OUTER
- JOIN
- MCP_ROLES r #roles - resolving entity role permission#
- ON
- u2r.roles_id = r.roles_id
- AND
- r.deleted = 0
- LEFT OUTER
- JOIN
- MCP_PERMISSIONS_ROLES rpe #role(r) permission(p) entity(e)#
- ON
- rpe.item_type = :item_type
- AND
- b.{$this->_objMCP->escapeString($strPrimaryKey)} = rpe.item_id
- AND
- r.roles_id = rpe.roles_id
-
- # parent role permission#
- LEFT OUTER
- JOIN
- MCP_USERS_ROLES u2r2 #roles users has been assigned to - for parent role permission resolution#
- ON
- u2r2.users_id = :users_id
- LEFT OUTER
- JOIN
- MCP_ROLES r2 #roles - resolving parent entity role permission#
- ON
- u2r2.roles_id = r2.roles_id
- AND
- r2.deleted = 0
- LEFT OUTER
- JOIN
- MCP_PERMISSIONS_ROLES rpp #role(r) permission(p) parent(p)#
- ON
- rpp.item_type = :item_type_parent
- AND
- b.{$this->_objMCP->escapeString($strParentPrimaryKey)} = rpp.item_id
- AND
- r2.roles_id = rpp.roles_id
-
- WHERE
- b.{$this->_objMCP->escapeString($strPrimaryKey)} IN ({$this->_objMCP->escapeString(implode(',',$arrIds))})
- GROUP
- BY
- b.{$this->_objMCP->escapeString($strPrimaryKey)}";
-
- }
-
- public function read($ids) {
-
- $permissions = $this->_rud($ids,$this->_objMCP->getUsersId());
-
- $return = array();
- foreach($permissions as $permission) {
- $return[$permission['item_id']] = array(
- 'allow'=>(bool) $permission['allow_read']
- ,'msg_dev'=>$permission['deny_read_msg_dev']
- ,'msg_user'=>'You may not see %s.'
- );
- }
-
- foreach(array_diff($ids,array_keys($return)) as $id) {
- $return[$id] = array(
- 'allow'=>false
- ,'msg_dev'=>'You are not allowed to see specified %s'
- ,'msg_user'=>'You may not see %s.'
- );
- }
-
- return $return;
-
- }
-
- public function delete($ids) {
-
- $permissions = $this->_rud($ids,$this->_objMCP->getUsersId());
-
- $return = array();
- foreach($permissions as $permission) {
- $return[$permission['item_id']] = array(
- 'allow'=>(bool) $permission['allow_delete']
- ,'msg_dev'=>$permission['deny_delete_msg_dev']
- ,'msg_user'=>'You may not delete %s.'
- );
- }
-
- foreach(array_diff($ids,array_keys($return)) as $id) {
- $return[$id] = array(
- 'allow'=>false
- ,'msg_dev'=>'You are not allowed to delete specified %s'
- ,'msg_user'=>'You may not delete %s.'
- );
- }
-
- return $return;
-
- }
-
- public function edit($ids) {
-
- $permissions = $this->_rud($ids,$this->_objMCP->getUsersId());
-
- $return = array();
- foreach($permissions as $permission) {
- $return[$permission['item_id']] = array(
- 'allow'=>(bool) $permission['allow_edit']
- ,'msg_dev'=>$permission['deny_edit_msg_dev']
- ,'msg_user'=>'You may not edit %s.'
- );
- }
-
- foreach(array_diff($ids,array_keys($return)) as $id) {
- $return[$id] = array(
- 'allow'=>false
- ,'msg_dev'=>'You are not allowed to edit specified %s'
- ,'msg_user'=>'You may not edit %s.'
- );
- }
-
- return $return;
-
- }
-
-}
-?>
\ No newline at end of file
diff --git a/mcp_root/App/Resource/Permission/Plugin/Admin.php b/mcp_root/App/Resource/Permission/Plugin/Admin.php
deleted file mode 100644
index 59af83d..0000000
--- a/mcp_root/App/Resource/Permission/Plugin/Admin.php
+++ /dev/null
@@ -1,5 +0,0 @@
-
\ No newline at end of file
diff --git a/mcp_root/App/Resource/Session/DAO/DAOSessionHandler.php b/mcp_root/App/Resource/Session/DAO/DAOSessionHandler.php
old mode 100755
new mode 100644
diff --git a/mcp_root/App/Resource/Session/SessionHandler.php b/mcp_root/App/Resource/Session/SessionHandler.php
old mode 100755
new mode 100644
diff --git a/mcp_root/App/Resource/Site/DAO/DAOSite.php b/mcp_root/App/Resource/Site/DAO/DAOSite.php
old mode 100755
new mode 100644
diff --git a/mcp_root/App/Resource/Site/Site.php b/mcp_root/App/Resource/Site/Site.php
old mode 100755
new mode 100644
diff --git a/mcp_root/App/Resource/Template/Template.php b/mcp_root/App/Resource/Template/Template.php
old mode 100755
new mode 100644
index 3c8b85e..4a2ad82
--- a/mcp_root/App/Resource/Template/Template.php
+++ b/mcp_root/App/Resource/Template/Template.php
@@ -51,7 +51,9 @@ private function _init() {
/*
* Maybe not the best place but it will work.
*/
- $this->_doctype = $this->_objMCP->getConfigValue('site_doctype');
+ if(INSTALLED) {
+ $this->_doctype = $this->_objMCP->getConfigValue('site_doctype');
+ }
}
/*
diff --git a/mcp_root/App/Resource/User/User.php b/mcp_root/App/Resource/User/User.php
old mode 100755
new mode 100644
diff --git a/mcp_root/Component/Config/DAO/DAOConfig.php b/mcp_root/Component/Config/DAO/DAOConfig.php
old mode 100755
new mode 100644
diff --git a/mcp_root/Component/Config/Module/Form/Form.php b/mcp_root/Component/Config/Module/Form/Form.php
old mode 100755
new mode 100644
diff --git a/mcp_root/Component/Config/Template/Form/Form.php b/mcp_root/Component/Config/Template/Form/Form.php
old mode 100755
new mode 100644
diff --git a/mcp_root/Component/Field/DAO/DAOField.php b/mcp_root/Component/Field/DAO/DAOField.php
old mode 100755
new mode 100644
index 05324ad..8619b57
--- a/mcp_root/Component/Field/DAO/DAOField.php
+++ b/mcp_root/Component/Field/DAO/DAOField.php
@@ -474,6 +474,27 @@ public function getFrmConfig($strEntityType,$intEntitiesId=null,$intSitesId=null
$values.= ''.$field['cfg_widget'].'';
}
+
+ /**
+ * Add meta data for video fields
+ */
+ if(strcasecmp($field['cfg_media'],'video') === 0) {
+ $values.=
+ '
+
+ select
+
+ select
+ SELECT codecs_id value, codecs_id label FROM MCP_ENUM_VIDEO_CODECS
+
+
+ select
+
+ select
+ SELECT containers_id value, ext label FROM MCP_ENUM_VIDEO_CONTAINERS
+
+ ';
+ }
/*
* ---------------------------------------------------------------------------------------
@@ -558,7 +579,7 @@ public function getFrmConfig($strEntityType,$intEntitiesId=null,$intSitesId=null
username ASC
';
- break;
+ break;
default:
}
@@ -658,7 +679,7 @@ public function getFrmConfig($strEntityType,$intEntitiesId=null,$intSitesId=null
/*$cfg = $this->_objMCP->getFrmConfig($xml,'frm');
echo '
'.print_r($cfg,true).'
';
- exit;*/
+ exit;
/*
* Convert to config
diff --git a/mcp_root/Component/Field/Module/Form/Form.php b/mcp_root/Component/Field/Module/Form/Form.php
old mode 100755
new mode 100644
diff --git a/mcp_root/Component/Field/Module/List/List.php b/mcp_root/Component/Field/Module/List/List.php
old mode 100755
new mode 100644
diff --git a/mcp_root/Component/Field/Template/Form/Form.php b/mcp_root/Component/Field/Template/Form/Form.php
old mode 100755
new mode 100644
diff --git a/mcp_root/Component/Field/Template/List/List.php b/mcp_root/Component/Field/Template/List/List.php
old mode 100755
new mode 100644
diff --git a/mcp_root/Component/Field/Template/List/Redirect.php b/mcp_root/Component/Field/Template/List/Redirect.php
old mode 100755
new mode 100644
diff --git a/mcp_root/Component/Menu/Theme/Menu.php b/mcp_root/Component/Menu/Theme/Menu.php
deleted file mode 100644
index 3e558ca..0000000
--- a/mcp_root/Component/Menu/Theme/Menu.php
+++ /dev/null
@@ -1,7 +0,0 @@
-
diff --git a/mcp_root/Component/Navigation/DAO/DAONavigation.php b/mcp_root/Component/Navigation/DAO/DAONavigation.php
deleted file mode 100755
index 578575f..0000000
--- a/mcp_root/Component/Navigation/DAO/DAONavigation.php
+++ /dev/null
@@ -1,1079 +0,0 @@
-_objMCP->query($strSQL);
-
- if($strLimit === null) {
- return $arrRows;
- } else {
- return array(
- $arrRows
- ,array_pop(array_pop($this->_objMCP->query('SELECT FOUND_ROWS()')))
- );
- }
- }
-
- /*
- * Fetch menu by id
- *
- * @param int navigation id
- * @return arr navigation data
- */
- public function fetchNavById($intId) {
-
- /*$strSQL = sprintf(
- 'SELECT %s FROM MCP_NAVIGATION WHERE navigation_id = %s'
- ,$strSelect
- ,$this->_objMCP->escapeString($intId)
- );*/
-
- $strSQL = 'SELECT * FROM MCP_NAVIGATION WHERE navigation_id = :navigation_id';
-
- return array_pop($this->_objMCP->query(
- $strSQL
- ,array(
- ':navigation_id'=>(int) $intId
- )
- ));
- }
-
- /*
- * Fetch navigation link by id
- *
- * @param int links id
- * @param str columns to select
- */
- public function fetchLinkById($intId,$strSelect='*') {
-
- /*$strSQL = sprintf(
- 'SELECT %s FROM MCP_NAVIGATION_LINKS WHERE navigation_links_id = %s'
- ,$strSelect
- ,$this->_objMCP->escapeString($intId)
- );*/
-
- $strSQL = 'SELECT * FROM MCP_NAVIGATION_LINKS WHERE navigation_links_id = :navigation_links_id';
-
- return array_pop($this->_objMCP->query(
- $strSQL
- ,array(
- ':navigation_links_id'=>(int) $intId
- )
- ));
- }
-
- /*
- * Get navigation link by route
- *
- * @param str module name
- * @param int sites id
- * @return array route data
- */
- public function fetchRoute($strSitesInternalUrl,$intSitesId) {
-
- /*$strSQL = sprintf(
- "SELECT * FROM MCP_NAVIGATION_LINKS WHERE sites_internal_url = '%s' AND sites_id = %s AND deleted = 0"
- ,$this->_objMCP->escapeString($strSitesInternalUrl)
- ,$this->_objMCP->escapeString($intSitesId)
- );*/
-
- $strSQL = 'SELECT * FROM MCP_NAVIGATION_LINKS WHERE sites_internal_url = :sites_internal_url AND sites_id = :sites_id AND deleted = 0';
-
- return array_pop($this->_objMCP->query(
- $strSQL
- ,array(
- ':sites_internal_url'=>(string) $strSitesInternalUrl
- ,':sites_id'=>(int) $intSitesId
- )
- ));
- }
-
- /*
- * Fetch menus by site and location
- *
- * @param str valid menu location [top,left,bottom,right]
- * @param int sites id - null identifies master
- * @return array navigation menu data
- */
- public function fetchNavBySiteLocation($strLocation,$intSitesId=null) {
-
- $strSQL = sprintf(
- "SELECT * FROM MCP_NAVIGATION WHERE menu_location = :menu_location AND sites_id %s :sites_id AND deleted = 0"
- ,$intSitesId === null?'IS':'='
- );
-
- return array_pop($this->_objMCP->query(
- $strSQL
- ,array(
- ':sites_id'=>$intSitesId === null?null:intval($intSitesId)
- ,':menu_location'=>$strLocation
- )
- ));
- }
-
- /*
- * Build navigation menu
- *
- * @param int parent id
- * @param str parent type [nav,link]
- * @param bool recursive?
- * @param bool accept cached version of COMPLETE menu?
- * @return array menu
- */
- public function fetchMenu($intParentId,$strParentType='nav',$boolR=true,$boolCache=true) {
-
- /*
- * Cache option is active for a complete menu build
- */
- if( strcmp('nav',$strParentType) === 0 && $boolR === true && $boolCache === true) {
- $arrCachedNav = $this->_getCachedNav($intParentId);
- if( $arrCachedNav !== null ) {
- return $arrCachedNav;
- }
- }
-
- /*
- * Locate all real navigation links
- */
- /*$strSQL = sprintf(
- "SELECT * FROM MCP_NAVIGATION_LINKS WHERE parent_type = '%s' AND parent_id = %s AND deleted = 0 ORDER BY sort_order ASC"
- ,$this->_objMCP->escapeString($strParentType)
- ,$this->_objMCP->escapeString($intParentId)
- );*/
-
- $strSQL = "SELECT
- *
- FROM
- MCP_NAVIGATION_LINKS
- WHERE
- parent_type = :parent_type
- AND
- parent_id = :parent_id
- AND
- datasource_dao IS NULL
- AND
- datasource_query IS NULL
- AND
- datasources_row_id IS NULL
- AND
- deleted = 0
- ORDER
- BY
- sort_order ASC";
-
- $arrNavigationLinks = $this->_objMCP->query(
- $strSQL
- ,array(
- ':parent_type'=>(string) $strParentType
- ,':parent_id'=>(int) $intParentId
- )
- );
-
- /*
- * Data source capabilities are not worth the trouble right now. Will be revisited at a later date.
- */
- if( 1 == 2 ) {
-
- $arrParentLink = strpos($strParentType,'link') === 0?$this->fetchLinkById($intParentId):null;
- $arrDynamicLinks = array();
- $arrDataSources = array();
- $arrPlaceholders = array();
-
- /*
- * Locate all dynamic links for parent link
- */
- if($arrParentLink !== null && $arrParentLink['datasources_row_id'] !== null) {
- $arrDynamicLinks = $this->fetchDynamicLinkById($arrParentLink['datasources_id'],$arrParentLink['datasources_row_id']);
- $arrDynamicLinks = $arrDynamicLinks?$arrDynamicLinks['navigation_links']:array();
- }
-
- /*
- * Replace all real navigation links placeholders with real-time data
- */
- foreach($arrNavigationLinks as &$arrLink) {
- if($arrLink['datasources_row_id'] !== null) {
- $arrLink = $this->fetchDynamicLinkById($arrLink['datasources_id'],$arrLink['datasources_row_id']);
- $arrPlaceholders["{$arrLink['datasources_id']}-{$arrLink['datasources_row_id']}"] = $arrLink;
- }
- }
-
- /*
- * Parse out datasource links
- */
- foreach($arrNavigationLinks as $intIndex=>&$arrLink) {
- if(isset($arrLink['datasource_dao']) || isset($arrLink['datasource_query'])) {
- $arrDynamicLinks = array_merge($arrDynamicLinks,$this->fetchDynamicLinks($arrLink['navigation_links_id']));
- array_unshift($arrDataSources,$intIndex);
- }
- }
-
- /*
- * Add dynamic links without hard link reference to end of navigation link array
- */
- foreach($arrDynamicLinks as $arrDynamicLink) {
-
- $strId = "{$arrDynamicLink['datasources_id']}-{$arrDynamicLink['datasources_row_id']}";
- $boolDataSource = $arrParentLink && (isset($arrParentLink['datasource_dao']) || isset($arrParentLink['datasource_query']))?true:false;
-
- /*
- * Support moving dynamic navigation links to new parent
- */
- if(!isset($arrPlaceholders[$strId]) &&
- ($arrParentLink === null || ($boolDataSource === false && $arrDynamicLink['parent_id'] == $arrParentLink['navigation_links_id']) || ($boolDataSource === false && $arrDynamicLink['parent_id'] == $arrParentLink['parent_id']))
- ) {
- $arrNavigationLinks[] = $arrDynamicLink;
- }
- }
-
- /*
- * Remove all datasource links
- */
- foreach($arrDataSources as $intIndex) {
- array_splice($arrNavigationLinks,$intIndex,1);
- }
-
- }
-
- // when not recursive return links without parsing children
- if($boolR === false) return $arrNavigationLinks;
-
- if(!empty($arrNavigationLinks)) {
- foreach($arrNavigationLinks as &$arrNavigationLink) {
- $arrNavigationLink['navigation_links'] = !is_numeric($arrNavigationLink['navigation_links_id'])?$arrNavigationLink['navigation_links']:$this->fetchMenu($arrNavigationLink['navigation_links_id'],'link',true);
- }
- }
-
- return $arrNavigationLinks;
-
- }
-
- /*
- * Fetch links ancestory
- *
- * @param int navigation links id
- * @return array navigation links
- */
- public function fetchAncestory($intLinksId) {
-
- $arrLinks = array();
- while($arrLink = $this->fetchLinkById($intLinksId)) {
-
- /*if($arrLink['datasources_row_id'] !== null) {
- $arrLink = $this->fetchDynamicLinkById($arrLink['datasources_id'],$arrLink['datasources_row_id']);
- }*/
-
- array_unshift($arrLinks,$arrLink);
- $intLinksId = strcmp($arrLink['parent_type'],'link') == 0?$arrLink['parent_id']:0;
-
- }
-
- return $arrLinks;
-
- }
-
- /*
- * Get menu data that link belongs to, regardless of links depth
- *
- * @param int links id
- * @return array menu data
- */
- public function fetchNavByLinkId($intLinkId) {
-
- /*
- * Get links ancestory
- */
- $arrAncestory = $this->fetchAncestory($intLinkId);
-
- /*
- * Get the top link
- */
- $arrTopLink = array_shift($arrAncestory);
-
- /*
- * Get menu for top link
- */
- return $this->fetchNavById($arrTopLink['parent_id']);
-
- }
-
- /*
- * Get list of all available navigation menu locations
- *
- * @return array navigation menu locations
- */
- public function fetchNavLocations() {
- $arrResult = $this->_objMCP->query('DESCRIBE MCP_NAVIGATION');
- $arrLocations = array();
-
- foreach($arrResult as $arrColumn) {
- if(strcmp('menu_location',$arrColumn['Field']) == 0) {
- foreach(explode(',',str_replace("'",'',trim(trim($arrColumn['Type'],'enum('),')'))) as $strLocation) {
- $arrLocations[] = array('value'=>$strLocation,'label'=>$strLocation);
- }
- }
- }
-
- return $arrLocations;
- }
-
- /*
- * Get list of all available navigation links window targets
- *
- * @return array navigation links targets
- */
- public function fetchLinksTargetWindows() {
-
- $targets = array();
-
- $arrResult = $this->_objMCP->query('DESCRIBE MCP_NAVIGATION_LINKS');
-
- foreach($arrResult as $arrColumn) {
- if(strcmp('target_window',$arrColumn['Field']) == 0) {
- foreach( explode(',',str_replace("'",'',trim(trim($arrColumn['Type'],'enum('),')'))) as $target ) {
- $targets[] = array(
- 'value'=>$target
- ,'label'=>$target
- );
- }
- }
- }
-
- return $targets;
- }
-
- /*
- * Fetch available content types for links
- *
- * @param str content link field
- * @return array content types
- */
- public function fetchLinksContentTypes($strField) {
-
- $types = array();
-
- $arrResult = $this->_objMCP->query('DESCRIBE MCP_NAVIGATION_LINKS');
-
- foreach($arrResult as $arrColumn) {
- if(strcmp($strField,$arrColumn['Field']) == 0) {
- foreach( explode(',',str_replace("'",'',trim(trim($arrColumn['Type'],'enum('),')'))) as $type) {
- $types[] = array(
- 'value'=>$type
- ,'label'=>$type
- );
- }
- }
- }
-
- return $types;
- }
-
- /*
- * Insert or update navigation menu
- */
- public function saveNav($arrNav) {
- return $this->_save(
- $arrNav
- ,'MCP_NAVIGATION'
- ,'navigation_id'
- ,array('menu_title','menu_location','system_name')
- ,'created_on_timestamp'
- );
- }
-
- /*
- * Insert or update navigation link
- */
- public function saveLink($arrLink) {
-
- $intId = $this->_save(
- $arrLink
- ,'MCP_NAVIGATION_LINKS'
- ,'navigation_links_id'
- ,array('parent_type','link_title','browser_title','page_heading','link_url','sites_internal_url','target_module','target_template','target_window','new_window_name','header_content','body_content','footer_content','header_content_type','body_content_type','footer_content_type','datasource_query','datasource_dao','datasource_dao_method')
- ,'created_on_timestamp'
- ,array('target_module_args','target_module_config','links_data','datasource_dao_args')
- ,array('link_title')
- );
-
- // ---- Update the nvaigation menu cache -----------------------------------------
-
- /*
- * Get the links id
- */
- $intLinkId = isset($arrLink['navigation_links_id'])?$arrLink['navigation_links_id']:$intId;
-
- /*
- * Get the navigation menu associated with the link
- */
- $arrNav = $this->fetchNavByLinkId($intLinkId);
-
- /*
- * Set the cache value for the links associated navigation menu
- */
- $this->_setCachedNav($arrNav['navigation_id']);
-
- }
-
- /*
- * Moves link down one
- *
- * @param int navigation links id
- * @return affected rows
- */
- public function moveLinkDown($intLinksId) {
-
- /*
- * Get links data
- */
- $arrTarget = $this->fetchLinkById($intLinksId);
-
- /*
- * Get all links
- */
- $arrLinks = $this->fetchMenu($arrTarget['parent_id'],$arrTarget['parent_type'],false);
- $arrIds = array();
-
- /*
- * collect all link ids
- */
- $boolMove = false;
- foreach($arrLinks as $intIndex=>$arrLink) {
-
- if($arrLink['navigation_links_id'] == $arrTarget['navigation_links_id'] && $intIndex != (count($arrLinks)-1)) {
- $boolMove = true;
- continue;
- }
-
- $arrIds[] = $arrLink['navigation_links_id'];
-
- if($boolMove === true) {
- $boolMove = false;
- $arrIds[] = $arrTarget['navigation_links_id'];
- }
- }
-
- $arrUpdate = array();
- foreach($arrIds as $intSort=>$intId) {
- $arrUpdate[] = sprintf('(%u,%u)',$intId,$intSort);
- }
-
- $strSQL = sprintf(
- 'INSERT IGNORE INTO MCP_NAVIGATION_LINKS (navigation_links_id,sort_order) VALUES %s ON DUPLICATE KEY UPDATE sort_order = VALUES(sort_order)'
- ,implode(',',$arrUpdate)
- );
-
- $this->_objMCP->query($strSQL);
-
- /*
- * Update the nav cache
- */
- $arrNav = $this->fetchNavByLinkId($intLinksId);
- $this->_setCachedNav($arrNav['navigation_id']);
-
- return 1;
-
- }
-
- /*
- * Moves link up one
- *
- * @param int navigation links id
- * @return affected rows
- */
- public function moveLinkUp($mixLinksId) {
-
- /*
- * Get links data
- */
- $arrTarget = $this->fetchLinkById($mixLinksId);
-
- /*
- * Get all links
- */
- $arrLinks = $this->fetchMenu($arrTarget['parent_id'],$arrTarget['parent_type'],false);
- $arrIds = array();
-
- /*
- * collect all link ids
- */
- $boolSkip = false;
- foreach($arrLinks as $intIndex=>$arrLink) {
-
- if($boolSkip === true) {
- $boolSkip = false;
- continue;
- }
-
- if(isset($arrLinks[($intIndex+1)]) && $arrLinks[($intIndex+1)]['navigation_links_id'] == $arrTarget['navigation_links_id']) {
- $boolSkip = true;
- $arrIds[] = $arrTarget['navigation_links_id'];
- }
-
- $arrIds[] = $arrLink['navigation_links_id'];
-
- }
-
- $arrUpdate = array();
- foreach($arrIds as $intSort=>$intId) {
- $arrUpdate[] = sprintf('(%u,%u)',$intId,$intSort);
- }
-
- $strSQL = sprintf(
- 'INSERT IGNORE INTO MCP_NAVIGATION_LINKS (navigation_links_id,sort_order) VALUES %s ON DUPLICATE KEY UPDATE sort_order = VALUES(sort_order)'
- ,implode(',',$arrUpdate)
- );
-
- $this->_objMCP->query($strSQL);
-
- /*
- * Update the nav cache
- */
- $arrNav = $this->fetchNavByLinkId($mixLinksId);
- $this->_setCachedNav($arrNav['navigation_id']);
-
- return 1;
-
- }
-
- /*
- * Delete a link
- *
- * @param int navigation links id
- * @return int affected rows
- */
- public function deleteLink($intLinksId) {
-
- /*
- * Get all links
- */
- $arrLinks = $this->fetchMenu($arrTarget['navigation_links_id'],'link');
- $objIds = new ArrayObject(array($arrTarget['navigation_links_id']));
-
- /*
- * recursive function to collect all child link ids
- */
- $func = create_function('$value,$index,$ids','if(strcmp(\'navigation_links_id\',$index) == 0) $ids[] = $value;');
-
- /*
- * Collect all child ids
- */
- array_walk_recursive($arrLinks,$func,$objIds);
-
- /*
- * Collect ids into normal array to use implode
- */
- $arrIds = array();
- foreach($objIds as $intId) {
- $arrIds[] = $intId;
- }
-
- /*
- * Create SQL
- */
- $strSQL = sprintf(
- //'DELETE FROM MCP_NAVIGATION_LINKS WHERE navigation_links_id IN (%s)'
- 'UPDATE
- MCP_NAVIGATION_LINKS
- SET
- MCP_NAVIGATION_LINKS.deleted = NULL
- WHERE
- MCP_NAVIGATION_LINKS.navigation_links_id IN (%s)'
- ,$this->_objMCP->escapeString(implode(',',$arrIds))
- );
-
- /*
- * Update the nav cache
- */
- $arrNav = $this->fetchNavByLinkId($intLinksId);
- $this->_setCachedNav($arrNav['navigation_id']);
-
- return $this->_objMCP->query($strSQL);
-
- }
-
- /*
- * Remove navigation link
- *
- * @param int navigation links id
- * @return int affected rows
- */
- public function removeLink($intLinksId) {
-
- /*
- * Get links data
- */
- $arrTarget = $this->fetchLinkById($intLinksId);
-
- /*
- * Get targets children
- */
- $arrChildren = $this->fetchMenu($arrTarget['navigation_links_id'],'link',false);
-
- /*
- * Get targets siblings
- */
- $arrLinks = $this->fetchMenu($arrTarget['parent_id'],$arrTarget['parent_type'],false);
-
- /*
- * reorder array
- */
- $arrIds = array();
-
- foreach($arrLinks as $arrLink) {
-
- /*
- * Replace links position with children
- */
- if($arrLink['navigation_links_id'] == $arrTarget['navigation_links_id']) {
- foreach($arrChildren as $arrChild) {
- $arrIds[] = $arrChild['navigation_links_id'];
- }
- continue;
- }
-
- $arrIds[] = $arrLink['navigation_links_id'];
- }
-
- /*
- * Build update
- */
- $arrUpdate = array();
- foreach($arrIds as $intIndex=>$intId) {
- $arrUpdate[] = sprintf(
- "(%s,%s,'%s',%s)"
- ,$this->_objMCP->escapeString($intId)
- ,$this->_objMCP->escapeString($arrTarget['parent_id'])
- ,$this->_objMCP->escapeString($arrTarget['parent_type'])
- ,$this->_objMCP->escapeString($intIndex)
- );
- }
-
- /*
- * Build update query
- */
- $strSQL = sprintf(
- 'INSERT IGNORE INTO MCP_NAVIGATION_LINKS (navigation_links_id,parent_id,parent_type,sort_order) VALUES %s ON DUPLICATE KEY UPDATE parent_id=VALUES(parent_id),parent_type=VALUES(parent_type),sort_order=VALUES(sort_order)'
- ,implode(',',$arrUpdate)
- );
-
- /*
- * Create delete query (soft-delete)
- */
- $strSQLDelete = sprintf(
- //'DELETE FROM MCP_NAVIGATION_LINKS WHERE navigation_links_id = %s'
- 'UPDATE
- MCP_NAVIGATION_LINKS
- SET
- MCP_NAVIGATION_LINKS.deleted = NULL
- WHERE
- MCP_NAVIGATION_LINKS.navigation_links_id = %s'
- ,$this->_objMCP->escapeString($arrTarget['navigation_links_id'])
- );
-
- /*
- * Delete link and update children
- */
- $this->_objMCP->query($strSQLDelete);
- $this->_objMCP->query($strSQL);
-
- /*
- * Update the nav cache
- */
- $arrNav = $this->fetchNavByLinkId($intLinksId);
- $this->_setCachedNav($arrNav['navigation_id']);
-
- return 1;
-
-
- }
-
- /*
- * Delete navigation menu(s)
- *
- * @param mix single integer value or array of integers ( MCP_NAVIGATION primary key )
- */
- public function deleteNavs($mixNavigationId) {
-
- $strSQL = sprintf(
- 'UPDATE
- MCP_NAVIGATION
- SET
- MCP_NAVIGATION.deleted = NULL
- WHERE
- MCP_NAVIGATION.navigation_id IN (%s)'
-
- ,is_array($mixNavigationId) ? $this->_objMCP->escapeString(implode(',',$mixNavigationId)) : $this->_objMCP->escapeString($mixNavigationId)
- );
-
- echo "
$strSQL
";
-
- }
-
- /*
- * Get cached navigation menu
- *
- * @param int navigation id
- * @return array complete navigation menu
- */
- private function _getCachedNav($intId) {
- return $this->_objMCP->getCacheDataValue("nav_{$intId}",$this->getPkg());
- }
-
- /*
- * Update the navigation menu cache with a new value
- *
- * @param int navigation id
- * @param array navigation menu
- * @return bool
- */
- private function _setCachedNav($intId) {
-
- /*
- * Bypass caching and build complete menu from current state
- */
- $arrMenu = $this->fetchMenu($intId,'nav',true,false);
-
- /*
- * Cache the menu
- */
- return $this->_objMCP->setCacheDataValue("nav_{$intId}",$arrMenu,$this->getPkg());
- }
-
-
-
-
-
-
- /*
- * -----------------------------------------------------------------------------------------------------------
- * Everything below this line is part of the "dynamic link" feature. The dynamic link feature
- * should not be used. It is not deprecated byut buggy and not really worth looking into right now. It
- * just raises more questions than what it is worth. So for now I am removing it entirely.
- */
-
-
-
- /*
- * Get datasources dynamic link data
- *
- * @param int navigation links id
- * @return array dynamic link data
- */
- public function fetchDynamicLinks($intNavigationLinksId) {
-
- /*
- * Get navigation link datasource info
- */
- $arrLink = $this->fetchLinkById($intNavigationLinksId);
-
- /*
- * Get all dynamic hard links
- */
- /*$arrRows = $this->_objMCP->query(sprintf(
- 'SELECT * FROM MCP_NAVIGATION_LINKS WHERE datasources_id = %s'
- ,$this->_objMCP->escapeString($arrLink['navigation_links_id'])
- ));*/
-
- $arrRows = $this->_objMCP->query(
- 'SELECT * FROM MCP_NAVIGATION_LINKS WHERE datasources_id = :datasources_id'
- ,array(
- ':datasources_id'=>(int) $arrLink['navigation_links_id']
- )
- );
-
- $arrData = array();
- foreach($arrRows as $arrRow) {
- $arrData["{$arrRow['datasources_id']}-{$arrRow['datasources_row_id']}"] = $arrRow;
- }
-
- if(!empty($arrLink['datasource_query'])) {
-
- /*
- * Run raw SQL query for data
- */
- $arrDynamicLinks = $this->_objMCP->query(str_replace(array('SITES_ID'),array($this->_objMCP->escapeString($this->_objMCP->getSitesId())),$arrLink['datasource_query']));
-
- } else {
-
- /*
- * Replace argument magical constants such as; SITES_ID and transform empty string to null
- */
- $args = $arrLink['datasource_dao_args'] === null?array():unserialize(base64_decode($arrLink['datasource_dao_args']));
- array_walk(
- $args
- ,create_function('&$item,$key,$mcp','if($item == \'\') { $item=null; return; } $item = str_replace(array(\'SITES_ID\'),array($mcp->escapeString($mcp->getSitesId())),$item);')
- ,$this->_objMCP
- );
-
- /*
- * Get DAO instance and call binding
- */
- $arrDynamicLinks = call_user_func_array(
- array(
- $this->_objMCP->getInstance($arrLink['datasource_dao'],array($this->_objMCP))
- ,$arrLink['datasource_dao_method']
- )
- ,$args
- );
-
- }
-
- /*
- * Convert links
- */
- return empty($arrDynamicLinks)?array():$this->_convertDataSourceOutputToLinks($arrDynamicLinks,$arrLink,$arrData,($arrLink['parent_type'] == 'link'?$this->fetchLinkById($arrLink['parent_id']):null),$arrLink);
- }
-
- /*
- * Get dynamic link by id [datasource,datasource row id]
- *
- * @param int datasources id
- * @param int datasources row id
- * @return array dynamic link data
- */
- public function fetchDynamicLinkById($intDataSourcesId,$intDataSourcesRowId) {
-
- /*
- * Fetch all dynamic links for data source
- */
- $arrData = $this->fetchDynamicLinks($intDataSourcesId);
-
- /*
- * Locate link
- */
- $arrFound = $this->_locateDynamicLink($arrData,$intDataSourcesRowId);
- return $arrFound;
-
- }
-
- /*
- * Create hard link to represent dynamic link
- *
- * @param int datasources id
- * @param int datasources row id
- */
- public function createHardLinkFromDynamic($intDatasourcesId,$intDatasourcesRowId) {
-
- /*
- * Get dynamic link info
- */
- $arrDataSource = $this->fetchDynamicLinkById($intDatasourcesId,$intDatasourcesRowId);//$this->fetchLinkById($intDatasourcesId);
-
- /*
- * Copy datasources information
- */
- $arrSave = $arrDataSource;
-
- /*
- * Set datasources id and row id for dynamic link
- */
- //$arrSave['datasources_id'] = $arrDataSource['navigation_links_id'];
- //$arrSave['datasources_row_id'] = $intDatasourcesRowId;
- $arrSave['link_title'] = '';
-
- //echo '
';
-
- return $strOut;
-
- }
-
- /*
- * Print menu hierarchy as undorderd list
- *
- * @param array navigation link
- * @param str parent id [link-1,nav-3] used to select parent
- * @param int runner specifying depth level
- * @param bool used to disable current link and its children
- * @return str HTML ordered list or printed children
- */
- private function _printMenu($arrLinks,$strParentId,$intRunner=0,$boolDisable=false) {
-
- /*
- * Get current link
- */
- $arrCurrent = $this->_getLink();
-
- $strReturn = '
';
- foreach($arrLinks as $arrLink) {
-
- /*
- * Link may not be its own parent or use a child as parent
- */
- $boolDisableLink = $boolDisable === false?$arrCurrent !== null && $arrCurrent['navigation_links_id'] == $arrLink['navigation_links_id']?true:false:true;
-
- $strReturn.=
- sprintf(
- '