public function init() { if ($this->visible) { ob_start(); ob_implicit_flush(false); $cs = Yii::app()->clientScript; if ($this->cssFile === null) { $cssFile = CHtml::asset(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'portlet.css'); $cs->registerCssFile($cssFile); } else { if ($this->cssFile !== false) { $cs->registerCssFile($this->cssFile); } } echo "<div class=\"{$this->cssClass}\" style=\"width:{$this->width}\">\n"; if ($this->headerimage !== null) { echo "<div class=\"{$this->headerCssClass}\"><img src=\""; } echo XHtml::imageUrl($this->headerimage); echo "\"></div>\n"; echo "<div class=\"{$this->contentCssClass}\">\n"; $this->_openTag = ob_get_contents(); ob_clean(); } }
<?php $this->pageTitle = Yii::app()->name . ' - ' . Yii::t('LookupModule.ui', 'Lookup Names'); $this->breadcrumbs = array(Yii::t('LookupModule.ui', 'Lookup Names') => array('index'), Yii::t('ui', XHtml::labelize($model->type))); ?> <h2><?php echo Yii::t('ui', XHtml::labelize($model->type)); ?> </h2> <?php echo CHtml::link(Yii::t('LookupModule.ui', 'New'), $this->createReturnableUrl('create', array('type' => $model->type))); ?> <?php $this->widget('zii.widgets.grid.CGridView', array('id' => 'lookup-grid', 'dataProvider' => $model->search(), 'enableSorting' => false, 'columns' => array(array('name' => 'code', 'visible' => Yii::app()->user->name == 'admin'), array('header' => Yii::t('LookupModule.ui', 'Name Et'), 'name' => 'name_et'), array('header' => Yii::t('LookupModule.ui', 'Name En'), 'name' => 'name_en'), array('name' => 'position', 'visible' => Yii::app()->user->name == 'admin'), array('class' => 'CButtonColumn', 'template' => '{up} {down} {update} {delete}', 'updateButtonUrl' => '$this->grid->controller->createReturnableUrl("update",array("id"=>$data->id))', 'deleteButtonUrl' => '$this->grid->controller->createReturnableUrl("delete",array("id"=>$data->id))', 'deleteConfirmation' => Yii::t('LookupModule.ui', 'Are you sure to delete this item?'), 'buttons' => array('delete' => array('visible' => 'Yii::app()->user->name=="admin"'), 'up' => array('label' => Yii::t('LookupModule.ui', 'Move up'), 'url' => 'array("move","move"=>"up","id"=>$data->id)', 'imageUrl' => $this->getModule()->baseScriptUrl . '/images/up.png', 'click' => 'function() { $.fn.yiiGridView.update("lookup-grid", { type:"POST", url:$(this).attr("href"), success:function() { $.fn.yiiGridView.update("lookup-grid"); } }); return false; }', 'visible' => '$data->position > 1 ? true : false'), 'down' => array('label' => Yii::t('LookupModule.ui', 'Move down'), 'url' => 'array("move","move"=>"down","id"=>$data->id)', 'imageUrl' => $this->getModule()->baseScriptUrl . '/images/down.png', 'click' => 'function() { $.fn.yiiGridView.update("lookup-grid", { type:"POST", url:$(this).attr("href"), success:function() { $.fn.yiiGridView.update("lookup-grid");
<body> <div id="page"> <div id="header"> <div id="menubar"> <?php $this->widget('ext.components.language.XLangMenu', array('encodeLabel' => false, 'items' => array('et' => XHtml::imageLabel('et.png', 'Eesti', true), 'en' => XHtml::imageLabel('en.png', 'In English', true)))); ?> </div><!-- menubar --> <div id="logo"> <?php echo XHtml::imageLabel('blocks.gif', Yii::app()->name); ?> </div><!-- logo --> <div id="mainmenu"> <?php $this->widget('ptl.MainMenu'); ?> </div><!-- mainmenu --> </div><!-- header --> <?php if (empty($this->layout)) { ?> <?php
<?php echo $form->error($model,'desc_en'); ?> </div> <div class="row"><br/> <?php echo $form->labelEx($model,'desc_th'); ?><br/> <?php $this->widget('ext.widgets.xheditor.XHeditor',array( 'model'=>$model, 'modelAttribute'=>'desc_th', 'config'=>array( 'id'=>'xheditor_2', 'tools'=>'mfull', // mini, simple, mfull, full or from XHeditor::$_tools, tool names are case sensitive 'skin'=>'default', // default, nostyle, o2007blue, o2007silver, vista 'width'=>'700px', 'height'=>'300px', 'loadCSS'=>XHtml::cssUrl('editor.css'), 'upLinkUrl'=>$this->createUrl('request/uploadFile'), 'upLinkExt'=>'zip,rar,txt,pdf', 'upImgUrl'=>$this->createUrl('request/uploadFile'), 'upImgExt'=>'jpg,jpeg,gif,png', ), )); ?> <?php echo $form->error($model,'desc_th'); ?> </div> <?php $icon_list = array('new'=>'new','hot'=>'hot','update'=>'update'); ?> <div class="row" style="margin-top: 20px;vertical-align: middle;"> <?php echo $form->labelEx($model,'news_icon'); ?> <?php echo $form->dropDownList($model,'news_icon',$icon_list,array(
<?php $this->pageTitle = Yii::app()->name . ' - ' . Yii::t('ui', 'Datepicker'); $this->layout = 'leftbar'; $this->leftPortlets['ptl.WidgetMenu'] = array(); ?> <h2><?php echo Yii::t('ui', 'Datepicker'); ?> </h2> <?php $this->widget('zii.widgets.jui.CJuiDatePicker', array('name' => 'my_date', 'language' => Yii::app()->language == 'et' ? 'et' : null, 'options' => array('showAnim' => 'fold', 'showOn' => 'button', 'buttonText' => Yii::t('ui', 'Select form calendar'), 'buttonImage' => XHtml::imageUrl('calendar.png'), 'buttonImageOnly' => true), 'htmlOptions' => array('style' => 'width:80px;vertical-align:top'))); ?> <div class="tpanel"> <div class="toggle"><?php echo Yii::t('ui', 'View code'); ?> </div> <?php $this->beginWidget('CTextHighlighter', array('language' => 'PHP')); ?> $this->widget('zii.widgets.jui.CJuiDatePicker', array( 'name'=>'my_date', 'language'=>Yii::app()->language=='et' ? 'et' : null, 'options'=>array( 'showAnim'=>'fold', // 'show' (the default), 'slideDown', 'fadeIn', 'fold' 'showOn'=>'button', // 'focus', 'button', 'both' 'buttonText'=>Yii::t('ui','Select form calendar'),
<?php $this->widget('ext.widgets.xheditor.XHeditor', array('model' => $model, 'modelAttribute' => 'desc_en', 'config' => array('id' => 'xheditor_1', 'tools' => 'mfull', 'skin' => 'default', 'width' => '700px', 'height' => '300px', 'loadCSS' => XHtml::cssUrl('editor.css'), 'upLinkUrl' => $this->createUrl('request/uploadFile'), 'upLinkExt' => 'zip,rar,txt,pdf', 'upImgUrl' => $this->createUrl('request/uploadFile'), 'upImgExt' => 'jpg,jpeg,gif,png'))); ?> <?php echo $form->error($model, 'desc_en'); ?> </div> <div class="row"><br/> <?php echo $form->labelEx($model, 'desc_th'); ?> <br/> <?php $this->widget('ext.widgets.xheditor.XHeditor', array('model' => $model, 'modelAttribute' => 'desc_th', 'config' => array('id' => 'xheditor_2', 'tools' => 'mfull', 'skin' => 'default', 'width' => '700px', 'height' => '300px', 'loadCSS' => XHtml::cssUrl('editor.css'), 'upLinkUrl' => $this->createUrl('request/uploadFile'), 'upLinkExt' => 'zip,rar,txt,pdf', 'upImgUrl' => $this->createUrl('request/uploadFile'), 'upImgExt' => 'jpg,jpeg,gif,png'))); ?> <?php echo $form->error($model, 'desc_th'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'pdf_en'); ?> <br/> <?php if (!$model->isNewRecord) { echo $model->pdf_en . " "; if ($model->pdf_en) {
}, buttons : { "' . Yii::t('ui', 'Cancel') . '": function() { $(this).dialog("close"); }, "' . Yii::t('ui', 'Yes') . '": function() { $.yii.submitForm(this, targetUrl+"&command=withChildren",{}); }, "' . Yii::t('ui', 'No, delete this item only') . '": function() { $.yii.submitForm(this, targetUrl+"&command=keepChildren",{}); } } }); $("#delete-dialog").dialog("open"); return false; }'), 'deleteSimple' => array('label' => Yii::t('ui', 'Delete'), 'url' => '$this->grid->controller->createReturnableUrl("delete",array("id"=>$data->id))', 'imageUrl' => XHtml::imageUrl('delete.png'), 'visible' => 'Yii::app()->user->name=="admin" && $data->childCount==0', 'click' => 'function() { var targetUrl = $(this).attr("href"); $("#delete-dialog").dialog({ open : function(){ $(this).text("' . Yii::t('ui', 'Are you sure to delete this item?') . '"); }, buttons : { "' . Yii::t('ui', 'Cancel') . '": function() { $(this).dialog("close"); }, "' . Yii::t('ui', 'Yes') . '": function() { $.yii.submitForm(this, targetUrl+"&command=delete",{}); } } }); $("#delete-dialog").dialog("open");
<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="language" content="en" /> <link rel="stylesheet" type="text/css" href="<?php echo XHtml::cssUrl('main.css'); ?> " /> <link rel="stylesheet" type="text/css" href="<?php echo XHtml::cssUrl('form.css'); ?> " /> <?php $cs = Yii::app()->clientScript; $cs->registerCoreScript('jquery'); $cs->registerCoreScript('yii'); $cs->registerScriptFile(XHtml::jsUrl('common.js'), CClientScript::POS_HEAD); ?> <title><?php echo $this->pageTitle; ?> </title> </head> <body style="background: white;"> <div id="page" style="width: 625px"> <div id="content"> <?php echo $content; ?>
/** * DatePicker control * * @param mixed $name * @param string $date * @param mixed $dateFormat * @return boolean */ public static function datePicker($name, $date = NULL, $dateFormat = NULL, $calendarDateFormat = '%m/%d/%Y') { if ($dateFormat == NULL) { $dateFormat = 'm/d/Y'; } if ($date != NULL) { $date = date($dateFormat, strtotime($date)); } else { $date = date($dateFormat); } $html = XHtml::textField($name, $date, array('class' => 'CalendarTextbox', 'readonly' => 'readonly', 'id' => "{$name}_textbox")); $html .= XHtml::image(Yii::app()->theme->BaseUrl . "/images/ico-calendar.gif", 'calendar', array('id' => "{$name}_button", 'style' => 'cursor:pointer')); ob_start(); Yii::app()->controller->widget('application.extensions.gui.calendar.SCalendar', array('inputField' => "{$name}_textbox", 'button' => "{$name}_button", 'stylesheet' => Yii::app()->Params['calendarStyle'], 'ifFormat' => $calendarDateFormat), 1); $html .= ob_get_clean(); return $html; }
<?php $this->widget('zii.widgets.jui.CJuiSlider', array('value' => 50, 'options' => array('min' => 1, 'max' => 100, 'slide' => 'js: function(event,ui){ $("#image").width(400*ui.value/100); $("#zoom").text(ui.value+"%"); } '), 'htmlOptions' => array('style' => 'width:200px; float:left;'))); ?> <div id="zoom" style="margin-left:215px;">50%</div> <br class="clearfloat" /> <br /> <img id="image" width="200" src="<?php echo XHtml::imageUrl('marilyn-monroe.jpg'); ?> "> <div class="tpanel"> <div class="toggle"><?php echo Yii::t('ui', 'View code'); ?> </div> <?php $this->beginWidget('CTextHighlighter', array('language' => 'PHP')); ?> $this->widget('zii.widgets.jui.CJuiSlider', array( 'value'=>40, 'options'=>array( 'min'=>1,
} $granted = Yii::app()->authManager->hasItemChild($role, $name); echo '<td>' . XHtml::checkBox("{$role}[{$name}]", $granted, array('class' => 'PermissionCheckbox', 'value' => 1)) . '</td>'; } ?> </tr> <?php } ?> </table> <div class="Action"> <?php echo XHtml::submitButton('Save', array('id' => 'savePermissions')); ?> </div> <?php echo XHtml::endForm(); ?> <script> $(function(){ $('#savePermissions').click(function(){ $('.PermissionCheckbox').each(function(){ if (this.checked == false) { this.checked = true; this.value = -1; } }); }); }); </script>
$this->breadcrumbs = array(Yii::t('ui', 'Persons')); ?> <h2><?php echo Yii::t('ui', 'Manage Persons'); ?> </h2> <div class="actionBar"> <?php echo CHtml::link(Yii::t('ui', 'New'), array('create')); ?> </div> <!-- actionBar --> <?php $this->widget('zii.widgets.grid.CGridView', array('id' => 'person-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'htmlOptions' => array('style' => 'width:740px'), 'pager' => array('header' => '', 'firstPageLabel' => '<<', 'prevPageLabel' => '<', 'nextPageLabel' => '>', 'lastPageLabel' => '>>'), 'columns' => array(array('name' => 'lastname', 'type' => 'raw', 'value' => 'CHtml::link($data->lastname, $this->grid->controller->createReturnableUrl("view",array("id"=>$data->id)))'), 'firstname', 'birthyear', array('name' => 'country_id', 'value' => '$data->country->name', 'filter' => Country::model()->options), array('name' => 'eyecolor_code', 'value' => 'Lookup::item("eyecolor",$data->eyecolor_code)', 'filter' => Lookup::items('eyecolor')), array('class' => 'CLinkColumn', 'header' => Yii::t('ui', 'Email'), 'imageUrl' => XHtml::imageUrl('email.png'), 'labelExpression' => '$data->email', 'urlExpression' => '"mailto://".$data->email', 'htmlOptions' => array('style' => 'text-align:center')), array('class' => 'CButtonColumn', 'viewButtonUrl' => '$this->grid->controller->createReturnableUrl("view",array("id"=>$data->id))', 'updateButtonUrl' => '$this->grid->controller->createReturnableUrl("update",array("id"=>$data->id))', 'deleteButtonUrl' => '$this->grid->controller->createReturnableUrl("delete",array("id"=>$data->id))', 'deleteConfirmation' => Yii::t('ui', 'Are you sure to delete this item?'))))); ?> <br /> <div class="tpanel"> <div class="toggle"><?php echo Yii::t('ui', 'View code'); ?> </div> <?php $this->beginWidget('CTextHighlighter', array('language' => 'PHP')); ?> $this->widget('zii.widgets.grid.CGridView', array( 'id'=>'person-grid', 'dataProvider'=>$model->search(),
<?php $this->pageTitle = Yii::app()->name . ' - ' . Yii::t('ui', 'Form design') . ' - ' . Yii::t('ui', 'Complex dynamic rows'); $this->layout = 'leftbar'; $this->leftPortlets['ptl.ExtensionMenu'] = array(); $cs = Yii::app()->clientScript; $cs->registerScriptFile(XHtml::jsUrl('jquery.calculation.min.js'), CClientScript::POS_HEAD); $cs->registerScriptFile(XHtml::jsUrl('jquery.format.js'), CClientScript::POS_HEAD); $cs->registerScriptFile(XHtml::jsUrl('template.js'), CClientScript::POS_HEAD); // Demo objects $model = new DummyForm(); $persons = array(); ?> <h2><?php echo Yii::t('ui', 'Form design') . ' - ' . Yii::t('ui', 'Complex dynamic rows'); ?> </h2> <p><?php echo Yii::t('ui', 'Not really an extension, but simple jquery trick based on HTML layout.'); ?> </p> <div class="form" style="width: 720px"> <?php $form = $this->beginWidget('CActiveForm', array('id' => 'design-form', 'enableAjaxValidation' => false)); ?> <p><?php
/** * @return string the role name */ public function getRoleName() { return Yii::t('ui', XHtml::labelize($this->role)); }
$this->breadcrumbs = array(Yii::t('ui', 'Persons')); ?> <h2><?php echo Yii::t('ui', 'Manage Persons'); ?> </h2> <div class="actionBar"> <?php echo CHtml::link(Yii::t('ui', 'New'), array('create')); ?> </div> <!-- actionBar --> <?php $this->widget('zii.widgets.grid.CGridView', array('id' => 'person-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'htmlOptions' => array('style' => 'width:740px'), 'pager' => array('header' => '', 'firstPageLabel' => '<<', 'prevPageLabel' => '<', 'nextPageLabel' => '>', 'lastPageLabel' => '>>'), 'columns' => array(array('name' => 'lastname', 'type' => 'raw', 'value' => 'CHtml::link($data->lastname, $this->grid->controller->createReturnableUrl("view",array("id"=>$data->id)))', 'filter' => $this->widget('zii.widgets.jui.CJuiAutoComplete', array('model' => $model, 'attribute' => 'lastname', 'source' => $this->createUrl('request/suggestLastname'), 'options' => array('focus' => "js:function(event, ui) {\n\t\t\t\t\t\t\$('#" . CHtml::activeId($model, 'lastname') . "').val(ui.item.value);\n\t\t\t\t\t}")), true)), 'firstname', 'birthyear', array('name' => 'country_id', 'value' => '$data->country->name', 'filter' => Country::model()->options), array('name' => 'eyecolor_code', 'value' => 'Lookup::item("eyecolor",$data->eyecolor_code)', 'filter' => Lookup::items('eyecolor')), array('class' => 'CLinkColumn', 'header' => Yii::t('ui', 'Email'), 'imageUrl' => XHtml::imageUrl('email.png'), 'labelExpression' => '$data->email', 'urlExpression' => '"mailto://".$data->email', 'htmlOptions' => array('style' => 'text-align:center')), array('class' => 'CButtonColumn', 'viewButtonUrl' => '$this->grid->controller->createReturnableUrl("view",array("id"=>$data->id))', 'updateButtonUrl' => '$this->grid->controller->createReturnableUrl("update",array("id"=>$data->id))', 'deleteButtonUrl' => '$this->grid->controller->createReturnableUrl("delete",array("id"=>$data->id))', 'deleteConfirmation' => Yii::t('ui', 'Are you sure to delete this item?'))), 'afterAjaxUpdate' => "function(){\n\t\tjQuery('#" . CHtml::activeId($model, 'lastname') . "').autocomplete({\n\t\t\t'delay':300,\n\t\t\t'minLength':2,\n\t\t\t'source':'" . $this->createUrl('request/suggestLastname') . "',\n\t\t\t'focus':function(event, ui) {\n\t\t\t\t\$('#" . CHtml::activeId($model, 'lastname') . "').val(ui.item.value);\n\t\t\t}\n\t\t});\n\t}")); ?> <br /> <div class="tpanel"> <div class="toggle"><?php echo Yii::t('ui', 'View code'); ?> </div> <?php $this->beginWidget('CTextHighlighter', array('language' => 'PHP')); ?> $this->widget('zii.widgets.grid.CGridView', array( 'id'=>'person-grid', 'dataProvider'=>$model->search(),
$this->pageTitle = Yii::app()->name . ' - ' . Yii::t('ui', 'WYSIWYG Editor'); $this->layout = 'leftbar'; $this->leftPortlets['ptl.ExtensionMenu'] = array(); ?> <h2><?php echo Yii::t('ui', 'WYSIWYG Editor'); ?> </h2> <?php $model = Content::model()->findbyPk(1); ?> <?php $this->widget('ext.widgets.xheditor.XHeditor', array('model' => $model, 'modelAttribute' => 'content', 'config' => array('id' => 'xheditor_1', 'tools' => 'mfull', 'skin' => 'o2007blue', 'width' => '740px', 'height' => '400px', 'loadCSS' => XHtml::cssUrl('editor.css'), 'upImgUrl' => $this->createUrl('request/uploadFile'), 'upImgExt' => 'jpg,jpeg,gif,png'))); ?> <div class="tpanel"> <div class="toggle"><?php echo Yii::t('ui', 'View code'); ?> </div> <?php $this->beginWidget('CTextHighlighter', array('language' => 'PHP')); ?> $this->widget('ext.widgets.xheditor.XHeditor',array( 'model'=>$model, 'modelAttribute'=>'content',
), )); <?php $this->endWidget(); ?> </div> <br /><br /> <h3><?php echo Yii::t('ui', 'Ex 4: Icons after & show active'); ?> </h3> <?php $this->widget('ext.components.language.XLangMenu', array('encodeLabel' => false, 'hideActive' => false, 'items' => array('et' => XHtml::imageLabel('et.png', 'Eesti', true), 'en' => XHtml::imageLabel('en.png', 'In English', true)))); ?> <div class="tpanel"> <div class="toggle"><?php echo Yii::t('ui', 'View code'); ?> </div> <?php $this->beginWidget('CTextHighlighter', array('language' => 'PHP')); ?> $this->widget('ext.components.language.XLangMenu', array( 'encodeLabel'=>false, 'hideActive'=>false, 'items'=>array( 'et'=>XHtml::imageLabel('et.png','Eesti',true),
/** * Get menu items * @param integer maximum number of names to be returned * @return array for CMenu widget */ public function getMenu() { $menu = array(); $models = $this->findAll(array('select' => 'DISTINCT(type)', 'order' => 'type')); foreach ($models as $model) { $menu[] = array('label' => Yii::t('ui', XHtml::labelize($model->type)), 'url' => array('admin', 'type' => $model->type), 'visible' => $this->isTypeVisible($model->type)); } return $menu; }
<link rel="shortcut icon" type="image/x-icon" href="<?php echo XHtml::imageUrl('favicon.ico'); ?> " /> <title></title> </head> <body> <div id="container"> <header id="header"> <div class="logo left"><a href="/"><img src="<?php echo XHtml::imageUrl('logo.jpg'); ?> " /></a></div> <div class="tel left"><img src="<?php echo XHtml::imageUrl('tel.jpg'); ?> " width='228' height='28' /></div> <div class="top-right right"> <div class="top-text"><ul><li><a href="javascript:void(0)" onclick="SetHome(this, 'http://www.phemu.com/')">设为首页</a></li><li>|</li><li><a href="javascript:void(0);" onclick="addBookmark('http://www.phemu.com/','{%$lngpack.sitename%}');" >加入收藏</a></li><li>|</li><li><script type="text/javascript" src="{%$rootdir%}index.php?ac=scriptout&at=member"></script></li> <li>|</li><li style="padding-right:0;"><a href="{%find:type class=56 out=link%}">联系我们</a></li> </ul></div> <div class="search right"> <form name="infosearch" method="post" action="{%$link%}"> <input type="hidden" name="lng" value="{%$lng%}"> <input type="hidden" name="mid" value="{%$mid%}"> <span class="right"><input class="search-button" type="submit" style="border:0; cursor:pointer;" value="" name="Submit" /></span> <input id="keyword" name="keyword" type="text" style="width:170px; height:20px; line-height:20px;vertical-align:middle; color:#666; border: none; background:none; padding-left:5px; padding-top:2px;"value="请输入要搜索的信息" onfocus="if(this.value=='请输入要搜索的信息'){this.value='';this.style.color='#666'}" onblur="if(this.value==''){this.value='请输入要搜索的信息';this.style.color='#666'} "/> </form> </div>
?> <h3 style="margin-top:30px"><?php echo Yii::t('ui', 'Popup text (for xwebapp sceleton only)'); ?> </h3> <?php $this->beginWidget('CTextHighlighter', array('language' => 'PHP')); ?> echo CHtml::link( Yii::t('ui','Explain something'), array('/help/default/view','code'=>'explain_something'), array('class'=>'openhelp') ); echo XHtml::imageLink( 'hint.png', array('/help/default/view','code'=>'explain_something_else'), array('class'=>'openhelp','title'=>Yii::t('ui','Help')) ); <?php $this->endWidget(); ?> <?php echo CHtml::link(Yii::t('ui', 'Help'), array('/help/default/view', 'code' => 'explain_something'), array('class' => 'openhelp')); ?> <?php echo XHtml::imageLink('hint.png', array('/help/default/view', 'code' => 'explain_something_else'), array('class' => 'openhelp', 'title' => Yii::t('ui', 'Help')));