This repository has been archived by the owner on Jan 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4af2ea5
commit 9750ad6
Showing
4 changed files
with
169 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,30 @@ | ||
<?php (defined('BASEPATH')) OR exit('No direct script access allowed'); | ||
<?php defined('BASEPATH') OR exit('No direct script access allowed'); | ||
/** | ||
* CMS Canvas | ||
* PageStudio | ||
* | ||
* @author Mark Price | ||
* @copyright Copyright (c) 2012 | ||
* A web application for managing website content. For use with PHP 5.4+ | ||
* | ||
* This application is based on CMS Canvas, a CodeIgniter based application, | ||
* http://cmscanvas.com/. It has been greatly altered to work for the | ||
* purposes of our development team. Additional resources and concepts have | ||
* been borrowed from PyroCMS http://pyrocms.com, for further improvement | ||
* and reliability. | ||
* | ||
* @package PageStudio | ||
* @author Cosmo Mathieu <[email protected]> | ||
* @copyright Copyright (c) 2015, Cosmo Interactive, LLC | ||
* @license MIT License | ||
* @link http://cmscanvas.com | ||
* @link http://pagestudiocms.com | ||
*/ | ||
|
||
// ------------------------------------------------------------------------ | ||
|
||
/** | ||
* Helper Plugin Class | ||
* | ||
* @author Mark Price | ||
* @author Cosmo Mathieu <[email protected]> | ||
*/ | ||
class Helper_plugin extends Plugin | ||
{ | ||
public function date() | ||
|
@@ -22,21 +39,6 @@ public function date() | |
} | ||
} | ||
|
||
public function site_url() | ||
{ | ||
return site_url($this->attribute('path', '')); | ||
} | ||
|
||
public function base_url() | ||
{ | ||
return base_url($this->attribute('path', '')); | ||
} | ||
|
||
public function current_url() | ||
{ | ||
return current_url(); | ||
} | ||
|
||
/** | ||
* Creates and image with <img /> tags | ||
* http://stackoverflow.com/questions/138313/how-to-extract-img-src-title-and-alt-from-html-using-php | ||
|
@@ -82,12 +84,6 @@ public function image_thumb() | |
return image_thumb($image, $this->attribute('width', 0), $this->attribute('height', 0), $this->attribute('crop', FALSE)); | ||
} | ||
|
||
public function uri_segment() | ||
{ | ||
$CI =& get_instance(); | ||
return $CI->uri->segment($this->attribute('segment')); | ||
} | ||
|
||
/** | ||
* Update: Added support for content found in template tags / {{ braces }} | ||
* Allows for usage of: | ||
|
@@ -134,5 +130,14 @@ public function code($data) | |
$content = str_replace('}}', '}}', $content); | ||
return $content; | ||
} | ||
|
||
public function config() | ||
{ | ||
$atts = $this->attributes(); // the tag parameters | ||
|
||
$CI =& get_instance(); | ||
$CI->config->load($atts['file']); | ||
|
||
return $CI->config->item($atts['item']); | ||
} | ||
} | ||
|
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 |
---|---|---|
@@ -1,19 +1,34 @@ | ||
<?php (defined('BASEPATH')) OR exit('No direct script access allowed'); | ||
<?php defined('BASEPATH') OR exit('No direct script access allowed'); | ||
/** | ||
* CMS Canvas | ||
* PageStudio | ||
* | ||
* @author Mark Price | ||
* @copyright Copyright (c) 2012 | ||
* A web application for managing website content. For use with PHP 5.4+ | ||
* | ||
* This application is based on CMS Canvas, a CodeIgniter based application, | ||
* http://cmscanvas.com/. It has been greatly altered to work for the | ||
* purposes of our development team. Additional resources and concepts have | ||
* been borrowed from PyroCMS http://pyrocms.com, for further improvement | ||
* and reliability. | ||
* | ||
* @package PageStudio | ||
* @author Cosmo Mathieu <[email protected]> | ||
* @copyright Copyright (c) 2015, Cosmo Interactive, LLC | ||
* @license MIT License | ||
* @link http://cmscanvas.com | ||
* @link http://pagestudiocms.com | ||
*/ | ||
|
||
// ------------------------------------------------------------------------ | ||
|
||
/** | ||
* Secure Plugin Class | ||
* | ||
* @author Mark Price | ||
* @author Cosmo Mathieu <[email protected]> | ||
*/ | ||
class Secure_plugin extends Plugin | ||
{ | ||
public function is_auth() | ||
{ | ||
return ($this->secure->is_auth()) ? 1 : 0; | ||
} | ||
} | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
<?php defined('BASEPATH') OR exit('No direct script access allowed'); | ||
/** | ||
* PageStudio | ||
* | ||
* A web application for managing website content. For use with PHP 5.4+ | ||
* | ||
* This application is based on CMS Canvas, a CodeIgniter based application, | ||
* http://cmscanvas.com/. It has been greatly altered to work for the | ||
* purposes of our development team. Additional resources and concepts have | ||
* been borrowed from PyroCMS http://pyrocms.com, for further improvement | ||
* and reliability. | ||
* | ||
* @package PageStudio | ||
* @author Cosmo Mathieu <[email protected]> | ||
* @copyright Copyright (c) 2015, Cosmo Interactive, LLC | ||
* @license MIT License | ||
* @link http://pagestudiocms.com | ||
*/ | ||
|
||
// ------------------------------------------------------------------------ | ||
|
||
/** | ||
* Url Plugin | ||
* | ||
* Brings the features of the url helper to the templates in the form of a plugin. | ||
* | ||
* @package PageStudio | ||
* @subpackage codeigniter | ||
* @category Helper | ||
* @author Cosmo Mathieu <[email protected]> | ||
* @link http://pagestudiocms.com/docs/ | ||
* @license MIT License | ||
* @since Version 1.3.0 | ||
*/ | ||
class Url_plugin extends Plugin | ||
{ | ||
/** | ||
* Returns the base url of a provided path | ||
* | ||
* @return string | ||
*/ | ||
public function base_url() | ||
{ | ||
return base_url($this->attribute('path', '')); | ||
} | ||
|
||
// -------------------------------------------------------------------- | ||
|
||
/** | ||
* | ||
* | ||
* @return string | ||
*/ | ||
public function current_url() | ||
{ | ||
return current_url(); | ||
} | ||
|
||
// -------------------------------------------------------------------- | ||
|
||
/** | ||
* | ||
* | ||
* @return string | ||
*/ | ||
public function site_url() | ||
{ | ||
return site_url($this->attribute('path', '')); | ||
} | ||
|
||
// -------------------------------------------------------------------- | ||
|
||
/** | ||
* Returns part of the URI segment or a URL query parameter | ||
* | ||
* Usage: | ||
* | ||
* {{ url:get segment="[int]" }} | ||
* | ||
* {{ url:get param="[string]" }} | ||
* | ||
* @since 1.3.0 | ||
* @access public | ||
* @return string | ||
*/ | ||
public function get() | ||
{ | ||
if($this->attribute('segment')) | ||
{ | ||
return ci()->uri->segment($this->attribute('segment')); | ||
} | ||
elseif($this->attribute('param')) | ||
{ | ||
return ci()->input->get($this->attribute('param'), TRUE); | ||
} | ||
|
||
return FALSE; | ||
} | ||
|
||
// -------------------------------------------------------------------- | ||
|
||
/** | ||
* Send the visitor to another location | ||
* | ||
* Usage: | ||
* | ||
* {{ url:redirect to="[string]" }} | ||
* | ||
* @return void | ||
*/ | ||
public function redirect() | ||
{ | ||
redirect($this->attribute('to')); | ||
} | ||
} |