-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #231 from deanblackborough/rich-text-sub-tools
Rich text sub tools
- Loading branch information
Showing
68 changed files
with
1,367 additions
and
390 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
library/Dlayer/DesignerTool/ContentManager/BlogPost/SubTool/Delete/Form.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
/** | ||
* @author Dean Blackborough | ||
* @copyright G3D Development Limited | ||
* @license https://github.com/Dlayer/dlayer/blob/master/LICENSE | ||
*/ | ||
class Dlayer_DesignerTool_ContentManager_BlogPost_SubTool_Delete_Form extends | ||
Dlayer_DesignerTool_ContentManager_Shared_Form_Delete | ||
{ | ||
/** | ||
* 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 = 'BlogPost'; | ||
$this->sub_tool_model = 'Delete'; | ||
|
||
parent::__construct($tool, $data, $instances, $element_data, $options); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
library/Dlayer/DesignerTool/ContentManager/BlogPost/SubTool/Delete/Model.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
/** | ||
* @author Dean Blackborough <dean@g3d-development.com> | ||
* @copyright G3D Development Limited | ||
* @license https://github.com/Dlayer/dlayer/blob/master/LICENSE | ||
*/ | ||
class Dlayer_DesignerTool_ContentManager_BlogPost_SubTool_Delete_Model extends | ||
Dlayer_DesignerTool_ContentManager_Shared_Model_Delete | ||
{ | ||
// No custom logic required | ||
} |
52 changes: 52 additions & 0 deletions
52
library/Dlayer/DesignerTool/ContentManager/BlogPost/SubTool/Delete/Ribbon.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
/** | ||
@author Dean Blackborough <dean@g3d-development.com> | ||
* @copyright G3D Development Limited | ||
* @license https://github.com/Dlayer/dlayer/blob/master/LICENSE | ||
*/ | ||
class Dlayer_DesignerTool_ContentManager_BlogPost_SubTool_Delete_Ribbon extends Dlayer_Ribbon_Content | ||
{ | ||
/** | ||
* Fetch the view data for the current tool tab, typically the returned array will have at least two indexes, | ||
* one for the form and another with the data required by the preview functions | ||
* | ||
* @param array $tool Tool and environment data | ||
* | ||
* @return array | ||
*/ | ||
public function viewData(array $tool) | ||
{ | ||
$this->tool = $tool; | ||
|
||
return array( | ||
'form' => new Dlayer_DesignerTool_ContentManager_BlogPost_SubTool_Delete_Form( | ||
$tool, | ||
array(), | ||
0, | ||
array() | ||
) | ||
); | ||
} | ||
|
||
/** | ||
* Fetch the data array for the content item, if in edit mode mode populate the values otherwise every value is | ||
* set to FALSE, the tool form can simply check to see if the value is FALSe or not and then set the existing value | ||
* | ||
* @return array | ||
*/ | ||
protected function contentData() | ||
{ | ||
// TODO: Implement contentData() method. | ||
} | ||
|
||
/** | ||
* Fetch the number of instances for the content items data | ||
* | ||
* @return integer | ||
*/ | ||
protected function instancesOfData() | ||
{ | ||
// TODO: Implement instancesOfData() method. | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
library/Dlayer/DesignerTool/ContentManager/BlogPost/SubTool/Delete/Tool.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
/** | ||
* @author Dean Blackborough <dean@g3d-development.com> | ||
* @copyright G3D Development Limited | ||
* @license https://github.com/Dlayer/dlayer/blob/master/LICENSE | ||
*/ | ||
class Dlayer_DesignerTool_ContentManager_BlogPost_SubTool_Delete_Tool extends | ||
Dlayer_DesignerTool_ContentManager_Shared_Tool_Delete | ||
{ | ||
// No custom logic required | ||
} |
9 changes: 9 additions & 0 deletions
9
library/Dlayer/DesignerTool/ContentManager/BlogPost/SubTool/Delete/scripts/delete.phtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php /** @var $this Dlayer_View_Codehinting */ ?> | ||
|
||
<div class="col-md-12 col-sm-12 small"> | ||
<?php | ||
if ($this->data != false) { | ||
echo $this->data['form']; | ||
} | ||
?> | ||
</div> |
27 changes: 27 additions & 0 deletions
27
library/Dlayer/DesignerTool/ContentManager/BlogPost/SubTool/Styling/Form.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
/** | ||
* @author Dean Blackborough | ||
* @copyright G3D Development Limited | ||
* @license https://github.com/Dlayer/dlayer/blob/master/LICENSE | ||
*/ | ||
class Dlayer_DesignerTool_ContentManager_BlogPost_SubTool_Styling_Form extends | ||
Dlayer_DesignerTool_ContentManager_Shared_Form_Styling | ||
{ | ||
/** | ||
* 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 = 'BlogPost'; | ||
$this->sub_tool_model = 'Styling'; | ||
|
||
parent::__construct($tool, $data, $instances, $element_data, $options); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
library/Dlayer/DesignerTool/ContentManager/BlogPost/SubTool/Styling/Model.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
/** | ||
* @author Dean Blackborough <dean@g3d-development.com> | ||
* @copyright G3D Development Limited | ||
* @license https://github.com/Dlayer/dlayer/blob/master/LICENSE | ||
*/ | ||
class Dlayer_DesignerTool_ContentManager_BlogPost_SubTool_Styling_Model extends | ||
Dlayer_DesignerTool_ContentManager_Shared_Model_Styling | ||
{ | ||
// No custom logic, here if required | ||
} |
95 changes: 95 additions & 0 deletions
95
library/Dlayer/DesignerTool/ContentManager/BlogPost/SubTool/Styling/Ribbon.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
<?php | ||
|
||
/** | ||
* @author Dean Blackborough <dean@g3d-development.com> | ||
* @copyright G3D Development Limited | ||
* @license https://github.com/Dlayer/dlayer/blob/master/LICENSE | ||
*/ | ||
class Dlayer_DesignerTool_ContentManager_BlogPost_SubTool_Styling_Ribbon extends Dlayer_Ribbon_Content | ||
{ | ||
/** | ||
* Fetch the view data for the current tool tab, typically the returned array will have at least two indexes, | ||
* one for the form and another with the data required by the preview functions | ||
* | ||
* @param array $tool Tool and environment data | ||
* | ||
* @return array | ||
*/ | ||
public function viewData(array $tool) | ||
{ | ||
$this->tool = $tool; | ||
|
||
$this->contentData(); | ||
$this->previewData(); | ||
|
||
return array( | ||
'form' => new Dlayer_DesignerTool_ContentManager_BlogPost_SubTool_Styling_Form( | ||
$tool, | ||
$this->content_data, | ||
$this->instancesOfData(), | ||
array() | ||
), | ||
'preview' => $this->preview_data | ||
); | ||
} | ||
|
||
/** | ||
* Fetch the data array for the content item, if in edit mode mode populate the values otherwise every value is | ||
* set to FALSE, the tool form can simply check to see if the value is FALSe or not and then set the existing value | ||
* | ||
* @return void Writes to $this->content_data | ||
*/ | ||
protected function contentData() | ||
{ | ||
if($this->content_fetched === false) { | ||
$this->content_data = array( | ||
'content_background_color' => false, | ||
); | ||
|
||
if ($this->tool['content_id'] !== null) { | ||
$model_styling = new Dlayer_DesignerTool_ContentManager_BlogPost_SubTool_Styling_Model(); | ||
$content_background_color = $model_styling->backgroundColor( | ||
$this->tool['site_id'], | ||
$this->tool['page_id'], | ||
$this->tool['content_id'] | ||
); | ||
|
||
if ($content_background_color !== false) { | ||
$this->content_data['content_background_color'] = $content_background_color; | ||
} | ||
} | ||
|
||
$this->content_fetched = true; | ||
} | ||
} | ||
|
||
/** | ||
* Fetch the data required by the preview functions | ||
* | ||
* @return void | ||
*/ | ||
protected function previewData() | ||
{ | ||
if ($this->preview_data_fetched === false) { | ||
|
||
$this->contentData(); | ||
|
||
$this->preview_data = array( | ||
'id' => $this->tool['content_id'], | ||
'background_color' => $this->content_data['content_background_color'] | ||
); | ||
|
||
$this->preview_data_fetched = true; | ||
} | ||
} | ||
|
||
/** | ||
* Fetch the number of instances for the content items data | ||
* | ||
* @return integer | ||
*/ | ||
protected function instancesOfData() | ||
{ | ||
return 0; | ||
} | ||
} |
Oops, something went wrong.