Permalink
Browse files

Single Item defaults

  • Loading branch information...
Amy Stephen Amy Stephen
Amy Stephen authored and Amy Stephen committed Jun 8, 2012
1 parent afc70e3 commit c6abfe573ea44806f38cba277ff90c64146594f4
Showing with 1,501 additions and 1,555 deletions.
  1. +12 −0 source/Molajo/Application.php
  2. +4 −0 source/Molajo/Configuration/Include/ParametersCommon.xml
  3. +1 −1 source/Molajo/Configuration/Include/ParametersGrid.xml
  4. +1 −0 source/Molajo/Configuration/Include/TriggersContent.xml
  5. +9 −84 source/Molajo/Configuration/Include/parameters-item.json
  6. +1 −1 source/Molajo/Configuration/Include/parameters-menuitem.json
  7. +1 −2 source/Molajo/Extension/Component/Articles/Options/Item.xml
  8. +20 −5 source/Molajo/Extension/Helper/CatalogHelper.php
  9. +4 −2 source/Molajo/Extension/Helper/ContentHelper.php
  10. +17 −5 source/Molajo/Extension/Helper/ExtensionHelper.php
  11. +17 −15 source/Molajo/Extension/Includer.php
  12. +1 −1 source/Molajo/Extension/Includer/ComponentIncluder.php
  13. +2 −0 source/Molajo/Extension/Includer/WrapIncluder.php
  14. +0 −10 source/Molajo/Extension/Menus/Language/en-GB.ini
  15. +0 −12 source/Molajo/Extension/Menus/Manifest.xml
  16. +0 −57 source/Molajo/Extension/Menus/Options/Item.xml
  17. +0 −45 source/Molajo/Extension/Menus/Options/List.xml
  18. +34 −5 source/Molajo/Extension/Trigger/Admingrid/AdmingridTrigger.php
  19. +76 −53 source/Molajo/Extension/Trigger/Author/AuthorTrigger.php
  20. +1 −1 source/Molajo/Extension/Trigger/Gravatar/GravatarTrigger.php
  21. +2 −0 source/Molajo/Extension/Trigger/Lists/ListsTrigger.php
  22. +4 −1 source/Molajo/Extension/Trigger/UserActivity/UseractivityTrigger.php
  23. +4 −48 source/Molajo/Extension/View/Page/Admin/index.php
  24. +1 −1 source/Molajo/Extension/View/Page/Admingrid/index.php
  25. +4 −4 source/Molajo/Extension/View/Template/AdminSubmenu/View/Body.php
  26. +1 −8 source/Molajo/Extension/View/Template/Admindashboard/View/Custom.php
  27. +1 −1 source/Molajo/Extension/View/Template/Adminfooter/View/Body.php
  28. +24 −22 source/Molajo/Extension/View/Template/Admingrid/View/Body.php
  29. +10 −1 source/Molajo/Extension/View/Template/Admingrid/View/Footer.php
  30. +5 −13 source/Molajo/Extension/View/Template/Admingrid/View/Header.php
  31. +3 −3 source/Molajo/Extension/View/Template/Admingridbatch/View/Custom.php
  32. +14 −12 source/Molajo/Extension/View/Template/Admingridfilters/View/Body.php
  33. +2 −1 source/Molajo/Extension/View/Template/Admingridfilters/View/Header.php
  34. +29 −0 source/Molajo/Extension/View/Template/Admingridpagination/Css/template.css
  35. +4 −8 source/Molajo/Extension/View/Template/Admingridpagination/View/Body.php
  36. +1 −1 source/Molajo/Extension/View/Template/Admingridpagination/View/Header.php
  37. +4 −1 source/Molajo/Extension/View/Template/Adminheader/View/Custom.php
  38. +3 −2 source/Molajo/Extension/View/Template/Article/Css/template.css
  39. +17 −12 source/Molajo/Extension/View/Template/Article/View/Body.php
  40. +0 −14 source/Molajo/Extension/View/Template/Author/View/Body.php
  41. +15 −0 source/Molajo/Extension/View/Template/Author/View/Custom.php
  42. +19 −31 source/Molajo/MVC/Controller/DisplayController.php
  43. +15 −6 source/Molajo/MVC/Controller/ModelController.php
  44. +26 −10 source/Molajo/MVC/Model/ReadModel.php
  45. +1 −2 source/Molajo/MVC/View/Template/AssetsCss/View/Body.php
  46. +13 −3 source/Molajo/Service/Services/Authorisation/AuthorisationService.php
  47. +1,046 −1,030 source/Molajo/Service/Services/Configuration/ConfigurationService.php
  48. +7 −4 source/Molajo/Service/Services/Registry/RegistryService.php
  49. +4 −2 source/Molajo/Service/Services/Route/RouteService.php
  50. +17 −14 source/Molajo/Service/Services/Text/TextService.php
  51. +4 −1 source/Molajo/Service/Services/User/UserService.php
