本文整理汇总了PHP中AdminHelper::tabularInputCkEditorBeforeDeleteItem方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminHelper::tabularInputCkEditorBeforeDeleteItem方法的具体用法?PHP AdminHelper::tabularInputCkEditorBeforeDeleteItem怎么用?PHP AdminHelper::tabularInputCkEditorBeforeDeleteItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AdminHelper
的用法示例。
在下文中一共展示了AdminHelper::tabularInputCkEditorBeforeDeleteItem方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Generates the TabularInputWidget and the javascript that drives the blocs.
*/
public function run()
{
// Preparing variables.
$layouts = array();
$layoutSelect = array();
$afterAddItem = '';
$beforeAddItem = '';
$afterInit = '';
$sortableStart = '';
$sortableStop = '';
$beforeDeleteItem = '';
$afterDeleteItem = '';
foreach (Yii::app()->params['blocs'] as $bloc) {
$modelClassName = 'Bloc' . ucfirst($bloc);
$newBlocModel = new $modelClassName();
$newBlocModel->title_anchor = true;
$newBlocModel->title_page = true;
$layouts['application.components.blocs.' . $bloc . '.views.admin'] = $newBlocModel;
$layoutSelect['application.components.blocs.' . $bloc . '.views.admin'] = Yii::t('admin', 'bloc_' . $bloc);
$afterAddItem .= Yii::app()->cms->blocs[$bloc]->afterAddItem() . "\n";
$beforeAddItem .= Yii::app()->cms->blocs[$bloc]->beforeAddItem() . "\n";
$afterInit .= Yii::app()->cms->blocs[$bloc]->afterInit() . "\n";
$sortableStart .= Yii::app()->cms->blocs[$bloc]->sortableStart() . "\n";
$sortableStop .= Yii::app()->cms->blocs[$bloc]->sortableStop() . "\n";
$beforeDeleteItem .= Yii::app()->cms->blocs[$bloc]->beforeDeleteItem() . "\n";
$afterDeleteItem .= Yii::app()->cms->blocs[$bloc]->afterDeleteItem() . "\n";
}
$renderData = array();
foreach ($this->models as $key => $models) {
if ($key !== 0) {
$renderData[$key] = $models;
}
}
// Instanciating widget.
$this->widget('application.components.widgets.TabularInput.TabularInputWidget', array('id' => $this->id, 'form' => isset($this->form) ? $this->form : null, 'models' => $this->models[0], 'layoutExpression' => "'application.components.blocs.'.lcfirst(mb_substr(get_class(\$model), 4)).'.views.admin'", 'layout' => $layouts, 'layoutSelect' => $layoutSelect, 'itemTitleExpression' => "Yii::t('admin', \$model->tableName())", 'orderAttribute' => 'rank', 'nestedWidgets' => array('{formId}-{itemId}-blocDocumentDocumentForm', '{formId}-{itemId}-blocPeoplePeopleForm', '{formId}-{itemId}-blocCitationCitationForm', '{formId}-{itemId}-blocFeatureFeatureForm'), 'renderData' => $renderData, 'sortable' => array('start' => "js:function(event, ui){\n\t\t\t\t\t" . AdminHelper::tabularInputCkEditorSortableStart() . "\n\t\t\t\t\t" . $sortableStart . "\n\t\t\t\t}", 'stop' => "js:function(event, ui){\n\t\t\t\t\t" . AdminHelper::tabularInputCkEditorSortableStop() . "\n\t\t\t\t\t" . $sortableStop . "\n\t\t\t\t}"), 'beforeDeleteItem' => "function(id, itemId){\n\t\t\t\t" . AdminHelper::tabularInputCkEditorBeforeDeleteItem() . "\n\t\t\t\t" . $beforeDeleteItem . "\n\t\t\t}", 'afterDeleteItem' => "function(id, itemId){\n\t\t\t\t" . $afterDeleteItem . "\n\t\t\t}", 'beforeAddItem' => "function(id, itemId){\n\t\t\t\t" . $beforeAddItem . "\n\t\t\t}", 'afterAddItem' => "function(id, itemId){\n\t\t\t\t" . AdminHelper::tabularInputAfterAddItemDatetimePicker() . "\n\t\t\t\t" . $afterAddItem . "\n\t\t\t}", 'afterInit' => "function(id){\n\t\t\t\t" . $afterInit . "\n\t\t\t}"));
}