diff --git a/CHANGELOG b/CHANGELOG
index 9bac2311f..897bfdd0a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -20,6 +20,7 @@ Version 1.0b To be released
- Added CVarDumper (Qiang)
- Added CDateParser (Qiang)
- Added CTypeValidator (Qiang)
+- Added CViewRenderer and CPradoViewRenderer (Qiang)
Version 1.0a October 5, 2008
=============================
diff --git a/framework/YiiBase.php b/framework/YiiBase.php
index f09096d43..dda910486 100644
--- a/framework/YiiBase.php
+++ b/framework/YiiBase.php
@@ -507,8 +507,8 @@ class YiiBase
'CHtml' => '/web/helpers/CHtml.php',
'CJSON' => '/web/helpers/CJSON.php',
'CJavaScript' => '/web/helpers/CJavaScript.php',
- 'CPradoViewRenderer - Copy' => '/web/renderers/CPradoViewRenderer - Copy.php',
'CPradoViewRenderer' => '/web/renderers/CPradoViewRenderer.php',
+ 'CViewRenderer' => '/web/renderers/CViewRenderer.php',
'CAutoComplete' => '/web/widgets/CAutoComplete.php',
'CCaptcha' => '/web/widgets/CCaptcha.php',
'CClipWidget' => '/web/widgets/CClipWidget.php',
diff --git a/framework/utils/CFileHelper.php b/framework/utils/CFileHelper.php
index 83db45ef1..715d7990b 100644
--- a/framework/utils/CFileHelper.php
+++ b/framework/utils/CFileHelper.php
@@ -75,20 +75,6 @@ class CFileHelper
return $list;
}
- /**
- * Creates a directory.
- * This method also creates parent directories if they do not exist.
- * @param string the directory to be created.
- */
- public static function mkdir($directory)
- {
- if(!is_dir($directory))
- {
- self::mkdir(dirname($directory));
- mkdir($directory);
- }
- }
-
/**
* Copies a directory.
* This method is mainly used by {@link copyDirectory}.
diff --git a/framework/web/CBaseController.php b/framework/web/CBaseController.php
index 1082de64d..ea167f8ff 100644
--- a/framework/web/CBaseController.php
+++ b/framework/web/CBaseController.php
@@ -193,10 +193,12 @@ abstract class CBaseController extends CComponent
* Begins recording a clip.
* This method is a shortcut to beginning {@link CClipWidget}.
* @param string the clip ID.
+ * @param array initial property values for {@link CClipWidget}.
*/
- public function beginClip($id)
+ public function beginClip($id,$properties=array())
{
- $this->beginWidget('CClipWidget',array('id'=>$id));
+ $properties['id']=$id;
+ $this->beginWidget('CClipWidget',$properties);
}
/**
@@ -251,13 +253,16 @@ abstract class CBaseController extends CComponent
/**
* Begins the rendering of content that is to be decorated by the specified view.
- * @param string the name of the view that will embed the content in. The actual view script
+ * @param string the name of the view that will be used to decorate the content. The actual view script
* is resolved via {@link getViewFile}.
+ * @param array initial property values for {@link CContentDecorator}.
* @see beginContent
+ * @see CContentDecorator
*/
- public function beginContent($view)
+ public function beginContent($view,$properties=array())
{
- $this->beginWidget('CContentDecorator',array('view'=>$view));
+ $properties['view']=$view;
+ $this->beginWidget('CContentDecorator',$properties);
}
/**
diff --git a/framework/web/helpers/CHtml.php b/framework/web/helpers/CHtml.php
index 678d2cdee..906fa622e 100644
--- a/framework/web/helpers/CHtml.php
+++ b/framework/web/helpers/CHtml.php
@@ -43,9 +43,9 @@ class CHtml
* @return string the encoded data
* @see http://www.php.net/manual/en/function.htmlspecialchars.php
*/
- public static function encode($str)
+ public static function encode($text)
{
- return htmlspecialchars($str,ENT_QUOTES,Yii::app()->charset);
+ return htmlspecialchars($text,ENT_QUOTES,Yii::app()->charset);
}
/**
@@ -73,9 +73,9 @@ class CHtml
* @param string the string to be enclosed
* @return string the CDATA tag with the enclosed content.
*/
- public static function cdata($content)
+ public static function cdata($text)
{
- return '';
+ return '';
}
/**
@@ -84,11 +84,11 @@ class CHtml
* @param string the media that this CSS should apply to.
* @return string the CSS properly enclosed
*/
- public static function css($css,$media='')
+ public static function css($text,$media='')
{
if($media!=='')
$media=' media="'.$media.'"';
- return "";
+ return "";
}
/**
@@ -97,11 +97,11 @@ class CHtml
* @param string the media that this CSS should apply to.
* @return string the CSS link.
*/
- public static function cssFile($cssFile,$media='')
+ public static function cssFile($url,$media='')
{
if($media!=='')
$media=' media="'.$media.'"';
- return '';
+ return '';
}
/**
@@ -109,9 +109,9 @@ class CHtml
* @param string the JavaScript to be enclosed
* @return string the enclosed JavaScript
*/
- public static function script($script)
+ public static function script($text)
{
- return "";
+ return "";
}
/**
@@ -119,9 +119,9 @@ class CHtml
* @param string URL for the JavaScript file
* @return string the JavaScript file tag
*/
- public static function scriptFile($scriptFile)
+ public static function scriptFile($url)
{
- return '';
+ return '';
}
/**
@@ -133,9 +133,9 @@ class CHtml
* @param array additional HTML attributes.
* @return string the generated form tag.
*/
- public static function form($url='',$method='post',$htmlOptions=array())
+ public static function form($action='',$method='post',$htmlOptions=array())
{
- $htmlOptions['action']=self::normalizeUrl($url);
+ $htmlOptions['action']=self::normalizeUrl($action);
$htmlOptions['method']=$method;
return self::tag('form',$htmlOptions,false,false);
}
@@ -151,11 +151,11 @@ class CHtml
* @see normalizeUrl
* @see clientChange
*/
- public static function link($body,$url='#',$htmlOptions=array())
+ public static function link($text,$url='#',$htmlOptions=array())
{
$htmlOptions['href']=self::normalizeUrl($url);
self::clientChange('click',$htmlOptions);
- return self::tag('a',$htmlOptions,$body);
+ return self::tag('a',$htmlOptions,$text);
}
/**
@@ -228,9 +228,9 @@ class CHtml
* @return string the generated button tag
* @see clientChange
*/
- public static function imageButton($imageUrl,$htmlOptions=array())
+ public static function imageButton($src,$htmlOptions=array())
{
- $htmlOptions['src']=$imageUrl;
+ $htmlOptions['src']=$src;
$htmlOptions['type']='image';
return self::button('submit',$htmlOptions);
}
@@ -258,9 +258,9 @@ class CHtml
* @param array additional HTML attributes.
* @return string the generated label tag
*/
- public static function label($label,$forID,$htmlOptions=array())
+ public static function label($label,$for,$htmlOptions=array())
{
- $htmlOptions['for']=$forID;
+ $htmlOptions['for']=$for;
return self::tag('label',$htmlOptions,$label);
}
@@ -399,9 +399,9 @@ class CHtml
* @see inputField
* @see listData
*/
- public static function dropDownList($name,$selection,$listData,$htmlOptions=array())
+ public static function dropDownList($name,$select,$data,$htmlOptions=array())
{
- $options="\n".self::listOptions($selection,$listData,$htmlOptions);
+ $options="\n".self::listOptions($select,$data,$htmlOptions);
self::clientChange('change',$htmlOptions);
return self::tag('select',$htmlOptions,$options);
}
@@ -418,11 +418,11 @@ class CHtml
* @see inputField
* @see listData
*/
- public static function listBox($name,$selection,$listData,$htmlOptions=array())
+ public static function listBox($name,$select,$data,$htmlOptions=array())
{
if(!isset($htmlOptions['size']))
$htmlOptions['size']=4;
- return self::dropDownList($name,$selection,$listData,$htmlOptions);
+ return self::dropDownList($name,$select,$data,$htmlOptions);
}
/**
@@ -436,14 +436,14 @@ class CHtml
* @see normalizeUrl
* @see ajax
*/
- public static function ajaxLink($body,$url,$ajaxOptions=array(),$htmlOptions=array())
+ public static function ajaxLink($text,$url,$ajaxOptions=array(),$htmlOptions=array())
{
if(!isset($htmlOptions['href']))
$htmlOptions['href']='#';
$ajaxOptions['url']=$url;
$htmlOptions['ajax']=$ajaxOptions;
self::clientChange('click',$htmlOptions);
- return self::tag('a',$htmlOptions,$body);
+ return self::tag('a',$htmlOptions,$text);
}
/**
@@ -712,10 +712,10 @@ class CHtml
* @see clientChange
* @see listData
*/
- public static function activeDropDownList($model,$attribute,$listData,$htmlOptions=array())
+ public static function activeDropDownList($model,$attribute,$data,$htmlOptions=array())
{
$selection=$model->$attribute;
- $options="\n".self::listOptions($selection,$listData,$htmlOptions);
+ $options="\n".self::listOptions($selection,$data,$htmlOptions);
self::resolveNameID($model,$attribute,$htmlOptions);
self::clientChange('change',$htmlOptions);
if($model->hasErrors($attribute))
@@ -736,11 +736,11 @@ class CHtml
* @see clientChange
* @see listData
*/
- public static function activeListBox($model,$attribute,$listData,$htmlOptions=array())
+ public static function activeListBox($model,$attribute,$data,$htmlOptions=array())
{
if(!isset($htmlOptions['size']))
$htmlOptions['size']=4;
- return self::dropDownList($model,$attribute,$listData,$htmlOptions);
+ return self::dropDownList($model,$attribute,$data,$htmlOptions);
}
/**
@@ -764,16 +764,16 @@ class CHtml
* @see CModel::getErrors
* @see errorSummaryCss
*/
- public static function errorSummary($models,$header='',$footer='')
+ public static function errorSummary($model,$header='',$footer='')
{
if($header==='')
$header='
'.Yii::t('yii#Please fix the following input errors:').'
';
$content='';
- if(!is_array($models))
- $models=array($models);
- foreach($models as $model)
+ if(!is_array($model))
+ $model=array($model);
+ foreach($model as $m)
{
- foreach($model->getErrors() as $errors)
+ foreach($m->getErrors() as $errors)
{
foreach($errors as $error)
$content.="