-
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 #221 from deanblackborough/heading-date-sub-tools
Heading date sub tools
- Loading branch information
Showing
24 changed files
with
647 additions
and
23 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
29 changes: 29 additions & 0 deletions
29
library/Dlayer/DesignerTool/ContentManager/HeadingDate/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,29 @@ | ||
<?php | ||
|
||
/** | ||
* Delete sub tool for heading & date content items | ||
* | ||
* @author Dean Blackborough | ||
* @copyright G3D Development Limited | ||
* @license https://github.com/Dlayer/dlayer/blob/master/LICENSE | ||
*/ | ||
class Dlayer_DesignerTool_ContentManager_HeadingDate_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 = 'heading-date'; | ||
$this->sub_tool_model = 'Delete'; | ||
|
||
parent::__construct($tool, $data, $instances, $element_data, $options); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
library/Dlayer/DesignerTool/ContentManager/HeadingDate/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,14 @@ | ||
<?php | ||
|
||
/** | ||
* Data model for the heading & date delete sub tool | ||
* | ||
* @author Dean Blackborough <[email protected]> | ||
* @copyright G3D Development Limited | ||
* @license https://github.com/Dlayer/dlayer/blob/master/LICENSE | ||
*/ | ||
class Dlayer_DesignerTool_ContentManager_HeadingDate_SubTool_Delete_Model extends | ||
Dlayer_DesignerTool_ContentManager_Shared_Model_Delete | ||
{ | ||
// No custom logic required | ||
} |
54 changes: 54 additions & 0 deletions
54
library/Dlayer/DesignerTool/ContentManager/HeadingDate/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,54 @@ | ||
<?php | ||
|
||
/** | ||
* Heading & Date ribbon data class for delete sub tool | ||
* | ||
* @author Dean Blackborough <[email protected]> | ||
* @copyright G3D Development Limited | ||
* @license https://github.com/Dlayer/dlayer/blob/master/LICENSE | ||
*/ | ||
class Dlayer_DesignerTool_ContentManager_HeadingDate_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_HeadingDate_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. | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
library/Dlayer/DesignerTool/ContentManager/HeadingDate/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,14 @@ | ||
<?php | ||
|
||
/** | ||
* Heading & date delete sub tool | ||
* | ||
* @author Dean Blackborough <[email protected]> | ||
* @copyright G3D Development Limited | ||
* @license https://github.com/Dlayer/dlayer/blob/master/LICENSE | ||
*/ | ||
class Dlayer_DesignerTool_ContentManager_HeadingDate_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/HeadingDate/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> |
29 changes: 29 additions & 0 deletions
29
library/Dlayer/DesignerTool/ContentManager/HeadingDate/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,29 @@ | ||
<?php | ||
|
||
/** | ||
* Styling sub tools for the heading & date content item | ||
* | ||
* @author Dean Blackborough | ||
* @copyright G3D Development Limited | ||
* @license https://github.com/Dlayer/dlayer/blob/master/LICENSE | ||
*/ | ||
class Dlayer_DesignerTool_ContentManager_HeadingDate_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 = 'heading-date'; | ||
$this->sub_tool_model = 'Styling'; | ||
|
||
parent::__construct($tool, $data, $instances, $element_data, $options); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
library/Dlayer/DesignerTool/ContentManager/HeadingDate/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,14 @@ | ||
<?php | ||
|
||
/** | ||
* Data model for styling sub tool | ||
* | ||
* @author Dean Blackborough <[email protected]> | ||
* @copyright G3D Development Limited | ||
* @license https://github.com/Dlayer/dlayer/blob/master/LICENSE | ||
*/ | ||
class Dlayer_DesignerTool_ContentManager_HeadingDate_SubTool_Styling_Model extends | ||
Dlayer_DesignerTool_ContentManager_Shared_Model_Styling | ||
{ | ||
// No custom logic, here if required | ||
} |
97 changes: 97 additions & 0 deletions
97
library/Dlayer/DesignerTool/ContentManager/HeadingDate/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,97 @@ | ||
<?php | ||
|
||
/** | ||
* Heading & Date content item ribbon data class | ||
* | ||
* @author Dean Blackborough <[email protected]> | ||
* @copyright G3D Development Limited | ||
* @license https://github.com/Dlayer/dlayer/blob/master/LICENSE | ||
*/ | ||
class Dlayer_DesignerTool_ContentManager_HeadingDate_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_HeadingDate_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 Write 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_HeadingDate_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; | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
library/Dlayer/DesignerTool/ContentManager/HeadingDate/SubTool/Styling/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,49 @@ | ||
<?php | ||
|
||
/** | ||
* Styling sub tool | ||
* | ||
* @author Dean Blackborough <[email protected]> | ||
* @copyright G3D Development Limited | ||
* @license https://github.com/Dlayer/dlayer/blob/master/LICENSE | ||
*/ | ||
class Dlayer_DesignerTool_ContentManager_HeadingDate_SubTool_Styling_Tool extends | ||
Dlayer_DesignerTool_ContentManager_Shared_Tool_Styling | ||
{ | ||
/** | ||
* Generate the return ids array | ||
* | ||
* @return array | ||
*/ | ||
protected function returnIds() | ||
{ | ||
return array( | ||
array( | ||
'type' => 'page_id', | ||
'id' => $this->page_id, | ||
), | ||
array( | ||
'type' => 'row_id', | ||
'id' => $this->row_id, | ||
), | ||
array( | ||
'type' => 'column_id', | ||
'id' => $this->column_id, | ||
), | ||
array( | ||
'type' => 'tool', | ||
'id' => 'HeadingDate', | ||
), | ||
array( | ||
'type' => 'tab', | ||
'id' => 'styling', | ||
'sub_tool' => 'Styling' | ||
), | ||
array( | ||
'type' => 'content_id', | ||
'id' => $this->content_id, | ||
'content_type' => 'heading-date' | ||
) | ||
); | ||
} | ||
} |
Oops, something went wrong.