@@ -114,6 +114,18 @@ public function process($override_url_request = false, $override_catalog_id = fa
Services::Debug()->set('Application Authorise succeeded');
}
+
+ /** Start parsing and processing page include for Theme */
+ if (file_exists(Services::Registry()->get('Parameters', 'theme_path_include'))
+ && file_exists(Services::Registry()->get('Parameters', 'page_view_path_include'))
+ ) {
+ } else {
+ Services::Error()->set(500, 'Theme and/or Page View Not found');
+ echo 'Theme and/or Page View Not found - application stopped before parse. Parameters follow:';
+ Services::Registry()->get('Parameters', '*');
+ die;
+ }
+
/** Execute */
$continue = $this->execute();
@@ -0,0 +1,4 @@
+<field name="criteria_display_view_on_no_results" type="binary" null="1" default="1" values="0,1"/>
+<field name="criteria_snippet_length" type="integer" null="1" default="200" values=""/>
+<field name="criteria_extension_instance_id" type="integer" null="1" default="1" values=""/>
+<field name="criteria_catalog_type_id" type="integer" null="1" default="1" values=""/>
@@ -2,7 +2,7 @@
<field name="grid_submenu_items" type="char" null="0" default="items,categories,drafts" values="items,categories,drafts"/>
<field name="grid_search" type="binary" null="1" default="1" values="0,1"/>
<field name="grid_lists" type="char" null="0" default="" values=""/>
-<field name="grid_columns" type="char" null="0" default="id,title,content_text,featured,Primarycategory,Author,start_publishing_datetime,ordering,language" values=""/>
+<field name="grid_columns" type="char" null="0" default="id,title,content_text,featured,start_publishing_datetime,ordering,language" values=""/>
<field name="grid_rows" type="char" null="0" default="5" values=""/>
<field name="grid_ordering" type="char" null="0" default="a.title" values=""/>
<field name="grid_ordering_direction" type="char" null="0" default="ASC" values="ASC,DESC"/>
@@ -1,6 +1,7 @@
<trigger name="Author"/>
<trigger name="Smilies"/>
<trigger name="Email"/>
+<trigger name="Gravatar"/>
<trigger name="IFrame"/>
<trigger name="Pullquote"/>
<trigger name="Datefields"/>
@@ -1,84 +1,9 @@
{
- "1":{
- "criteria_display_view_on_no_results":"1",
- "criteria_snippet_length":"200",
-
- "enable_draft_save":"",
- "enable_version_history":"",
- "enable_maximum_version_count":"",
- "enable_hit_counts":"",
- "enable_comments":"",
- "enable_ratings":"",
- "enable_notifications":"",
- "enable_tweets":"",
- "enable_ping":"",
-
- "item_theme_id":"",
- "item_page_view_id":"",
- "item_page_view_css_id":"",
- "item_page_view_css_class":"",
- "item_template_view_id":"",
- "item_template_view_css_id":"",
- "item_template_view_css_class":"",
- "item_wrap_view_id":"",
- "item_wrap_view_css_id":"",
- "item_wrap_view_css_class":"",
- "item_model_name":"",
- "item_model_type":"",
- "item_model_query_object":"",
-
- "form_theme_id":"",
- "form_page_view_id":"",
- "form_page_view_css_id":"",
- "form_page_view_css_class":"",
- "form_template_view_id":"",
- "form_template_view_css_id":"",
- "form_template_view_css_class":"",
- "form_wrap_view_id":"",
- "form_wrap_view_css_id":"",
- "form_wrap_view_css_class":"",
- "form_model_name":"",
- "form_model_type":"",
- "form_model_query_object":"",
-
- "image_xsmall":"",
- "image_small":"",
- "image_medium":"",
- "image_large":"",
- "image_xlarge":"",
- "image_folder":"",
- "image_thumb_folder":"",
-
- "gravatar":"",
- "gravatar_size":"",
- "gravatar_type":"",
- "gravatar_rating":"",
- "gravatar_image":"",
-
- "asset_priority_site":"",
- "asset_priority_application":"",
- "asset_priority_user":"",
- "asset_priority_extension":"",
- "asset_priority_request":"",
- "asset_priority_category":"",
- "asset_priority_menu_item":"",
- "asset_priority_source":"",
- "asset_priority_theme":"",
-
- "mustache":"0",
-
- "cache":"1",
- "cache_time":"15",
- "cache_handler":"folder",
-
- "log_user_activity_create":"0",
- "log_user_activity_read":"0",
- "log_user_activity_update":"0",
- "log_user_activity_delete":"0"
- },
"2":{
"criteria_display_view_on_no_results":"1",
"criteria_snippet_length":"200",
+ "criteria_extension_instance_id":"2",
+ "criteria_catalog_type_id":"10000",
"enable_draft_save":"",
"enable_version_history":"",
@@ -90,19 +15,19 @@
"enable_tweets":"",
"enable_ping":"",
- "item_theme_id":"",
- "item_page_view_id":"",
+ "item_theme_id":"98",
+ "item_page_view_id":"55",
"item_page_view_css_id":"",
"item_page_view_css_class":"",
- "item_template_view_id":"",
+ "item_template_view_id":"236",
"item_template_view_css_id":"",
"item_template_view_css_class":"",
- "item_wrap_view_id":"",
+ "item_wrap_view_id":"58",
"item_wrap_view_css_id":"",
"item_wrap_view_css_class":"",
- "item_model_name":"",
- "item_model_type":"",
- "item_model_query_object":"",
+ "item_model_name":"Articles",
+ "item_model_type":"Item",
+ "item_model_query_object":"Item",
"form_theme_id":"",
"form_page_view_id":"",
@@ -26,7 +26,7 @@
"criteria_view_ordering":"a.start_publishing_datetime DESC",
"criteria_view_toolbar_buttons":"new,edit,publish,feature,archive,checkin,restore,delete,trash,options",
"criteria_view_submenu_items":"items,categories,drafts",
- "criteria_view_columns":"id,featured,title,created_by_name,start_publishing_datetime,ordering",
+ "criteria_view_columns":"id,featured,title,created_by,start_publishing_datetime,ordering",
"criteria_view_pagination":"",
"criteria_view_batch":"",
@@ -38,8 +38,7 @@
<include name="Metadata"/>
</customfield>
<customfield name="parameters">
- <field name="criteria_display_view_on_no_results" type="binary" null="1" default="1" values="0,1"/>
- <field name="criteria_snippet_length" type="integer" null="1" default="200" values=""/>
+ <include name="ParametersCommon"/>
<include name="ParametersItem"/>
<include name="ParametersImage"/>
<include name="ParametersGravatar"/>
@@ -137,7 +137,10 @@ public function get($catalog_id = 0, $url_sef_request = '', $source_id = 0, $cat
$controllerClass = 'Molajo\\MVC\\Controller\\ModelController';
$m = new $controllerClass();
- $m->connect('Catalog');
+ $results = $m->connect('Catalog');
+ if ($results == false) {
+ return false;
+ }
$m->set('id', (int)$catalog_id);
$m->set('use_special_joins', 1);
@@ -169,7 +172,10 @@ public function getIDUsingSEFURL($url_sef_request)
{
$controllerClass = 'Molajo\\MVC\\Controller\\ModelController';
$m = new $controllerClass();
- $m->connect('Catalog');
+ $results = $m->connect('Catalog');
+ if ($results == false) {
+ return false;
+ }
$m->model->query->select($m->model->db->qn('a') . '.' . $m->model->db->qn('id'));
$m->model->query->where($m->model->db->qn('sef_request') . ' = ' . $m->model->db->q($url_sef_request));
@@ -190,7 +196,10 @@ public function getID($catalog_type_id, $source_id)
{
$controllerClass = 'Molajo\\MVC\\Controller\\ModelController';
$m = new $controllerClass();
- $m->connect('Catalog');
+ $results = $m->connect('Catalog');
+ if ($results == false) {
+ return false;
+ }
$m->model->query->select($m->model->db->qn('a') . '.' . $m->model->db->qn('id'));
$m->model->query->where($m->model->db->qn('a') . '.' . $m->model->db->qn('catalog_type_id')
@@ -213,7 +222,10 @@ public function getRedirectURL($catalog_id)
{
$controllerClass = 'Molajo\\MVC\\Controller\\ModelController';
$m = new $controllerClass();
- $m->connect('Catalog');
+ $results = $m->connect('Catalog');
+ if ($results == false) {
+ return false;
+ }
$m->model->query->select($m->model->db->qn('a') . '.' . $m->model->db->qn('redirect_to_id'));
$m->model->query->where($m->model->db->qn('a') . '.' . $m->model->db->qn('id') . ' = ' . (int)$catalog_id);
@@ -245,7 +257,10 @@ public function getURL($catalog_id)
$controllerClass = 'Molajo\\MVC\\Controller\\ModelController';
$m = new $controllerClass();
- $m->connect('Catalog');
+ $results = $m->connect('Catalog');
+ if ($results == false) {
+ return false;
+ }
$m->model->query->select($m->model->db->qn('a') . '.' . $m->model->db->qn('sef_request'));
$m->model->query->where($m->model->db->qn('a') . '.' . $m->model->db->qn('id') . ' = ' . (int)$catalog_id);
@@ -290,10 +290,12 @@ public function getRouteCategory()
*/
public function get($id = 0, $model_name = 'Content', $model_type = 'List', $model_query_object = 'list')
{
-
$controllerClass = 'Molajo\\MVC\\Controller\\ModelController';
$m = new $controllerClass();
- $m->connect($model_name, $model_type);
+ $results = $m->connect($model_name, $model_type);
+ if ($results == false) {
+ return false;
+ }
$m->set('id', (int)$id);
$m->set('process_triggers', 1);
@@ -66,7 +66,7 @@ public function getExtension($extension_id, $model_name = 'ExtensionInstances',
$item = Helpers::Extension()->get($extension_id, $model_name, $model_type);
/** 500: not found */
- if (count($item) == 0) {
+ if (count($item) == 0 || $item == false) {
return false;
}
@@ -134,7 +134,10 @@ public function get($extension_id, $model_name = 'ExtensionInstances', $model_ty
$controllerClass = 'Molajo\\MVC\\Controller\\ModelController';
$m = new $controllerClass();
- $m->connect($model_name, $model_type);
+ $results = $m->connect($model_name, $model_type);
+ if ($results == false) {
+ return false;
+ }
$m->set('id', (int)$extension_id);
$m->set('process_triggers', 0);
@@ -167,7 +170,10 @@ public function getInstanceID($catalog_type_id, $title)
{
$controllerClass = 'Molajo\\MVC\\Controller\\ModelController';
$m = new $controllerClass();
- $m->connect('ExtensionInstances');
+ $results = $m->connect('ExtensionInstances');
+ if ($results == false) {
+ return false;
+ }
$m->set('process_triggers', 0);
@@ -192,7 +198,10 @@ public function getInstanceTitle($extension_instance_id)
{
$controllerClass = 'Molajo\\MVC\\Controller\\ModelController';
$m = new $controllerClass();
- $m->connect('ExtensionInstances');
+ $results = $m->connect('ExtensionInstances');
+ if ($results == false) {
+ return false;
+ }
$m->set('process_triggers', 0);
@@ -216,7 +225,10 @@ public function getExtensionNode($extension_instance_id)
{
$controllerClass = 'Molajo\\MVC\\Controller\\ModelController';
$m = new $controllerClass();
- $m->connect();
+ $results = $m->connect();
+ if ($results == false) {
+ return false;
+ }
$m->set('process_triggers', 0);
@@ -104,23 +104,24 @@ public function __construct($name = null, $type = null)
*/
public function process($attributes = array())
{
+
/** attributes from <include:type */
$this->attributes = $attributes;
$this->getAttributes();
-/**
+ /**
if (Services::Registry()->get('Parameters', 'extension_primary') == true) {
} else {
-Services::Registry()->copy('RouteParameters', 'Parameters', 'theme*');
-Services::Registry()->copy('RouteParameters', 'Parameters', 'page*');
+ Services::Registry()->copy('RouteParameters', 'Parameters', 'theme*');
+ Services::Registry()->copy('RouteParameters', 'Parameters', 'page*');
}
echo 'Includer Extension: ' . $this->name . ' Type: ' . $this->type . '<br />';
echo 'Attributes from Parsing<pre>';
var_dump($this->attributes);
echo '</pre>';
-*/
+ */
/** retrieve the extension that will be used to generate the MVC request */
$this->getExtension();
@@ -135,7 +136,8 @@ public function process($attributes = array())
/** only load media if there was rendered output */
if ($rendered_output == ''
- && Services::Registry()->get('Parameters', 'criteria_display_view_on_no_results') == 0) {
+ && Services::Registry()->get('Parameters', 'criteria_display_view_on_no_results') == 0
+ ) {
} else {
$this->loadMedia();
$this->loadViewMedia();
@@ -193,7 +195,7 @@ protected function getAttributes()
} elseif ($name == 'template_view_css_class' || $name == 'template_css_class'
|| $name == 'template_class'
) {
- Services::Registry()->set('Parameters', 'template_view_css_class', $value);
+ Services::Registry()->set('Parameters', 'template_view_css_class', str_replace(',', ' ', $value));
/** Wrap */
} elseif ($name == 'wrap' || $name == 'wrap_view_title'
@@ -215,7 +217,7 @@ protected function getAttributes()
} elseif ($name == 'wrap_view_css_class' || $name == 'wrap_css_class'
|| $name == 'wrap_class'
) {
- Services::Registry()->set('Parameters', 'wrap_view_css_class', $value);
+ Services::Registry()->set('Parameters', 'wrap_view_css_class', str_replace(',', ' ', $value));
/** Model */
} elseif ($name == 'value') {
@@ -337,14 +339,14 @@ protected function loadViewMedia()
protected function invokeMVC()
{
-/**
-echo '<br /><br /><br />';
-echo Services::Registry()->get('Parameters', 'extension_title');
-echo '<br />';
-Services::Registry()->sort('Parameters');
-Services::Registry()->get('Parameters', '*');
-echo '<br /><br /><br />';
-*/
+ /**
+ echo '<br /><br /><br />';
+ echo Services::Registry()->get('Parameters', 'extension_title');
+ echo '<br />';
+ Services::Registry()->sort('Parameters');
+ Services::Registry()->get('Parameters', '*');
+ echo '<br /><br /><br />';
+ */
$controller = new DisplayController();
$controller->set('id', (int)Services::Registry()->get('Parameters', 'source_id'));
@@ -47,7 +47,7 @@ public function __construct($name = null, $type = null)
* @return null
* @since 1.0
*/
- protected function getAttributes()
+ protected function getAttribute()
{
/** Include and Parameter Registries are already loaded for Primary Component */
if (Services::Registry()->get('Parameters', 'extension_primary') == true) {
Oops, something went wrong.

0 comments on commit c6abfe5

Please sign in to comment.