Permalink
Browse files

Merge pull request #33 from sams/master

Coding Standards and a few other changes
  • Loading branch information...
2 parents 6f2fcdb + 65f6dce commit bb8e90d4ed22cc3549c363ab4fd6bf4f637aacdc @slywalker slywalker committed Apr 19, 2012
@@ -6,7 +6,7 @@ class MakeShell extends AppShell {
public function main() {
$dir = WWW_ROOT;
$jsFiles = array();
- foreach(glob($dir . 'js/lib/*.js') as $file) {
+ foreach (glob($dir . 'js/lib/*.js') as $file) {
$jsFiles[] = 'js/lib/' . basename($file);
}
$jsFiles = implode(' ', $jsFiles);
@@ -22,7 +22,7 @@ class BootstrapFormHelper extends FormHelper {
public $helpers = array('Html' => array('className' => 'TwitterBootstrap.BootstrapHtml'));
- private $__opts = array();
+ protected $_Opts = array();
public function textarea($fieldName, $options, $before = false) {
if ($before) {
@@ -37,9 +37,9 @@ public function textarea($fieldName, $options, $before = false) {
public function uneditable($fieldName, $options, $before = false) {
if ($before) {
- $class = explode(' ', $this->_extractOption('class', $options));
+ $class = explode(' ', $this->_extractOption('class', $options));
if (in_array('uneditable-input', $class)) {
- $this->__opts[$fieldName] = $options;
+ $this->_Opts[$fieldName] = $options;
$options['type'] = 'uneditable';
}
return $options;
@@ -53,17 +53,17 @@ public function addon($fieldName, $options, $before = false) {
$prepend = $this->_extractOption('prepend', $options);
$append = $this->_extractOption('append', $options);
if ($prepend || $append) {
- $this->__opts[$fieldName] = $options;
+ $this->_Opts[$fieldName] = $options;
$options['type'] = 'addon';
}
return $options;
} else {
- $type = $this->_extractOption('type', $this->__opts[$fieldName]);
+ $type = $this->_extractOption('type', $this->_Opts[$fieldName]);
$default = array('wrap' => 'span', 'class' => 'add-on');
$divOptions = array();
foreach (array('prepend', 'append') as $addon) {
- $option = (array) $this->_extractOption($addon, $options);
+ $option = (array)$this->_extractOption($addon, $options);
$$addon = null;
if ($option) {
unset($options[$addon]);
@@ -95,13 +95,13 @@ public function checkbox($fieldName, $options, $before = false) {
}
return $options;
} else {
- $label = $this->_extractOption('label', $this->__opts[$fieldName]);
+ $label = $this->_extractOption('label', $this->_Opts[$fieldName]);
if (!is_array($label)) {
$label = array('text' => $label);
}
- $after = $this->_extractOption('after', $this->__opts[$fieldName]);
+ $after = $this->_extractOption('after', $this->_Opts[$fieldName]);
- if ($this->_extractOption('div', $this->__opts[$fieldName])) {
+ if ($this->_extractOption('div', $this->_Opts[$fieldName])) {
$label['text'] = $after;
$label['class'] = null;
}
@@ -150,11 +150,9 @@ public function create($model = null, $options = array()) {
if (in_array(self::FORM_SEARCH, $class) || in_array(self::FORM_INLINE, $class)) {
$options['inputDefaults'] = Set::merge($inputDefaults, array('div' => false, 'label' => false));
- }
- elseif (in_array(self::FORM_HORIZONTAL, $class)) {
+ } elseif (in_array(self::FORM_HORIZONTAL, $class)) {
$options['inputDefaults'] = Set::merge($inputDefaults, array('div' => self::CLASS_GROUP));
- }
- else {
+ } else {
$options['inputDefaults'] = Set::merge($inputDefaults, array('div' => null));
}
@@ -187,7 +185,7 @@ public function input($fieldName, $options = array()) {
$this->_inputDefaults,
$options
);
- $this->__opts[$fieldName] = $options;
+ $this->_Opts[$fieldName] = $options;
$type = $this->_extractOption('type', $options);
$options = $this->_getType($fieldName, $options);
@@ -210,7 +208,7 @@ public function input($fieldName, $options = array()) {
}
}
- if (is_null($type) && empty($this->__opts[$fieldName]['type'])) {
+ if (is_null($type) && empty($this->_Opts[$fieldName]['type'])) {
unset($options['type']);
}
@@ -300,7 +298,7 @@ protected function _getType($fieldName, $options) {
protected function _buildAfter($options) {
$outInline = array();
- $inlines = (array) $this->_extractOption('helpInline', $options, array());
+ $inlines = (array)$this->_extractOption('helpInline', $options, array());
if ($inlines) {
unset($options['helpInline']);
}
@@ -310,7 +308,7 @@ protected function _buildAfter($options) {
$outInline = implode(' ', $outInline);
$outBlock = array();
- $blocks = (array) $this->_extractOption('helpBlock', $options, array());
+ $blocks = (array)$this->_extractOption('helpBlock', $options, array());
if ($blocks) {
unset($options['helpBlock']);
}
@@ -326,7 +324,7 @@ protected function _buildAfter($options) {
protected function _controlGroupStates($fieldName, $options) {
$div = $this->_extractOption('div', $options);
if (false !== $div) {
- $inlines = (array) $this->_extractOption('helpInline', $options, array());
+ $inlines = (array)$this->_extractOption('helpInline', $options, array());
foreach ($options as $key => $value) {
if (in_array($key, array('warning', 'success'))) {
unset($options[$key]);
@@ -75,7 +75,7 @@ public function breadcrumb($items, $options = array()) {
$count = count($items);
$li = array();
- for ($i=0; $i < $count - 1; $i++) {
+ for ($i = 0; $i < $count - 1; $i++) {
$text = $items[$i];
$text .= '&nbsp;<span class="divider">/</span>';
$li[] = parent::tag('li', $text);
@@ -77,7 +77,7 @@ public function prev($title, $options = array()) {
unset($options['title']);
$disabled = $options['disabled'];
- $params = (array) $this->params($options['model']);
+ $params = (array)$this->params($options['model']);
if ($disabled === 'hide' && !$params['prevPage']) {
return null;
}
@@ -104,7 +104,7 @@ public function next($title, $options = array()) {
unset($options['title']);
$disabled = $options['disabled'];
- $params = (array) $this->params($options['model']);
+ $params = (array)$this->params($options['model']);
if ($disabled === 'hide' && !$params['nextPage']) {
return null;
}
@@ -126,7 +126,7 @@ public function numbers($options = array()) {
$options += $default;
$modulus = $options['modulus'];
- $params = (array) $this->params($options['model']);
+ $params = (array)$this->params($options['model']);
extract($params);
if ($modulus > $pageCount) {
@@ -194,7 +194,7 @@ public function last($title, $options = array()) {
}
unset($options['title']);
- $params = (array) $this->params($options['model']);
+ $params = (array)$this->params($options['model']);
return (parent::last($title, $options)) ? (parent::last($title, $options)) : $this->Html->tag(
$options['tag'],
Oops, something went wrong.

0 comments on commit bb8e90d

Please sign in to comment.