Permalink
Browse files

Updating method visibility

  • Loading branch information...
bermi committed Oct 17, 2011
1 parent 386e7bb commit 99df2ac907a970e1027298a5af19fe60180b79d5
@@ -24,6 +24,8 @@ class EditamController extends ApplicationController
public $admin_menu_options = array();
public $menu_options = array();
function __construct()
{
$this->site_url = $this->base = rtrim(AK_URL,'/');
@@ -282,8 +284,8 @@ public function _getTemplateHookBasePath($options = array())
return false;
}
if(is_string($options['partial'])){
$path = $this->Template->_partialPathPiece($options['partial']);
$partial_name = $this->Template->_partialPathName($options['partial']);
$path = $this->Template->partialPathPiece($options['partial']);
$partial_name = $this->Template->partialPathName($options['partial']);
$template_path = (empty($path) ? '' : $path.DS).'_'.$partial_name;
}else{
$template_path = $options['partial'];
@@ -157,7 +157,7 @@ public function _getHtmlElementClasses($set_classes = null)
public function _instantiateEditagsHelpers()
{
$available_helpers = $this->_getEditagsHelperMethods();
$available_helpers = $this->getEditagsHelperMethods();
$helper_names = array_unique(array_values($available_helpers));
foreach ($helper_names as $underscored_helper_name){
@@ -173,29 +173,29 @@ public function _instantiateEditagsHelpers()
$this->_registerEditagsHelperFuntions($available_helpers);
}
public function _getEditagsHelperMethods()
static public function getEditagsHelperMethods()
{
$available_helpers = array();
EditagsHelper::_addAkelosHelperMethods_($available_helpers);
EditagsHelper::addAkelosHelperMethods_($available_helpers);
$helper_files = AkFileSystem::dir(EDITAGS_HELPERS_DIR, array('dirs'=>false));
foreach ($helper_files as $helper_file){
$underscored_helper_name = substr($helper_file,0,-4);
include_once(EDITAGS_HELPERS_DIR.DS.$helper_file);
EditagsHelper::_addHelperMethods_($underscored_helper_name, $available_helpers);
EditagsHelper::addHelperMethods_($underscored_helper_name, $available_helpers);
}
return $available_helpers;
}
public function _addAkelosHelperMethods_(&$available_helpers)
static public function addAkelosHelperMethods_(&$available_helpers)
{
if($underscored_helper_names = AkHelperLoader::getInstantiatedHelperNames()){
foreach($underscored_helper_names as $underscored_helper_name){
EditagsHelper::_addHelperMethods_($underscored_helper_name, $available_helpers);
EditagsHelper::addHelperMethods_($underscored_helper_name, $available_helpers);
}
}
}
public function _addHelperMethods_($underscored_helper_name, &$available_helpers)
static public function addHelperMethods_($underscored_helper_name, &$available_helpers)
{
$helper_class_name = AkInflector::camelize($underscored_helper_name);
if(class_exists($helper_class_name)){
@@ -209,7 +209,7 @@ public function _addHelperMethods_($underscored_helper_name, &$available_helpers
public function _registerEditagsHelperFuntions($available_helpers = array())
{
$available_helpers = empty($available_helpers) ? $this->_getEditagsHelperMethods() : $available_helpers;
$available_helpers = empty($available_helpers) ? $this->getEditagsHelperMethods() : $available_helpers;
defined('EDITAM_AVAILABLE_HELPERS') ? null : define('EDITAM_AVAILABLE_HELPERS', serialize($available_helpers));
}
@@ -157,7 +157,7 @@ public function _getHtmlElementClasses($set_classes = null)
public function _instantiateEditagsHelpers()
{
$available_helpers = $this->_getEditagsHelperMethods();
$available_helpers = $this->getEditagsHelperMethods();
$helper_names = array_unique(array_values($available_helpers));
foreach ($helper_names as $underscored_helper_name){
@@ -173,29 +173,29 @@ public function _instantiateEditagsHelpers()
$this->_registerEditagsHelperFuntions($available_helpers);
}
public function _getEditagsHelperMethods()
static public function getEditagsHelperMethods()
{
$available_helpers = array();
EditagsHelper::_addAkelosHelperMethods_($available_helpers);
EditagsHelper::addAkelosHelperMethods_($available_helpers);
$helper_files = AkFileSystem::dir(EDITAGS_HELPERS_DIR, array('dirs'=>false));
foreach ($helper_files as $helper_file){
$underscored_helper_name = substr($helper_file,0,-4);
include_once(EDITAGS_HELPERS_DIR.DS.$helper_file);
EditagsHelper::_addHelperMethods_($underscored_helper_name, $available_helpers);
EditagsHelper::addHelperMethods_($underscored_helper_name, $available_helpers);
}
return $available_helpers;
}
public function _addAkelosHelperMethods_(&$available_helpers)
static public function addAkelosHelperMethods_(&$available_helpers)
{
if($underscored_helper_names = AkHelperLoader::getInstantiatedHelperNames()){
foreach($underscored_helper_names as $underscored_helper_name){
EditagsHelper::_addHelperMethods_($underscored_helper_name, $available_helpers);
EditagsHelper::addHelperMethods_($underscored_helper_name, $available_helpers);
}
}
}
public function _addHelperMethods_($underscored_helper_name, &$available_helpers)
static public function addHelperMethods_($underscored_helper_name, &$available_helpers)
{
$helper_class_name = AkInflector::camelize($underscored_helper_name);
if(class_exists($helper_class_name)){
@@ -209,7 +209,7 @@ public function _addHelperMethods_($underscored_helper_name, &$available_helpers
public function _registerEditagsHelperFuntions($available_helpers = array())
{
$available_helpers = empty($available_helpers) ? $this->_getEditagsHelperMethods() : $available_helpers;
$available_helpers = empty($available_helpers) ? $this->getEditagsHelperMethods() : $available_helpers;
defined('EDITAM_AVAILABLE_HELPERS') ? null : define('EDITAM_AVAILABLE_HELPERS', serialize($available_helpers));
}
@@ -33,7 +33,7 @@ public function &_getFilterInstance($filter_name)
return $filters[$filter_name];
}
public function getAvailableFilters()
static public function getAvailableFilters()
{
static $filters = array();
if(empty($filters)){
@@ -6,7 +6,7 @@
class SitePreference extends ActiveRecord
{
public function set($attribute, $value)
public function set($attribute, $value = null, $inspect_for_callback_child_method = true, $compose_after_set = true)
{
if($attribute == 'value' && !empty($this->is_core)) {
$PreferenceHandler = new CorePreferences();
@@ -15,10 +15,10 @@ public function set($attribute, $value)
return $PreferenceHandler->$setter_method_name($this, $value);
}
}
return parent::set($attribute, $value);
return parent::set($attribute, $value, $inspect_for_callback_child_method, $compose_after_set);
}
public function get($attribute)
public function get($attribute = null, $inspect_for_callback_child_method = true)
{
if($attribute == 'value' && !empty($this->is_core)) {
$PreferenceHandler = new CorePreferences();
@@ -28,7 +28,7 @@ public function get($attribute)
}
}
return parent::get($attribute);
return parent::get($attribute, $inspect_for_callback_child_method);
}
public function _loadPreferences()
@@ -249,8 +249,8 @@ public function _getTemplateHookBasePath(\$options = array())
return false;
}
if(is_string(\$options['partial'])){
\$path = \$this->Template->_partialPathPiece(\$options['partial']);
\$partial_name = \$this->Template->_partialPathName(\$options['partial']);
\$path = \$this->Template->partialPathPiece(\$options['partial']);
\$partial_name = \$this->Template->partialPathName(\$options['partial']);
\$template_path = (empty(\$path) ? '' : \$path.DS).'_'.\$partial_name;
}else{
\$template_path = \$options['partial'];
@@ -3,7 +3,7 @@
array(
"searched" => "/(class\s*BaseActiveRecord\s*extends\s*AkActiveRecord\s*{)/",
"detect_modified" => "/function\s*init[\w\W]*function\s*validatesEditagsField[\w\W]*function\s*_engageHooks[\w\W]*'\<\?php '\);\s*\}\s*\}/",
"replaced" => "$1\n function init(\$attributes)
"replaced" => "$1\n public function init(\$attributes = array())
{
\$this->_engageHooks(\$attributes);
return parent::init(\$attributes);
@@ -13,7 +13,7 @@ public function validatesEditagsField(\$column = 'content', \$can_have_php = tru
{
\$Editags = new Editags();
\$Editags->Parser->available_helpers = EditagsHelper::_getEditagsHelperMethods();
\$Editags->Parser->available_helpers = EditagsHelper::getEditagsHelperMethods();
\$this->_editags_php = \$Editags->toPhp(\$this->get(\$column), \$can_have_php);

0 comments on commit 99df2ac

Please sign in to comment.