Beispiel #1
0
 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();
     }
 }
Beispiel #2
0
   <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>
$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' => '&lt;&lt;', 'prevPageLabel' => '&lt;', 'nextPageLabel' => '&gt;', 'lastPageLabel' => '&gt;&gt;'), '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(),
Beispiel #4
0
<?php

if (!Yii::app()->request->isAjaxRequest) {
    $cs = Yii::app()->clientScript;
    $cs->registerCoreScript('jquery');
    $cs->registerCoreScript('yii');
    $cs->registerScriptFile(XHtml::jsUrl('common.js'), CClientScript::POS_HEAD);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="language" content="en" />
<link rel="shortcut icon" href="<?php 
echo XHtml::imageUrl('favicon.ico');
?>
" />
<link rel="stylesheet" type="text/css" href="<?php 
echo XHtml::cssUrl('960.css');
?>
" />
<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

$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('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,
Beispiel #7
0
$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' => '&lt;&lt;', 'prevPageLabel' => '&lt;', 'nextPageLabel' => '&gt;', 'lastPageLabel' => '&gt;&gt;'), '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(),
							},
							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");