Skip to content

Commit

Permalink
Merge pull request #227 from deanblackborough/quill
Browse files Browse the repository at this point in the history
Quill
  • Loading branch information
deanblackborough committed Feb 23, 2017
2 parents 6863c10 + 80b61af commit 697c999
Show file tree
Hide file tree
Showing 35 changed files with 1,115 additions and 11 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ Full changelog for Dlayer since the v1.00 release.
* Added shortcut buttons to Column, Row and Page tools. [UX]
* The column contains content query only looks at enabled content. [Bugfix]
* Added a toggle ribbon button to the right side of the control bar, it expands the ribbon to open up the form. [UX]
* Control bar padding left and right set to 15px, was 0. [Bugfix]
* Added a rich text content item to the Content Manager (disabled until I add a renderer for quill). [Disabled Feature]
* Refactoring.
* Control bar padding left and right set to 15px, was 0. [Bugfix]
* Minor fixes and improvements.

## v1.13: 18th February 2017
Expand Down
2 changes: 1 addition & 1 deletion application/configs/environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
// Version number for current release
$version_no = 'v1.14';
// Release date for current release
$version_release_date = 'In Progress';
$version_release_date = '23rd February 2017';
1 change: 1 addition & 0 deletions application/modules/dlayer/views/scripts/index/index.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<li>Added shortcut buttons to Column, Row and Page tools. [UX]</li>
<li>The column contains content query only looks at enabled content. [Bugfix]</li>
<li>Control bar padding left and right set to 15px, was 0. [Bugfix]</li>
<li>Added a rich text content item to the Content Manager (disabled until I add a renderer for quill). [Disabled Feature]</li>
<li>Refactoring.</li>
<li>Minor fixes and improvements.</li>
</ul>
Expand Down
2 changes: 2 additions & 0 deletions application/modules/setup/models/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class Setup_Model_Import extends Zend_Db_Table_Abstract
'user_site_content_html',
'user_site_content_jumbotron',
'user_site_content_text',
'user_site_content_richtext',
'user_site_form',
'user_site_form_field',
'user_site_form_field_attribute',
Expand All @@ -64,6 +65,7 @@ class Setup_Model_Import extends Zend_Db_Table_Abstract
'user_site_page_content_item_html',
'user_site_page_content_item_image',
'user_site_page_content_item_jumbotron',
'user_site_page_content_item_richtext',
'user_site_page_content_item_text',
'user_site_page_meta',
'user_site_page_structure_column',
Expand Down
5 changes: 4 additions & 1 deletion application/views/layouts/content-manager.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@
<?php foreach($this->layout()->js_include as $include) { ?>
<script type="text/javascript" src="<?php echo $this->baseUrl($include); ?>"></script>
<?php } ?>
<!-- Quill -->
<script src="//cdn.quilljs.com/1.2.0/quill.min.js"></script>
<link href="//cdn.quilljs.com/1.2.0/quill.snow.css" rel="stylesheet">
<?php foreach($this->layout()->css_include as $include) { ?>
<link href="<?php echo $this->baseUrl($include); ?>" rel="stylesheet" media="screen" type="text/css" />
<?php } ?>
<script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
Expand Down
2 changes: 1 addition & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
title: Dlayer: Web development simplified
title: "Dlayer: Web development simplified"
theme: jekyll-theme-architect
show_downloads: true
93 changes: 93 additions & 0 deletions library/Dlayer/DesignerTool/ContentManager/RichText/Form.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?php

/**
* Form for the rich text content item tool
*
* @author Dean Blackborough
* @copyright G3D Development Limited
* @license https://github.com/Dlayer/dlayer/blob/master/LICENSE
*/
class Dlayer_DesignerTool_ContentManager_RichText_Form extends Dlayer_Form_Tool_Content
{
/**
* Set the properties for the form
*
* @param array $tool Tool and environment data array
* @param array $data Current data for content item
* @param integer $instances Instances of content data on web site
* @param array $element_data
* @param array|NULL $options Zend form options
*/
public function __construct(array $tool, array $data, $instances, array $element_data, $options = null)
{
$this->content_type = 'rich-text';

parent::__construct($tool, $data, $instances, $element_data, $options);
}

/**
* Initialise the form, sets the action and method and then calls the elements to build the form
*
* @return void
*/
public function init()
{
$this->setAction('/content/process/tool');

$this->setMethod('post');

$this->generateFormElements();

$this->addElementsToForm('text_content_item', 'Rich text', $this->elements);

$this->addDefaultElementDecorators();

$this->addCustomElementDecorators();
}

protected function generateUserElements()
{
$name = new Zend_Form_Element_Text('name');
$name->setLabel('Name');
$name->setAttribs(array(
'size' => 50,
'maxlength' => 255,
'placeholder' => 'e.g., Intro for contact page',
'class' => 'form-control input-sm'
));
$name->setDescription('Give the content item a name, this will allow you to recreate it again later.');
$name->setBelongsTo('params');
$name->setRequired();

if (array_key_exists('name', $this->data) === true && $this->data['name'] !== false) {
$name->setValue($this->data['name']);
}

$this->elements['name'] = $name;

if ($this->tool['content_id'] !== null && $this->instances > 1) {
$instances = new Zend_Form_Element_Select('instances');
$instances->setLabel('Update shared content?');
$instances->setDescription("The content below is used {$this->instances} times* on your web site, do you
want to update the text for this content item only or all content items?");
$instances->setMultiOptions(
array(
1 => 'Yes - update all content items',
0 => 'No - Please only update this item'
)
);
$instances->setAttribs(array('class' => 'form-control input-sm'));
$instances->setBelongsTo('params');

$this->elements['instances'] = $instances;
}

$content = new Dlayer_Form_Element_Quill('content');
$content->setLabel('Content');
$content->setDescription('Enter your content.');
$content->setBelongsTo('params');
$content->setRequired();

$this->elements['content'] = $content;
}
}
Loading

0 comments on commit 697c999

Please sign in to comment.