Skip to content

Commit

Permalink
Merge pull request #236 from deanblackborough/content-styling-table
Browse files Browse the repository at this point in the history
Content styling tables and shared classes
  • Loading branch information
deanblackborough committed Mar 14, 2017
2 parents ef7b9fd + 6988167 commit d26225a
Show file tree
Hide file tree
Showing 139 changed files with 1,025 additions and 1,516 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@

Full changelog for Dlayer since the v1.00 release.

## v1.17:

* New styling table for content items, stores all defined styles, no need for a table per styling group. [Refactoring]
* Cleaned up tools, removed redundant model classes and moved around shared classes, now more apparent if they relate to content or not. [Refactoring]

## v1.16: 12th March 2017

* Enabled link support in Quill rich text fields. [v0.30.0 of PHP Quill renderer]
Expand Down
4 changes: 2 additions & 2 deletions application/configs/environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
* production, development, testing or staging
*/

$environment = 'production';
//$environment = 'development';
//$environment = 'production';
$environment = 'development';

// Version number for current release
$version_no = 'v1.17';
Expand Down
17 changes: 5 additions & 12 deletions application/modules/dlayer/views/scripts/index/index.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,15 @@
</div>

<div class="col-md-6 col-sm-6 col-xs-12">
<h3><span class="label label-success">v1.16</span> Horizontal rule & styling <small class="text-muted">(12th March 2017)</small></h3>
<h3><span class="label label-success">v1.17</span> Not yet named <small class="text-muted">(In progress)</small></h3>

<ul>
<li>Enabled link support in Quill rich text fields. [v0.30.0 of PHP Quill renderer]</li>
<li>Enabled superscript and subscript support in Quill rich text fields. [v0.40.0 of PHP Quill renderer]</li>
<li>I have changed the name of the background colour property on the page styling sub tool; it is now called content background colour which is more accurate.</li>
<li>I have added the ability to define the background colour for your website (Page background colour, in the future this will be configurable per template). [Feature]</li>
<li>I have added a horizontal rule tool, under the content layout drop down. [Feature]</li>
<li>I have added a styling sub tool for horizontal rule content items, allows the colour to be defined. [Feature]</li>
<li>I have added a delete sub tool for horizontal rule content items. [Feature]</li>
<li>I have made improvements to the styling code, less duplication of both data and code. [Refactoring]</li>
<li>New tables to manage any styling attributes defined for the page, HTML and content items, additional refactoring required. [Database]</li>
<li>Control bar improvements. [UX]</li>
<li>General fixes and improvements.</li>
<li>New styling table for content items, stores all defined styles, no need for a table per styling group. [Refactoring]</li>
<li>Cleaned up tools, removed redundant model classes and moved around shared classes, now more apparent if they relate to content or not. [Refactoring]</li>
</ul>

<h3><span class="label label-default">v1.16</span> Horizontal rule & styling <small class="text-muted">(12th March 2017)</small></h3>

<h3><span class="label label-default">v1.15</span> Blog/Rich text content items <small class="text-muted">(3rd March 2017)</small></h3>

