Skip to content

Instantly share code, notes, and snippets.

@Jalle19
Created August 15, 2012 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jalle19/3360371 to your computer and use it in GitHub Desktop.
Save Jalle19/3360371 to your computer and use it in GitHub Desktop.
CListView patch
# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: C:\wamp\www\nsm
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
Index: framework/zii/widgets/CListView.php
--- framework/zii/widgets/CListView.php Base (BASE)
+++ framework/zii/widgets/CListView.php Locally Modified (Based On LOCAL)
@@ -191,34 +191,33 @@
*/
public function registerClientScript()
{
- $id=$this->getId();
-
- if($this->ajaxUpdate===false)
- $ajaxUpdate=array();
- else
+ if($this->ajaxUpdate!==false)
+ {
+ $id=$this->getId();
$ajaxUpdate=array_unique(preg_split('/\s*,\s*/',$this->ajaxUpdate.','.$id,-1,PREG_SPLIT_NO_EMPTY));
- $options=array(
- 'ajaxUpdate'=>$ajaxUpdate,
- 'ajaxVar'=>$this->ajaxVar,
- 'pagerClass'=>$this->pagerCssClass,
- 'loadingClass'=>$this->loadingCssClass,
- 'sorterClass'=>$this->sorterCssClass,
- );
- if($this->ajaxUrl!==null)
- $options['url']=CHtml::normalizeUrl($this->ajaxUrl);
- if($this->updateSelector!==null)
- $options['updateSelector']=$this->updateSelector;
- if($this->beforeAjaxUpdate!==null)
- $options['beforeAjaxUpdate']=(strpos($this->beforeAjaxUpdate,'js:')!==0 ? 'js:' : '').$this->beforeAjaxUpdate;
- if($this->afterAjaxUpdate!==null)
- $options['afterAjaxUpdate']=(strpos($this->afterAjaxUpdate,'js:')!==0 ? 'js:' : '').$this->afterAjaxUpdate;
+ $options=array(
+ 'ajaxUpdate'=>$ajaxUpdate,
+ 'ajaxVar'=>$this->ajaxVar,
+ 'pagerClass'=>$this->pagerCssClass,
+ 'loadingClass'=>$this->loadingCssClass,
+ 'sorterClass'=>$this->sorterCssClass,
+ );
+ if($this->ajaxUrl!==null)
+ $options['url']=CHtml::normalizeUrl($this->ajaxUrl);
+ if($this->updateSelector!==null)
+ $options['updateSelector']=$this->updateSelector;
+ if($this->beforeAjaxUpdate!==null)
+ $options['beforeAjaxUpdate']=(strpos($this->beforeAjaxUpdate,'js:')!==0 ? 'js:' : '').$this->beforeAjaxUpdate;
+ if($this->afterAjaxUpdate!==null)
+ $options['afterAjaxUpdate']=(strpos($this->afterAjaxUpdate,'js:')!==0 ? 'js:' : '').$this->afterAjaxUpdate;
- $options=CJavaScript::encode($options);
- $cs=Yii::app()->getClientScript();
- $cs->registerCoreScript('jquery');
- $cs->registerCoreScript('bbq');
- $cs->registerScriptFile($this->baseScriptUrl.'/jquery.yiilistview.js',CClientScript::POS_END);
- $cs->registerScript(__CLASS__.'#'.$id,"jQuery('#$id').yiiListView($options);");
+ $options=CJavaScript::encode($options);
+ $cs=Yii::app()->getClientScript();
+ $cs->registerCoreScript('jquery');
+ $cs->registerCoreScript('bbq');
+ $cs->registerScriptFile($this->baseScriptUrl.'/jquery.yiilistview.js',CClientScript::POS_END);
+ $cs->registerScript(__CLASS__.'#'.$id,"jQuery('#$id').yiiListView($options);");
+ }
}
/**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment