Skip to content

Commit

Permalink
Merge pull request #154 from deanblackborough/typography
Browse files Browse the repository at this point in the history
Typography
  • Loading branch information
deanblackborough committed Dec 10, 2016
2 parents 9a67692 + 86336ea commit 3cc45a2
Show file tree
Hide file tree
Showing 33 changed files with 1,121 additions and 51 deletions.
4 changes: 2 additions & 2 deletions application/configs/environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
/**
* Version number and version release date
*/
$version_no = 'v1.00-alpha-2';
$version_release_date = '23rd November 2016';
$version_no = 'v1.00-alpha-3';
$version_release_date = '10th December 2016';
10 changes: 8 additions & 2 deletions application/modules/content/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,11 @@
*/
class Content_Bootstrap extends Zend_Application_Module_Bootstrap
{

}
public function _initModuleDefaults()
{
/**
* @todo Check the settings for the module
*/
define('DEFAULT_FONT_FAMILY_FOR_MODULE', 1);
}
}
4 changes: 4 additions & 0 deletions application/modules/content/controllers/DesignController.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ private function dlayerPage()
$this->view->content = $designer_page->content();

// Set the vars to determine the state of the designer
$this->view->page_id = $this->page_id;
$this->view->page_selected = $this->session_content->pageSelected();
$this->view->column_id = $this->session_content->columnId();
$this->view->row_id = $this->session_content->rowId();
Expand All @@ -342,6 +343,7 @@ private function dlayerPage()
$this->view->styling_content_items = $designer_page->contentItemStyles();
$this->view->styling_columns = $designer_page->columnStyles();
$this->view->styling_rows = $designer_page->rowStyles();
$this->view->styling_page = $designer_page->pageStyles();

return $this->view->render("design/page.phtml");
}
Expand All @@ -357,13 +359,15 @@ private function dlayerPagePreview()
$designer_page = new Dlayer_Designer_ContentPage($this->site_id, $this->page_id); // Fix this

// Fetch the data that defines the structure of the page
$this->view->page_id = $this->page_id;
$this->view->rows = $designer_page->rows();
$this->view->columns = $designer_page->columns();
$this->view->content = $designer_page->content();

$this->view->styling_content_items = $designer_page->contentItemStyles();
$this->view->styling_columns = $designer_page->columnStyles();
$this->view->styling_rows = $designer_page->rowStyles();
$this->view->styling_page = $designer_page->pageStyles();

return $this->view->render("design/page-preview.phtml");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $(document).ready(function() {
});
</script>

<?php echo $this->contentPagePreview($this->rows, $this->columns, $this->content)->setStyles($this->styling_rows, $this->styling_columns, $this->styling_content_items); ?>
<?php echo $this->contentPagePreview($this->page_id, $this->rows, $this->columns, $this->content)->setStyles($this->styling_page, $this->styling_rows, $this->styling_columns, $this->styling_content_items); ?>

<div class="modal fade" id="imageModalDialog" tabindex="-1" role="dialog"
aria-labelledby="imageModalDialogLabel" aria-hidden="true">
Expand Down
4 changes: 2 additions & 2 deletions application/modules/content/views/scripts/design/page.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
?>

<div class="content-manager">
<?php echo $this->contentPage($this->rows, $this->columns, $this->content, $this->page_selected,
$this->column_id, $this->row_id, $this->content_id)->setStyles($this->styling_rows, $this->styling_columns, $this->styling_content_items); ?>
<?php echo $this->contentPage($this->page_id, $this->rows, $this->columns, $this->content, $this->page_selected,
$this->column_id, $this->row_id, $this->content_id)->setStyles($this->styling_page, $this->styling_rows, $this->styling_columns, $this->styling_content_items); ?>
</div>
7 changes: 7 additions & 0 deletions application/modules/dlayer/controllers/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,13 @@ public function editSiteAction()
*/
public function logoutAction()
{
if (file_exists(APPLICATION_PATH . '/../private/logs/error.log') === true) {
unlink(APPLICATION_PATH . '/../private/logs/error.log');
}
if (file_exists(APPLICATION_PATH . '/../private/logs/app.log') === true) {
unlink(APPLICATION_PATH . '/../private/logs/app.log');
}

$this->handleLogout();
}