<h3><span class="label label-default">v1.14</span> Composite content items soon <small class="text-muted">(23rd February 2017)</small></h3>
Expand Down
1 change: 0 additions & 1 deletion application/modules/setup/models/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ class Setup_Model_Import extends Zend_Db_Table_Abstract
'user_site_page_structure_content',
'user_site_page_structure_row',
'user_site_page_styling',
'user_site_page_styling_content_item_background_color',
'user_site_page_styling_content_item_typography',
'user_site_row_styling'
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @license https://github.com/Dlayer/dlayer/blob/master/LICENSE
*/
class Dlayer_DesignerTool_ContentManager_BlogPost_Model extends
Dlayer_DesignerTool_ContentManager_Shared_Model_Content
Dlayer_DesignerTool_ContentManager_Shared_Model_Content_Item
{
/**
* Fetch all the heading types supported by Dlayer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @license https://github.com/Dlayer/dlayer/blob/master/LICENSE
*/
class Dlayer_DesignerTool_ContentManager_BlogPost_SubTool_Delete_Form extends
Dlayer_DesignerTool_ContentManager_Shared_Form_Delete
Dlayer_DesignerTool_ContentManager_Shared_Form_Content_Delete
{
/**
* Set the properties for the form
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @license https://github.com/Dlayer/dlayer/blob/master/LICENSE
*/
class Dlayer_DesignerTool_ContentManager_BlogPost_SubTool_Delete_Tool extends
Dlayer_DesignerTool_ContentManager_Shared_Tool_Delete
Dlayer_DesignerTool_ContentManager_Shared_Tool_Content_Delete
{
// No custom logic required
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @license https://github.com/Dlayer/dlayer/blob/master/LICENSE
*/
class Dlayer_DesignerTool_ContentManager_BlogPost_SubTool_Styling_Form extends
Dlayer_DesignerTool_ContentManager_Shared_Form_Styling
Dlayer_DesignerTool_ContentManager_Shared_Form_Content_Styling
{
/**
* Set the properties for the form
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected function contentData()
);

if ($this->tool['content_id'] !== null) {
$model_styling = new Dlayer_DesignerTool_ContentManager_BlogPost_SubTool_Styling_Model();
$model_styling = new Dlayer_DesignerTool_ContentManager_Shared_Model_Content_Styling();
$content_background_color = $model_styling->backgroundColor(
$this->tool['site_id'],
$this->tool['page_id'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @license https://github.com/Dlayer/dlayer/blob/master/LICENSE
*/
class Dlayer_DesignerTool_ContentManager_Text_SubTool_Styling_Tool extends
Dlayer_DesignerTool_ContentManager_Shared_Tool_Styling
Dlayer_DesignerTool_ContentManager_Shared_Tool_Content_Styling
{
/**
* Generate the return ids array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @license https://github.com/Dlayer/dlayer/blob/master/LICENSE
*/
class Dlayer_DesignerTool_ContentManager_BlogPost_SubTool_Typography_Form extends
Dlayer_DesignerTool_ContentManager_Shared_Form_Typography
Dlayer_DesignerTool_ContentManager_Shared_Form_Content_Typography
{
/**
* Set the properties for the form
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,26 @@ protected function contentData()
);

if ($this->tool['content_id'] !== null) {
$model = new Dlayer_DesignerTool_ContentManager_Shared_Model_Typography();
$model = new Dlayer_DesignerTool_ContentManager_Shared_Model_Content_Typography();

$font_and_text_values = $model->fontAndTextValues(
$font_weight = $model->fontWeight(
$this->tool['site_id'],
$this->tool['page_id'],
$this->tool['content_id']
);

if ($font_and_text_values !== false) {
if ($font_and_text_values['text_weight_id'] !== null) {
$this->content_data['text_weight_id'] = $font_and_text_values['text_weight_id'];
}
$font_family = $model->fontFamily(
$this->tool['site_id'],
$this->tool['page_id'],
$this->tool['content_id']
);

if ($font_weight !== false) {
$this->content_data['text_weight_id'] = $font_weight;
}

if ($font_and_text_values['font_family_id'] !== null) {
$this->content_data['font_family_id'] = $font_and_text_values['font_family_id'];
}
if ($font_family !== false) {
$this->content_data['font_family_id'] = $font_family;
}
}

Expand All @@ -86,14 +90,14 @@ protected function elementData()
'text_weights' => false
);

$model = new Dlayer_DesignerTool_ContentManager_Shared_Model_Typography();
$model = new Dlayer_Model_DesignerTool_ContentManager_Typography();

$font_families = $model->fontFamiliesForSelect();
if ($font_families !== false) {
$this->element_data['font_families'] = $font_families;
}

$text_weights = $model->textWeightsForSelect();
$text_weights = $model->fontWeightsForSelect();
if ($text_weights !== false) {
$this->element_data['text_weights'] = $text_weights;
}
Expand All @@ -120,14 +124,14 @@ protected function previewData()
'text_weights' => false
);

$model = new Dlayer_DesignerTool_ContentManager_Shared_Model_Typography();
$model = new Dlayer_Model_DesignerTool_ContentManager_Typography();

$font_families = $model->fontFamiliesForPreview();
if ($font_families !== false) {
$this->preview_data['font_families'] = $font_families;
}

$text_weights = $model->textWeightsForPreview();
$text_weights = $model->fontWeightsForPreview();
if ($text_weights !== false) {
$this->preview_data['text_weights'] = $text_weights;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @license https://github.com/Dlayer/dlayer/blob/master/LICENSE
*/
class Dlayer_DesignerTool_ContentManager_Text_SubTool_Typography_Tool extends
Dlayer_DesignerTool_ContentManager_Shared_Tool_Typography
Dlayer_DesignerTool_ContentManager_Shared_Tool_Content_Typography
{
/**
* Generate the return ids array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ protected function returnIds($content_id = null)
*/
protected function validateInstances($site_id, $content_id)
{
$model = new Dlayer_DesignerTool_ContentManager_Shared_Model_Content();
$model = new Dlayer_DesignerTool_ContentManager_Shared_Model_Content_Item();
$instances = $model->instancesOfData($site_id, $content_id, 'BlogPost');

if ($instances > 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @license https://github.com/Dlayer/dlayer/blob/master/LICENSE
*/
class Dlayer_DesignerTool_ContentManager_Form_SubTool_Delete_Form extends
Dlayer_DesignerTool_ContentManager_Shared_Form_Delete
Dlayer_DesignerTool_ContentManager_Shared_Form_Content_Delete
{
/**
* Set the properties for the form
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @license https://github.com/Dlayer/dlayer/blob/master/LICENSE
*/
class Dlayer_DesignerTool_ContentManager_Form_SubTool_Delete_Tool extends
Dlayer_DesignerTool_ContentManager_Shared_Tool_Delete
Dlayer_DesignerTool_ContentManager_Shared_Tool_Content_Delete
{
// No custom logic required
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @license https://github.com/Dlayer/dlayer/blob/master/LICENSE
*/
class Dlayer_DesignerTool_ContentManager_Form_SubTool_Styling_Form extends
Dlayer_DesignerTool_ContentManager_Shared_Form_Styling
Dlayer_DesignerTool_ContentManager_Shared_Form_Content_Styling
{
/**
* Set the properties for the form
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected function contentData()
);

if ($this->tool['content_id'] !== null) {
$model_styling = new Dlayer_DesignerTool_ContentManager_Form_SubTool_Styling_Model();
$model_styling = new Dlayer_DesignerTool_ContentManager_Shared_Model_Content_Styling();
$content_background_color = $model_styling->backgroundColor(
$this->tool['site_id'],
$this->tool['page_id'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @license https://github.com/Dlayer/dlayer/blob/master/LICENSE
*/
class Dlayer_DesignerTool_ContentManager_Form_SubTool_Styling_Tool extends
Dlayer_DesignerTool_ContentManager_Shared_Tool_Styling
Dlayer_DesignerTool_ContentManager_Shared_Tool_Content_Styling
{
/**
* Generate the return ids array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @license https://github.com/Dlayer/dlayer/blob/master/LICENSE
*/
class Dlayer_DesignerTool_ContentManager_Form_SubTool_Typography_Form extends
Dlayer_DesignerTool_ContentManager_Shared_Form_Typography
Dlayer_DesignerTool_ContentManager_Shared_Form_Content_Typography
{
/**
* Set the properties for the form
Expand Down

This file was deleted.

Loading

0 comments on commit d26225a

Please sign in to comment.