Updated deprecated references

Str::evalHtmlId -> October\Rain\Html\Helper::nameToId
Str::evalHtmlArray -> October\Rain\Html\Helper::nameToArray
Str::stripHtml -> October\Rain\Html\Helper::strip
Str::limitHtml -> October\Rain\Html\Helper::limit
Str::cleanHtml -> October\Rain\Html\Helper::clean
This commit is contained in:
Samuel Georges 2015-03-07 12:48:39 +11:00
parent 8c41bc181e
commit 668457b4e6
7 changed files with 25 additions and 24 deletions

View File

@ -1,10 +1,10 @@
<?php namespace Backend\Classes;
use Str;
use Lang;
use ApplicationException;
use October\Rain\Extension\ExtensionBase;
use System\Traits\ViewMaker;
use October\Rain\Html\Helper as HtmlHelper;
/**
* Controller Behavior base class
@ -87,7 +87,7 @@ class ControllerBehavior extends ExtensionBase
/*
* Array field name, eg: field[key][key2][key3]
*/
$keyParts = Str::evalHtmlArray($name);
$keyParts = HtmlHelper::nameToArray($name);
/*
* First part will be the field name, pop it off

View File

@ -1,6 +1,6 @@
<?php namespace Backend\Classes;
use Str;
use October\Rain\Html\Helper as HtmlHelper;
/**
* Filter scope definition
@ -159,6 +159,6 @@ class FilterScope
$id = $this->idPrefix . '-' . $id;
}
return Str::evalHtmlId($id);
return HtmlHelper::nameToId($id);
}
}

View File

@ -1,8 +1,8 @@
<?php namespace Backend\Classes;
use Str;
use Html;
use Model;
use October\Rain\Html\Helper as HtmlHelper;
/**
* Form Field definition
@ -410,7 +410,7 @@ class FormField
return $attributes;
if ($this->arrayName) {
$fullTriggerField = $this->arrayName.'['.implode('][', Str::evalHtmlArray($triggerField)).']';
$fullTriggerField = $this->arrayName.'['.implode('][', HtmlHelper::nameToArray($triggerField)).']';
}
else {
$fullTriggerField = $triggerField;
@ -446,7 +446,7 @@ class FormField
$presetType = array_get($this->preset, 'type');
if ($this->arrayName) {
$fullPresetField = $this->arrayName.'['.implode('][', Str::evalHtmlArray($presetField)).']';
$fullPresetField = $this->arrayName.'['.implode('][', HtmlHelper::nameToArray($presetField)).']';
}
else {
$fullPresetField = $presetField;
@ -478,7 +478,7 @@ class FormField
}
if ($arrayName) {
return $arrayName.'['.implode('][', Str::evalHtmlArray($this->fieldName)).']';
return $arrayName.'['.implode('][', HtmlHelper::nameToArray($this->fieldName)).']';
}
else {
return $this->fieldName;
@ -505,7 +505,7 @@ class FormField
$id = $this->idPrefix . '-' . $id;
}
return Str::evalHtmlId($id);
return HtmlHelper::nameToId($id);
}
/**
@ -521,7 +521,7 @@ class FormField
/*
* Array field name, eg: field[key][key2][key3]
*/
$keyParts = Str::evalHtmlArray($fieldName);
$keyParts = HtmlHelper::nameToArray($fieldName);
$lastField = end($keyParts);
$result = $data;

View File

@ -1,6 +1,6 @@
<?php namespace Backend\Classes;
use Str;
use October\Rain\Html\Helper as HtmlHelper;
/**
* Form Widget base class
@ -93,7 +93,7 @@ abstract class FormWidgetBase extends WidgetBase
{
$id = parent::getId($suffix);
$id .= '-' . $this->fieldName;
return Str::evalHtmlId($id);
return HtmlHelper::nameToId($id);
}
/**
@ -125,7 +125,7 @@ abstract class FormWidgetBase extends WidgetBase
*/
public function resolveModelAttribute($attribute)
{
$parts = Str::evalHtmlArray($attribute);
$parts = HtmlHelper::nameToArray($attribute);
return $this->model->resolveAttribute($parts);
}