Expand Down
6 changes: 4 additions & 2 deletions application/modules/dlayer/controllers/LogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ public function appAction()
{
$this->_helper->authenticate();

$this->view->file = file(APPLICATION_PATH . '/../private/logs/app.log');
$file = file(APPLICATION_PATH . '/../private/logs/app.log');
$this->view->file = array_reverse($file);

$this->_helper->setLayoutProperties($this->nav_bar_items, '/dlayer/log/app', array('css/dlayer.css'),
array(), 'Dlayer.com - App log');
Expand All @@ -78,7 +79,8 @@ public function errorAction()
{
$this->_helper->authenticate();

$this->view->file = file(APPLICATION_PATH . '/../private/logs/error.log');
$file = file(APPLICATION_PATH . '/../private/logs/error.log');
$this->view->file = array_reverse($file);

$this->_helper->setLayoutProperties($this->nav_bar_items, '/dlayer/log/error', array('css/dlayer.css'),
array(), 'Dlayer.com - Error log');
Expand Down
10 changes: 10 additions & 0 deletions library/Dlayer/Designer/ContentPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,16 @@ public function columnStyles()
return $this->model_styling->columns();
}

/**
* Fetch all the styles for the page itself
*
* @return array
*/
public function pageStyles()
{
return $this->model_styling->page();
}

/**
* Fetch all the styles for the rows that make up the page
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ protected function backgroundColor()
);

$model_palette->addToHistory($this->site_id, $this->params['background_color']);

Dlayer_Helper::sendToInfoLog('Set background colour for column: ' . $this->content_id .
' site_id: ' . $this->site_id . ' page id: ' . $this->page_id .
' column id: ' . $this->column_id);
} catch (Exception $e) {
throw new Exception($e->getMessage(), $e->getCode(), $e);
}
Expand All @@ -126,6 +130,10 @@ protected function backgroundColor()
$model_text->editBackgroundColor($id, $this->params['background_color']);
if ($this->params['background_color'] !== null && strlen($this->params['background_color']) === 7) {
$model_palette->addToHistory($this->site_id, $this->params['background_color']);

Dlayer_Helper::sendToInfoLog('Set background colour for column: ' . $this->content_id .
' site_id: ' . $this->site_id . ' page id: ' . $this->page_id .
' column id: ' . $this->column_id);
}
} catch (Exception $e) {
throw new Exception($e->getMessage(), $e->getCode(), $e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ protected function backgroundColorContentItem()
$this->params['content_background_color']
);
$model_palette->addToHistory($this->site_id, $this->params['content_background_color']);

Dlayer_Helper::sendToInfoLog('Set background colour for form: ' . $this->content_id .
' site_id: ' . $this->site_id . ' page id: ' . $this->page_id .
' row id: ' . $this->row_id . ' column id: ' . $this->column_id);
} catch (Exception $e) {
throw new Exception($e->getMessage(), $e->getCode(), $e);
}
Expand All @@ -127,6 +131,10 @@ protected function backgroundColorContentItem()
$model_form->editBackgroundColor($id, $this->params['content_background_color']);
if ($this->params['content_background_color'] !== null && strlen($this->params['content_background_color']) === 7) {
$model_palette->addToHistory($this->site_id, $this->params['content_background_color']);

Dlayer_Helper::sendToInfoLog('Set background colour for form: ' . $this->content_id .
' site_id: ' . $this->site_id . ' page id: ' . $this->page_id .
' row id: ' . $this->row_id . ' column id: ' . $this->column_id);
}
} catch (Exception $e) {
throw new Exception($e->getMessage(), $e->getCode(), $e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,12 @@ protected function backgroundColorContentItem()
$this->content_id,
$this->params['content_background_color']
);

$model_palette->addToHistory($this->site_id, $this->params['content_background_color']);

Dlayer_Helper::sendToInfoLog('Set background colour for heading content item: ' . $this->content_id .
' site_id: ' . $this->site_id . ' page id: ' . $this->page_id .
' row id: ' . $this->row_id . ' column id: ' . $this->column_id);
} catch (Exception $e) {
throw new Exception($e->getMessage(), $e->getCode(), $e);
}
Expand All @@ -127,6 +132,10 @@ protected function backgroundColorContentItem()
$model_heading->editBackgroundColor($id, $this->params['content_background_color']);
if ($this->params['content_background_color'] !== null && strlen($this->params['content_background_color']) === 7) {
$model_palette->addToHistory($this->site_id, $this->params['content_background_color']);

Dlayer_Helper::sendToInfoLog('Set background colour for heading content item: ' . $this->content_id .
' site_id: ' . $this->site_id . ' page id: ' . $this->page_id .
' row id: ' . $this->row_id . ' column id: ' . $this->column_id);
}
} catch (Exception $e) {
throw new Exception($e->getMessage(), $e->getCode(), $e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ protected function backgroundColorContentItem()
$this->params['content_background_color']
);
$model_palette->addToHistory($this->site_id, $this->params['content_background_color']);

Dlayer_Helper::sendToInfoLog('Set background colour for a html snippet: ' . $this->content_id .
' site_id: ' . $this->site_id . ' page id: ' . $this->page_id .
' row id: ' . $this->row_id . ' column id: ' . $this->column_id);
} catch (Exception $e) {
throw new Exception($e->getMessage(), $e->getCode(), $e);
}
Expand All @@ -128,6 +132,10 @@ protected function backgroundColorContentItem()
$model->editBackgroundColor($id, $this->params['content_background_color']);
if ($this->params['content_background_color'] !== null && strlen($this->params['content_background_color']) === 7) {
$model_palette->addToHistory($this->site_id, $this->params['content_background_color']);

Dlayer_Helper::sendToInfoLog('Set background colour for html snippet: ' . $this->content_id .
' site_id: ' . $this->site_id . ' page id: ' . $this->page_id .
' row id: ' . $this->row_id . ' column id: ' . $this->column_id);
}
} catch (Exception $e) {
throw new Exception($e->getMessage(), $e->getCode(), $e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ protected function backgroundColorContentItem()
$this->params['content_background_color']
);
$model_palette->addToHistory($this->site_id, $this->params['content_background_color']);

Dlayer_Helper::sendToInfoLog('Set background colour for image content item: ' . $this->content_id .
' site_id: ' . $this->site_id . ' page id: ' . $this->page_id .
' row id: ' . $this->row_id . ' column id: ' . $this->column_id);
} catch (Exception $e) {
throw new Exception($e->getMessage(), $e->getCode(), $e);
}
Expand All @@ -127,6 +131,10 @@ protected function backgroundColorContentItem()
$model_heading->editBackgroundColor($id, $this->params['content_background_color']);
if ($this->params['content_background_color'] !== null && strlen($this->params['content_background_color']) === 7) {
$model_palette->addToHistory($this->site_id, $this->params['content_background_color']);

Dlayer_Helper::sendToInfoLog('Set background colour for image content item: ' . $this->content_id .
' site_id: ' . $this->site_id . ' page id: ' . $this->page_id .
' row id: ' . $this->row_id . ' column id: ' . $this->column_id);
}
} catch (Exception $e) {
throw new Exception($e->getMessage(), $e->getCode(), $e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ protected function backgroundColorContentItem()
$this->params['content_background_color']
);
$model_palette->addToHistory($this->site_id, $this->params['content_background_color']);

Dlayer_Helper::sendToInfoLog('Set background colour for jumbotron content item: ' . $this->content_id .
' site_id: ' . $this->site_id . ' page id: ' . $this->page_id .
' row id: ' . $this->row_id . ' column id: ' . $this->column_id);
} catch (Exception $e) {
throw new Exception($e->getMessage(), $e->getCode(), $e);
}
Expand All @@ -127,6 +131,10 @@ protected function backgroundColorContentItem()
$model_jumbotron->editBackgroundColor($id, $this->params['content_background_color']);
if ($this->params['content_background_color'] !== null && strlen($this->params['content_background_color']) === 7) {
$model_palette->addToHistory($this->site_id, $this->params['content_background_color']);

Dlayer_Helper::sendToInfoLog('Set background colour for jumbotron content item: ' . $this->content_id .
' site_id: ' . $this->site_id . ' page id: ' . $this->page_id .
' row id: ' . $this->row_id . ' column id: ' . $this->column_id);
}
} catch (Exception $e) {
throw new Exception($e->getMessage(), $e->getCode(), $e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ protected function backgroundColor()
);

$model_palette->addToHistory($this->site_id, $this->params['background_color']);

Dlayer_Helper::sendToInfoLog('Set background colour for page: ' . $this->content_id .
' site_id: ' . $this->site_id . ' page id: ' . $this->page_id);
} catch (Exception $e) {
throw new Exception($e->getMessage(), $e->getCode(), $e);
}
Expand All @@ -125,6 +128,9 @@ protected function backgroundColor()
$model_styling->editBackgroundColor($id, $this->params['background_color']);
if ($this->params['background_color'] !== null && strlen($this->params['background_color']) === 7) {
$model_palette->addToHistory($this->site_id, $this->params['background_color']);

Dlayer_Helper::sendToInfoLog('Set background colour for page: ' . $this->content_id .
' site_id: ' . $this->site_id . ' page id: ' . $this->page_id);
}
} catch (Exception $e) {
throw new Exception($e->getMessage(), $e->getCode(), $e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ protected function backgroundColor()
);

$model_palette->addToHistory($this->site_id, $this->params['background_color']);

Dlayer_Helper::sendToInfoLog('Set background colour for row: ' . $this->content_id .
' site_id: ' . $this->site_id . ' page id: ' . $this->page_id .
' row id: ' . $this->row_id);
} catch (Exception $e) {
throw new Exception($e->getMessage(), $e->getCode(), $e);
}
Expand All @@ -126,6 +130,10 @@ protected function backgroundColor()
$model_row->editBackgroundColor($id, $this->params['background_color']);
if ($this->params['background_color'] !== null && strlen($this->params['background_color']) === 7) {
$model_palette->addToHistory($this->site_id, $this->params['background_color']);

Dlayer_Helper::sendToInfoLog('Set background colour for row: ' . $this->content_id .
' site_id: ' . $this->site_id . ' page id: ' . $this->page_id .
' row id: ' . $this->row_id);
}
} catch (Exception $e) {
throw new Exception($e->getMessage(), $e->getCode(), $e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,25 @@ protected function backgroundColorContentItem()
$this->content_id,
$this->params['content_background_color']
);

$model_palette->addToHistory($this->site_id, $this->params['content_background_color']);

Dlayer_Helper::sendToInfoLog('Set background colour for text content item: ' . $this->content_id .
' site_id: ' . $this->site_id . ' page id: ' . $this->page_id .
' row id: ' . $this->row_id . ' column id: ' . $this->column_id);
} catch (Exception $e) {
throw new Exception($e->getMessage(), $e->getCode(), $e);
}
} else {
try {
$model_text->editBackgroundColor($id, $this->params['content_background_color']);

if ($this->params['content_background_color'] !== null && strlen($this->params['content_background_color']) === 7) {
$model_palette->addToHistory($this->site_id, $this->params['content_background_color']);

Dlayer_Helper::sendToInfoLog('Set background colour for text content item: ' . $this->content_id .
' site_id: ' . $this->site_id . ' page id: ' . $this->page_id .
' row id: ' . $this->row_id . ' column id: ' . $this->column_id);
}
} catch (Exception $e) {
throw new Exception($e->getMessage(), $e->getCode(), $e);
Expand Down
Loading

0 comments on commit 3cc45a2

Please sign in to comment.