View File

@ -2,8 +2,9 @@
use Str;
use File;
use stdClass;
use Session;
use October\Rain\Html\Helper as HtmlHelper;
use stdClass;
/**
* Widget base class.
@ -154,7 +155,7 @@ abstract class WidgetBase
$id .= '-' . $suffix;
}
return Str::evalHtmlId($id);
return HtmlHelper::nameToId($id);
}
/**
@ -178,7 +179,7 @@ abstract class WidgetBase
/*
* Array field name, eg: field[key][key2][key3]
*/
$keyParts = Str::evalHtmlArray($name);
$keyParts = HtmlHelper::nameToArray($name);
/*
* First part will be the field name, pop it off

View File

@ -1,7 +1,6 @@
<?php namespace Backend\Widgets;
use App;
use Str;
use Lang;
use Input;
use Event;
@ -13,6 +12,7 @@ use Backend\Classes\WidgetManager;
use ApplicationException;
use Backend\Classes\FormWidgetBase;
use October\Rain\Database\Model;
use October\Rain\Html\Helper as HtmlHelper;
/**
* Form Widget
@ -677,7 +677,7 @@ class Form extends WidgetBase
}
$widgetConfig = $this->makeConfig($field->config);
$widgetConfig->alias = $this->alias . studly_case(Str::evalHtmlId($field->fieldName));
$widgetConfig->alias = $this->alias . studly_case(HtmlHelper::nameToId($field->fieldName));
$widgetConfig->sessionKey = $this->getSessionKey();
$widgetConfig->previewMode = $this->previewMode;
$widgetConfig->model = $this->model;
@ -833,7 +833,7 @@ class Form extends WidgetBase
/*
* Handle HTML array, eg: item[key][another]
*/
$parts = Str::evalHtmlArray($field->fieldName);
$parts = HtmlHelper::nameToArray($field->fieldName);
$dotted = implode('.', $parts);
if (($value = array_get($data, $dotted)) !== null) {
$value = !strlen(trim($value)) ? null : (float) $value;
@ -845,7 +845,7 @@ class Form extends WidgetBase
* Give widgets an opportunity to process the data.
*/
foreach ($this->formWidgets as $field => $widget) {
$parts = Str::evalHtmlArray($field);
$parts = HtmlHelper::nameToArray($field);
$dotted = implode('.', $parts);
$widgetValue = $widget->getSaveValue(array_get($data, $dotted));
@ -865,7 +865,7 @@ class Form extends WidgetBase
/*
* Get the value, remove it from the data collection
*/
$parts = Str::evalHtmlArray($field->fieldName);
$parts = HtmlHelper::nameToArray($field->fieldName);
$dotted = implode('.', $parts);
$value = array_get($data, $dotted);
array_forget($data, $dotted);
@ -873,7 +873,7 @@ class Form extends WidgetBase
/*
* Set the new value to the data collection
*/
$parts = Str::evalHtmlArray($field->valueFrom);
$parts = HtmlHelper::nameToArray($field->valueFrom);
$dotted = implode('.', $parts);
array_set($remappedFields, $dotted, $value);
}

View File

@ -2,7 +2,6 @@
use Db;
use HTML as Html;
use Str;
use App;
use Lang;
use Input;
@ -10,6 +9,7 @@ use Event;
use Backend;
use DbDongle;
use Carbon\Carbon;
use October\Rain\Html\Helper as HtmlHelper;
use October\Rain\Router\Helper as RouterHelper;
use Backend\Classes\ListColumn;
use Backend\Classes\WidgetBase;
@ -736,7 +736,7 @@ class Lists extends WidgetBase
* Handle taking value from model attribute.
*/
elseif ($column->valueFrom) {
$keyParts = Str::evalHtmlArray($column->valueFrom);
$keyParts = HtmlHelper::nameToArray($column->valueFrom);
$value = $record;
foreach ($keyParts as $key) {
$value = $value->{$key};