Ejemplo n.º 1
0
 public function actionSite($power = false)
 {
     $model = new SiteForm();
     $model->getSetting();
     if (isset($_POST['SiteForm'])) {
         $model->attributes = $_POST['SiteForm'];
         $uploadFile = CUploadedFile::getInstance($model, 'logo');
         if ($uploadFile !== null) {
             $uploadFileName = "logo_" . time() . '.' . $uploadFile->getExtensionName();
             if (file_exists($model->logo)) {
                 unlink(Yii::app()->basePath . "/../" . $model->logo);
             }
             if (!is_dir(Yii::app()->basePath . "/../uploads/setting/site")) {
                 DxdUtil::createFolders(Yii::app()->basePath . "/../uploads/setting/site");
             }
             $model->logo = 'uploads/setting/site/' . $uploadFileName;
             $uploadFile->saveAs(Yii::app()->basePath . "/../" . $model->logo);
         }
         //			var_dump($_POST['SiteForm']);
         if ($model->saveSetting()) {
             Yii::app()->user->setFlash('success', '保存成功!');
         } else {
             Yii::app()->user->setFlash('error', '保存失败!');
         }
     }
     if (!$power) {
         $this->render('site', array('model' => $model));
     } else {
         $this->render('power', array('model' => $model));
     }
 }
Ejemplo n.º 2
0
 /**
  * 设置用户头像设置
  * @param integer $id
  */
 public function actionCropFace($id)
 {
     $model = $this->loadModel($id);
     if ($model->face == $model->defaultFace) {
         $this->redirect(array('uploadFace', 'id' => $id));
         Yii::app()->end();
     }
     if (isset($_POST['imageId_x'])) {
         Yii::import('ext.jcrop.EJCropper');
         $jcropper = new EJCropper();
         $jcropper->thumbPath = dirname($model->face) . "/thumbs";
         if (!file_exists($jcropper->thumbPath)) {
             DxdUtil::createFolders($jcropper->thumbPath);
         }
         // get the image cropping coordinates (or implement your own method)
         $coords = $jcropper->getCoordsFromPost('imageId');
         // returns the path of the cropped image, source must be an absolute path.
         $thumbnail = $jcropper->crop($model->face, $coords);
         if ($thumbnail) {
             unlink($model->face);
             $model->face = $thumbnail;
             $model->save();
         }
         $this->redirect(array('uploadFace', 'id' => $id));
     }
     $this->render('crop_face', array('model' => $model));
 }
Ejemplo n.º 3
0
 function run()
 {
     $src = $this->flashvars['src'];
     $width = $this->width . "px";
     $height = $this->height . "px";
     if (DxdUtil::endWith($src, 'flv')) {
         $type = 'video/x-flv';
     } else {
         $type = 'video/mp4';
     }
     echo "\r\n\t\t<video id='{$this->id}' class='video-js vjs-default-skin'\r\n\t\t\t  controls preload='auto' width='{$this->width}' height='{$this->height}'\r\n\t\t\t  data-setup='{}'>\r\n\t\t\t <source src='{$src}' type='{$type}' />\r\n        ";
 }
Ejemplo n.º 4
0
 public function afterSave()
 {
     $question = $this->question;
     $arrSolution = explode(',', $question->solution);
     if ($this->isCorrect) {
         if (!in_array($this->id, $arrSolution)) {
             $arrSolution[] = $this->id;
         }
     } else {
         if (in_array($this->id, $arrSolution)) {
             DxdUtil::array_remove($arrSolution, $this->id);
         }
     }
     $question->solution = implode(',', $arrSolution);
     $question->save();
 }
Ejemplo n.º 5
0
 public function beforeSave()
 {
     if (!DxdUtil::startWith($this->url, 'http://') && !DxdUtil::startWith($this->url, 'https://')) {
         $this->url = 'http://' . $this->url;
     }
     if (strpos($this->url, '.swf') === false) {
         Yii::import('ext.videolink.VideoLink');
         $video = new VideoLink();
         $result = @$video->parse($this->url);
         if ($result) {
             $this->url = $result['swf'];
             $this->source = $result['source'];
             $this->title = $result['title'];
         }
     }
     return parent::beforeSave();
 }
Ejemplo n.º 6
0
 public static function getTopItems()
 {
     $navs = Nav::model()->findAll(array('order' => 'weight asc'));
     $items = array();
     foreach ($navs as $nav) {
         $item = array();
         if (DxdUtil::startWith($nav->url, 'http://') || DxdUtil::startWith($nav->url, 'https://')) {
             $item['url'] = $nav->url;
         } else {
             $item['url'] = Yii::app()->createUrl($nav->url);
         }
         if ($nav->activeRule) {
             $item['active'] = eval($nav->activeRule);
         }
         $item['label'] = $nav->title;
         $items[] = $item;
     }
     return $items;
 }
Ejemplo n.º 7
0
 /**
  * 关注或取消关注
  * @param unknown_type $id
  */
 public function run($id)
 {
     $model = $this->controller->loadModel($id);
     if (isset($_POST['imageId_x'])) {
         Yii::import('ext.jcrop.EJCropper');
         $jcropper = new EJCropper();
         $jcropper->thumbPath = dirname($model->{$this->attribute}) . "/thumbs";
         if (!file_exists($jcropper->thumbPath)) {
             DxdUtil::createFolders($jcropper->thumbPath);
         }
         // get the image cropping coordinates (or implement your own method)
         $coords = $jcropper->getCoordsFromPost('imageId');
         // returns the path of the cropped image, source must be an absolute path.
         $thumbnail = $jcropper->crop($model->face, $coords);
         if ($thumbnail) {
             unlink($model->face);
             $model->face = $thumbnail;
             $model->save();
         }
         $this->controller->redirect($this->returnUrl);
     }
     $this->controller->render($this->cropViewFile, array('model' => $model));
 }
Ejemplo n.º 8
0
 /**
  * Displays a particular model.
  * @param integer $id the ID of the model to be displayed
  */
 public function actionEnv()
 {
     $privates = array();
     $privates['cache'] = DxdUtil::isWriteable(Yii::app()->basePath . "/../caches");
     $privates['upload'] = DxdUtil::isWriteable(Yii::app()->basePath . "/../uploads");
     $privates['asset'] = DxdUtil::isWriteable(Yii::app()->basePath . "/../assets");
     $privates['protected'] = DxdUtil::isWriteable(Yii::app()->basePath . "/../protected");
     $privates['theme'] = DxdUtil::isWriteable(Yii::app()->basePath . "/../themes");
     $privates['css'] = DxdUtil::isWriteable(Yii::app()->basePath . "/../css");
     $privates['js'] = DxdUtil::isWriteable(Yii::app()->basePath . "/../js");
     $exts = array();
     $exts['curl'] = function_exists('curl_init');
     $exts['gd'] = function_exists('gd_info');
     $exts['pdo_mysql'] = extension_loaded('pdo_mysql');
     $exts['mysqli'] = extension_loaded('mysqli');
     $exts['dom'] = extension_loaded('dom');
     $phpVersion = substr(PHP_VERSION, 0, 3) >= 5.2;
     $maxFileSize = floor(min(DxdUtil::return_bytes(ini_get('post_max_size')), DxdUtil::return_bytes(ini_get('upload_max_filesize')), DxdUtil::return_bytes(ini_get('memory_limit'))) / 1024 / 1024);
     $pass = true;
     foreach ($exts as $ext) {
         if (!$ext) {
             $pass = false;
         }
     }
     foreach ($privates as $item) {
         if (!$item) {
             $pass = false;
         }
     }
     if (!$phpVersion) {
         $pass = false;
     }
     if ($maxFileSize < 2) {
         $pass = false;
     }
     $this->render('env', array('privates' => $privates, 'exts' => $exts, 'pass' => $pass, 'phpVersion' => $phpVersion, 'maxFileSize' => $maxFileSize));
 }
Ejemplo n.º 9
0
 /**
  * 裁剪封面图页面和处理方法
  * @param integer $id 文章ID
  */
 public function actionCropFace($id)
 {
     $model = $this->loadModel($id);
     if (isset($_POST['imageId_x'])) {
         Yii::import('ext.jcrop.EJCropper');
         $jcropper = new EJCropper();
         $jcropper->thumbPath = $this->facePath;
         if (!file_exists($jcropper->thumbPath)) {
             DxdUtil::createFolders($jcropper->thumbPath);
         }
         $coords = $jcropper->getCoordsFromPost('imageId');
         $thumbnail = $jcropper->crop($model->face, $coords);
         if ($thumbnail) {
             $oldFace = $model->face;
             $model->face = $thumbnail;
             if ($model->save()) {
                 if ($model->face != $oldFace) {
                     @unlink($oldFace);
                 }
                 Yii::app()->user->setFlash('success', '更新成功');
                 $this->redirect(array('index'));
             } else {
                 Yii::app()->user->setFlash('error', '更新失败');
             }
         }
     }
     $this->render('crop_face', array('model' => $model));
 }
Ejemplo n.º 10
0
<li class="dxd-group-card-item" groupid="<?php 
echo $data->id;
?>
">
  <div class="thumbnail dxd-group-card">
  	<table style="width:100%">
  	<tr>
  	<td style="width:70px;vertical-align:top">
  		<?php 
$imgUrl = $data->face && DxdUtil::xImage($data->face, 60, 60) ? Yii::app()->baseUrl . "/" . DxdUtil::xImage($data->face, 60, 60) : "http://placehold.it/60x60";
?>
	    <?php 
$image = CHtml::image($imgUrl, 'image', array('style' => 'width:60px;height:60px;', 'class' => ' '));
echo CHtml::link($image, array('view', 'id' => $data->id));
?>
	</td>
	<td style="vertical-align:top">
	<div style="margin-bottom:5px">
	    <?php 
echo CHtml::link($data->name, array('view', 'id' => $data->id));
?>
		&nbsp;&nbsp;<span class="muted"><?php 
echo $data->memberCount;
?>
成员</span>
</div>
	    <div>
	    <?php 
echo mb_substr(strip_tags($data->introduction), 0, 50, 'utf8') . "...";
?>
	    </div>
<?php

/* @var $this NoticeController */
/* @var $data Notice */
//$model = Course::model()->with('user')->findByPk($data['courseId']);
$model = DxdUtil::type2Model($data['objectType'])->findByPk($data['objectId']);
if (!$model) {
    return false;
}
?>


	<?php 
echo $model->user->name;
?>
申请发布<?php 
echo CHtml::link($model->name, array("/" . $data['objectType'] . "/view", 'id' => $data['objectId']));
Ejemplo n.º 12
0
if ($model->file) {
    echo "已上传文件:" . $model->file->name;
}
?>
 
     	<br/><?php 
echo "最大允许上传文件" . $maxFileSize . "M";
?>
     	&nbsp;&nbsp;<?php 
echo CHtml::link('如何修改?', "http://eduwind.com/index.php?r=group/post&id=33", array('target' => '_blank'));
?>
     	-->
    
    <?php 
if ($storage == 'cloud') {
    $this->widget('ext.uploadify.MUploadify', CloudService::getInstance("uploads/uploadFile/lesson/mediaId/" . DxdUtil::randCode(32))->getUploadifySetting());
} else {
    $this->widget('ext.uploadify.MUploadify', array('name' => 'file', 'buttonText' => '选择文件', 'uploader' => $this->createUrl('lesson/uploadVideo', array('courseId' => $model->courseId)), 'auto' => true, 'onUploadSuccess' => "js:function(file, data, response) {\n\t\t\t   \t\t\t\t\tdataObj = JSON.parse(data);\n\t\t\t   \t\t\t\t\t\$('input#mediaId').val(dataObj.id);\n\t\t\t   \t\t\t\t\t\$('p#uploadFileName').html('文件“' + file.name + '”已经上传成功。<a id=\"reUpload\" href=\"javaScript:void(0)\">重新上传</a>');\n\t\t\t   \t\t\t\t\t\$('.uploadify').uploadify('settings','buttonText','再次上传');\n\t\t\t\t\t        }", 'onQueueComplete' => "js:function(queueData) {\n\t\t\t            \$('div#file').addClass('dxd-hidden');\n\t\t\t        }"));
}
echo $form->hiddenField($model, 'mediaId', array('id' => 'mediaId'));
?>
    
    <div><pre><p id="uploadFileName" class="text-center text-info">还没有选择文件</p></pre></div>
    
    </div>
    <div id="dxd-for-link" class="dxd-media-source <?php 
if ($model->mediaSource == "self") {
    echo 'dxd-hidden';
}
?>
">
Ejemplo n.º 13
0
            <?php 
if ($followDataProvider->totalItemCount > 0) {
    ?>
                <div style="margin:5px 0">
                    <span style="font-weight:bold"><?php 
    echo $followDataProvider->totalItemCount;
    ?>
 </span>
                    <?php 
    echo Yii::t('app', '人关注了这个帖子');
    ?>
                </div>
                <?php 
    foreach ($follows as $follow) {
        $img = CHtml::image(Yii::app()->baseUrl . "/" . DxdUtil::xImage($follow->user->face, 45, 45), $follow->user->name, array('style' => 'width:45px;height:45px;padding-bottom:8px;'));
        echo CHtml::link($img, $follow->user->pageUrl, array('class' => 'dxd-username', 'data-userId' => $follow->userId, 'style' => 'margin-right:5px;'));
    }
    ?>
            <?php 
}
?>
        </div>
    </div>
    </div>
</div>

<style type="text/css">
.dxd-right-col{
}
</style>
Ejemplo n.º 14
0
<div class="view">
<div class="muted lead"><?php 
echo Yii::t('app', '问题');
?>
 <?php 
echo $data->weight;
?>
</div>
<?php 
echo $data->stem;
$this->widget('booster.widgets.TbListView', array('dataProvider' => new CArrayDataProvider($data->choices), 'itemView' => '_choice_item', 'summaryText' => false));
?>
<div><?php 
echo Yii::t('app', '正确答案:');
foreach ($data->correctChoices as $item) {
    ?>
	<?php 
    echo DxdUtil::num2Alpha($item->weight) . "&nbsp;";
}
?>
</div>
<?php 
echo CHtml::link(Yii::t('app', "编辑"), array('question/update', 'id' => $data->id), array('class' => 'pull-right'));
?>
<div class="clearfix"></div>
</div>
Ejemplo n.º 15
0
		<div style="margin-bottom:20px">
		<?php 
if ($followDataProvider->totalItemCount > 0) {
    ?>
		<div style="margin:15px 0">
			<span style="font-weight:bold"><?php 
    echo $followDataProvider->totalItemCount;
    ?>
 </span>
			<?php 
    echo Yii::t('app', '人关注了这个帖子');
    ?>
		</div>
			<?php 
    foreach ($follows as $follow) {
        $img = CHtml::image(Yii::app()->baseUrl . "/" . DxdUtil::xImage($follow->user->face, 25, 25), $follow->user->name, array('style' => 'width:25px;height:25px;'));
        echo CHtml::link($img, $follow->user->pageUrl, array('class' => 'dxd-username', 'data-userId' => $follow->userId, 'style' => 'margin-right:5px;'));
    }
    ?>
		<?php 
}
?>
		</div>
	</div>
	</div>
</div>

<style type="text/css">
.dxd-right-col{
padding-top:40px;
}
Ejemplo n.º 16
0
<?php

$group = $data->group;
?>
<div class="dxd-index-post-item" style="background-color:white;padding:20px;">
	<div class="group-card pull-left">
  		<div>
		<?php 
$imgUrl = $group->face && DxdUtil::xImage($group->face, 100, 100) ? Yii::app()->baseUrl . "/" . DxdUtil::xImage($group->face, 100, 100) : "http://placehold.it/100x100";
?>
	    <?php 
$image = CHtml::image($imgUrl, 'image', array('style' => 'width: 100px;height:100px;', 'class' => 'hidden-xs'));
echo CHtml::link($image, array('/group/index/view', 'id' => $group->id));
?>
	    	</div>
	   <div class="text-center" style="margin-top:22px;">
	    	<?php 
//echo CHtml::link(mb_substr($data->name,0,32,'utf-8'),array('//course/index/view','id'=>$data->id),array('style'=>""));
?>
	   		<div style="font-size:18px"><?php 
echo CHtml::link(mb_substr($group->name, 0, 10, 'utf-8'), array('//group/index/view', 'id' => $group->id), array('style' => 'color:#555;'));
?>
</div>
	   		<!--  
	   		<div class="muted"><small>			<?php 
echo $group->memberNum;
?>
&nbsp;成员</small>
	   		</div>
	   		<div style="margin-top:15px">
	    	<?php 
Ejemplo n.º 17
0
 /**
  * 找出某一图片文件对应的所有缓存文件
  * Enter description here ...
  * @param unknown_type $fileName
  */
 public static function clearCaches($fileName)
 {
     if ($fileName) {
         $ext = DxdUtil::fileExt($fileName);
         $pattern = substr($fileName, 0, strrpos($fileName, ".")) . "_*." . $ext;
         $pattern = Yii::app()->basePath . "/../caches/" . $pattern;
         $cacheFiles = glob($pattern);
         foreach ($cacheFiles as $file) {
             if (file_exists($file)) {
                 unlink($file);
             }
         }
     }
 }
Ejemplo n.º 18
0
 /**
  * 处理人人网登录事宜
  * Enter description here ...
  * @throws CHttpException
  */
 public function actionRennAuth()
 {
     $rennService = new RennService();
     $rennClient = $rennService->getClient();
     // 处理code -- 根据code来获得token
     if (isset($_REQUEST['code'])) {
         $keys = array();
         // 获得code
         $keys['code'] = $_REQUEST['code'];
         $keys['redirect_uri'] = Yii::app()->createAbsoluteUrl('/oauth/rennAuth');
         try {
             // 根据code来获得token
             $token = $rennClient->getTokenFromTokenEndpoint('code', $keys);
         } catch (RennException $e) {
             error_log($e->getTraceAsString());
             throw new CHttpException(403, Yii::t('app', '没有得到授权,不能访问'));
             Yii::app()->end();
         }
     }
     // 获得用户接口
     $userService = $rennClient->getUserService();
     // 获得当前登录的人人用户信息
     try {
         $rennUser = $userService->getUserLogin();
     } catch (Exception $e) {
         throw new CHttpException(403, Yii::t('app', '没有得到授权,不能访问'));
         Yii::app()->end();
     }
     if (isset($rennUser)) {
         //检查是否为新用户
         //			$rrOauth = Oauth::model()->find('rrid=:rrid',array('rrid'=>$rennUser['id']));
         $userInfo = UserInfo::model()->findByAttributes(array('rennId' => $rennUser['id']));
         //如果是新用户,在站内创建一个对应用户
         if (!$userInfo) {
             $transaction = Yii::app()->db->beginTransaction();
             try {
                 $user = new User();
                 $user->email = 'RRId' . $rennUser['id'] . '@daxidao.com';
                 $user->password = DxdUtil::randCode(32);
                 $user->salt = DxdUtil::randCode(32);
                 $userSaved = $user->validate() && $user->save();
                 $userInfo = new UserInfo();
                 $userInfo->id = $user->getPrimaryKey();
                 $userInfo->email = $user->email;
                 $userInfo->name = $rennUser['name'];
                 $userInfo->addTime = time();
                 $userInfo->rennId = $rennUser['id'];
                 $userInfo->status = 'ok';
                 $userInfoSaved = $userInfo->save();
                 if (!$userSaved || !$userInfoSaved) {
                     Yii::app()->user->setFlash('error', Yii::t('app', '抱歉,创建用户失败'));
                     throw new Exception(Yii::t('app', '创建用户失败!'));
                 }
                 $transaction->commit();
             } catch (Exception $e) {
                 $transaction->rollback();
                 $this->redirect(Yii::app()->baseUrl);
                 Yii::app()->end();
             }
         }
         //站内用户登录
         /*		$identity=new UserIdentity($userInfo->email,'somepassword');
         			$identity->authenticate(true);
         
         			if($identity->errorCode===UserIdentity::ERROR_NONE)
         			{
         				//$duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days
         				Yii::app()->user->login($identity, 0);
         				//print_r(Yii::app()->user);
         			}*/
         $user = User::model()->findByAttributes(array('email' => $userInfo->email));
         $user->loginWithoutPassword();
     }
     //如果还没有填写email
     if ($userInfo->noEmail()) {
         $this->redirect(array('u/registerOauth'));
         Yii::app()->end();
     }
     Yii::app()->user->setFlash('success', Yii::t('app', '人人网登录成功!'));
     $this->redirect($this->homePage);
 }
Ejemplo n.º 19
0
<li class="col-sm-2" courseId="<?php 
echo $data->id;
?>
" style="background-color:#ececec" >
	<div class="group-card" style="margin-bottom:20px">
  		<div style="margin:10px 10px 15px 10px;">
		<?php 
$imgUrl = $data->face && DxdUtil::xImage($data->face, 150, 150) ? Yii::app()->baseUrl . "/" . DxdUtil::xImage($data->face, 150, 150) : "http://placehold.it/150x150";
?>
	    <?php 
$image = CHtml::image($imgUrl, 'image', array('style' => 'width: 150px;height:150px;', 'class' => 'hidden-xs'));
echo CHtml::link($image, array('//group/index/view', 'id' => $data->id));
?>
	    	</div>
	   <div class="text-center">
	    	<?php 
//echo CHtml::link(mb_substr($data->name,0,32,'utf-8'),array('//course/index/view','id'=>$data->id),array('style'=>""));
?>
	   		<div  style="font-size:20px"><?php 
echo CHtml::link(mb_substr($data->name, 0, 12, 'utf-8'), array('//group/index/view', 'id' => $data->id), array('style' => 'color:#555;'));
?>
</div>
	   		<div class="muted"><small>			<?php 
echo $data->memberNum;
?>
&nbsp;<?php 
echo Yii::t('app', '成员');
?>
</small>
	   		</div>
	   		<div style="margin-top:20px">
Ejemplo n.º 20
0
if ($marked && $showAnalyse) {
    ?>
<div>
<span>
<?php 
    echo Yii::t('app', '正确答案:');
    foreach ($data->correctChoices as $item) {
        ?>
	<?php 
        echo DxdUtil::num2Alpha($item->weight) . "&nbsp;";
    }
    ?>
</span>
&nbsp;&nbsp;&nbsp;&nbsp;
<?php 
    echo Yii::t('app', '您的回答');
    foreach ($response->choices as $item) {
        ?>
	<?php 
        $answer = Answer::model()->findByPk($item);
        ?>
	<?php 
        echo DxdUtil::num2Alpha($answer->weight) . "&nbsp;";
    }
    ?>
<span>

</span>
</div>
<?php 
}
Ejemplo n.º 21
0
<?php

/* @var $this LessionController */
/* @var $data Lession */
?>


<div>
	<?php 
echo CHtml::image($data->user->face && DxdUtil::xImage($data->user->face, 40, 40) ? Yii::app()->baseUrl . "/" . DxdUtil::xImage($data->user->face, 40, 40) : "http://placehold.it/40x40", 'image', array('style' => 'width:40px;height:40px;', 'class' => 'pull-left'));
?>
	<div style="margin-left:50px">
	<?php 
echo CHtml::link($data->user->name, $data->user->pageUrl);
?>
	&nbsp;&nbsp;<span class="muted">
		<?php 
echo date('Y-m-d H:i', $data->addTime);
?>
</span>
	<div>
	<?php 
echo $data->content;
?>
	</div>
	<div>
		<?php 
echo CHtml::link(Yii::t('app', '回复'), 'javascript:;', array('class' => 'muted pull-right', 'data-toggle' => 'collapse', 'data-target' => '#dxd-comment-form-' . $index));
?>
		<div class="clearfix"></div>
	</div>
Ejemplo n.º 22
0
<li class="col-sm-3" courseId="<?php 
echo $data->id;
?>
" >
<div class="course-card">
  		<?php 
$imgUrl = $data->face && DxdUtil::xImage($data->face, 270, 200) ? Yii::app()->baseUrl . "/" . DxdUtil::xImage($data->face, 270, 200) : "http://placehold.it/270x200";
?>
	    <?php 
$image = CHtml::image($imgUrl, 'image', array('style' => 'width: 270px;height:200px;', 'class' => 'hidden-xs'));
echo CHtml::link($image, array('//course/index/view', 'id' => $data->id));
?>
	    <div style="border:2px solid #eee;border-top:none;">
	    	<?php 
echo CHtml::link(mb_substr($data->name, 0, 32, 'utf-8'), array('//course/index/view', 'id' => $data->id), array('style' => "display:block;color:#333;font-size:22px;height:50px;border-bottom:2px solid #eee;padding:25px;line-height:30px;"));
?>
			<div style="padding:18px 25px">
			<div  class="pull-left">
				<?php 
if ($data->fee == 0) {
    ?>
				<strong class="orange-color"><?php 
    echo Yii::t('app', '免费');
    ?>
</strong>	
				<?php 
} else {
    ?>
					¥<strong class="orange-color"><?php 
    echo $data->fee;
    ?>
Ejemplo n.º 23
0
            <?php 
echo CHtml::link($data->group->name, array('//group/index/view', 'id' => $data->group->id));
?>
           &nbsp;&nbsp;
           <?php 
echo DxdUtil::duration2Day(time() - $data->addTime);
?>
            <?php 
if (isset($data->lastComment->user)) {
    ?>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;最后回复:
            <?php 
    echo CHtml::link($data->lastComment->user->name, $data->lastComment->user->pageUrl);
    ?>
            于<?php 
    echo DxdUtil::duration2Day(time() - $data->upTime);
    ?>
            <?php 
}
?>
            <div class="pull-right">
                <i class="icon-eye-open"></i> <?php 
echo $data->viewNum;
?>
                &nbsp;&nbsp;&nbsp;&nbsp;
                <i class="icon-comment"></i> <?php 
echo $data->commentNum;
?>
                &nbsp;&nbsp;&nbsp;&nbsp;
            </div>
        </div>
Ejemplo n.º 24
0
?>
">
<hr/>
<table style="width:100%">
<tr>
<!--
<td style="width:40px;vertical-align:top;padding-top:24px;padding-left:10px;">
<?php 
echo CHtml::ajaxLink(' ', array('vote/postcomment', 'commentId' => $data->id, 'value' => 1), array('success' => 'js:function(data){var item=$(".dxd-post-comment-item[data-commentId=' . $data->id . ']"); item.find(".dxd-post-comment-up").addClass("dxd-voted");item.find(".dxd-post-comment-vote-result").html(data);}'), array('class' => 'dxd-post-comment-up ' . ($data->voteUpNum ? "dxd-voted" : "")));
// echo CHtml::ajaxLink(' ',array('vote/postcomment','commentId'=>$data->id,'value'=>0),array('success'=>'js:function(data){var item =$(".dxd-post-comment-item[data-commentId='.$data->id.']");item.find(".dxd-post-comment-vote-result").html(data);}'),array('class'=>'dxd-post-comment-down '.($data->voteUpNum ? "dxd-voted" : "")));
?>
</td>
-->
<td style="width:60px;vertical-align:top;">
<?php 
$img = CHtml::image(Yii::app()->baseUrl . "/" . DxdUtil::xImage($data->user->face, 50, 50), "images", array('style' => 'width:50px;height:50px;'));
echo CHtml::link($img, $data->user->name, array('class' => ' dxd-username', 'data-userId' => $data->user->id));
?>
</td>
<td>
<div style="margin-bottom:5px;"><?php 
echo CHtml::link($data->user->name, array("u/index", 'id' => $data->user->id), array('class' => 'dxd-username', 'data-userId' => $data->user->id));
?>
<span class="muted">&nbsp;&nbsp;<?php 
echo date("Y-m-d H:i", $data->addTime);
?>
</span>
<?php 
// $img = CHtml::image(Yii::app()->baseUrl."/".DxdUtil::xImage($data->user->face, 25, 25),"images",array('style'=>'width:25px;height:25px;'));
//echo CHtml::link($img,$data->user->name,array('class'=>'dxd-username pull-right', 'data-userId'=>$data->user->id));
echo CHtml::ajaxLink(' ', array('comment/toggleVote', 'id' => $data->id, 'value' => 1), array('success' => 'js:function(data){var item=$(".dxd-post-comment-item[data-commentId=' . $data->id . ']"); item.find(".dxd-post-comment-up").addClass("dxd-voted");item.find(".dxd-post-comment-vote-result").html(data);}'), array('class' => 'pull-right dxd-post-comment-up ' . ($data->voteUpNum ? "dxd-voted" : "")));
Ejemplo n.º 25
0
$storage = $cloudStorageForm->storage;
?>

	<br />

	<div id="dxd-for-self"
		class="dxd-media-source <?php 
if ($model->mediaSource != "self") {
    echo 'dxd-hidden';
}
?>
">

		<?php 
if ($storage == 'cloud') {
    $cloudService = CloudService::getInstance("uploads/uploadFile/lesson/mediaId/" . DxdUtil::randCode(32));
    //	$cloudService = new CloudService();
    $this->widget('ext.uploadify.MUploadify', array('name' => 'file', 'buttonText' => '选择文件', 'auto' => true, 'uploader' => 'http://up.eduwind.com', 'formData' => array('token' => $cloudService->makeUploadToken(), 'key' => $cloudService->getKey()), 'onUploadSuccess' => "js:function(file, data, response) {\n\t\t\t   \t\t\t\t\tdataObj = JSON.parse(data);\n\t\t\t   \t\t\t\t\tif(data){\n\t\t\t  \t\t\t\t\t\t\$('#uploaded-file-{$model->id}').html('<span style=\\'text-success\\'>“' + file.name + '</span>”已经上传成功。');\n\t\t\t  \t\t\t\t\t\t\$.post('" . $this->createUrl('setMedia', array('lessonId' => $model->id)) . "',{name:file.name,mediaId:dataObj.id});\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t  \t\t\t\t\t\t\$('#uploaded-file-{$model->id}').html('<span style=\\'text-error\\'>“' + file.name + '</span>”上传失败。');\n    \t\t\t\t\t\t\t}\n\t\t\t\t\t}", 'onQueueComplete' => "js:function(queueData) {\n\t\t\t            \$('div#file').addClass('dxd-hidden');\n\t\t\t        }"));
    //    	$this->widget('ext.uploadify.MUploadify',CloudService::getInstance("uploads/uploadFile/lesson/mediaId/".DxdUtil::randCode(32))->getUploadifySetting());
    //    	CloudService::getInstance()->cloudService();
} else {
    $this->widget('ext.uploadify.MUploadify', array('name' => 'file', 'buttonText' => '选择文件', 'uploader' => $this->createUrl('upload', array('lessonId' => $model->id)), 'auto' => true, 'onUploadSuccess' => "js:function(file, data, response) {\n\t\t\t   \t\t\t\t\tif(data){\n\t\t\t  \t\t\t\t\t\t\$('#uploaded-file-{$model->id}').html('<span style=\\'text-success\\'>“' + file.name + '</span>”已经上传成功。');\n\t\t\t  \t\t\t\t\t}else{\n\t\t\t  \t\t\t\t\t\t\$('#uploaded-file-{$model->id}').html('<span style=\\'text-error\\'>“' + file.name + '</span>”上传失败。');\n    \t\t\t\t\t\t\t}\n\t\t\t\t\t        }", 'onQueueComplete' => "js:function(queueData) {\n\t\t\t            \$('div#file').addClass('dxd-hidden');\n\t\t\t        }"));
}
//	echo $form->hiddenField($model,'mediaId',array('id'=>'mediaId'));
?>
		<!-- 
    <div><pre><p id="uploadFileName" class="text-center text-info">还没有选择文件</p></pre></div>
     -->
		<br /> <em id='uploaded-file-<?php 
echo $model->id;
?>
Ejemplo n.º 26
0
 /**
  * 重设密码
  * Enter description here ...
  * @param unknown_type $resetPassword
  * @param unknown_type $email
  */
 public function actionResetPassword($resetPassword, $email)
 {
     $model = User::model()->findByAttributes(array('email' => urldecode($email), 'resetPassword' => $resetPassword));
     if (isset($_POST['User'])) {
         $model->attributes = $_POST['User'];
         $model->resetPassword = DxdUtil::randCode(32);
         if ($model->save()) {
             Yii::app()->user->setFlash('success', Yii::t('app', '密码重设成功'));
             $this->redirect('login');
         } else {
             Yii::app()->user->setFlash('error', Yii::t('app', '抱歉,密码重设失败!'));
         }
     }
     $this->render('resetPassword', array('model' => $model));
 }
<?php

$this->pageTitle = Yii::app()->name . "-{$course->name}";
?>
<div class="dxd-course-header">	
	<div class="dxd-course-nav" style="border-top:none;padding-top:15px;padding-bottom:15px;">
		
		<div class="dxd-course-header-left1">
		
		<?php 
$imgUrl = $course->face && DxdUtil::xImage($course->face, 350, 260) ? Yii::app()->baseUrl . "/" . DxdUtil::xImage($course->face, 350, 260) : "http://placehold.it/350x260";
?>
		<?php 
echo CHtml::image($imgUrl, 'image', array('class' => 'pull-left', 'style' => 'width:350px;height:260px;'));
?>
		</div>
		<div class="dxd-course-header-left2" style="text-align:center;padding:20px 20px 0 20px;">
			<?php 
// echo $this->renderPartial('_topic', array('course'=>$course));
?>

			
			<h1 ><?php 
echo $course->name;
?>
</h1>
			<p style="font-size:18px;margin:15px;"><?php 
echo $course->subTitle;
?>
</p>
			<div>
Ejemplo n.º 28
0
<div class="row">
	<div style="border:1px solid #ccc;" class="col-sm-12">
	<div style="padding:15px">
		<div class="pull-left">
			<?php 
echo CHtml::image(Yii::app()->baseUrl . "/" . DxdUtil::xImage($user->face, 120, 120), $user->name, array('class' => 'pull-left', 'style' => "margin-right:20px"));
?>
			<div class="pull-left">
				<h2><?php 
echo $user->name;
?>
	</h2>
				<p class="dxd-break-word dxd-self-introduction" style="margin-top:20px;font-size:1.5em;"><?php 
echo $user->bio;
?>
</p>
			</div>
			<div class="clearfix"></div>
		</div>
	<div class="pull-right">
		<?php 
/*$this->widget('booster.widgets.TbButton', array(
    'label'=>'<i class="icon-envelope"></i>'.Yii::t('app','发私信'),
//	'url'=>'javascript:openFancyBox("'.Yii::app()->createUrl('message/create',array('toUserId'=>$user->id)).'");',
   'url'=>array('message/create','toUserId'=>$user->id),
	'htmlOptions'=>array('style'=>'margin:0 5px;','class'=>"dxd-message-btn",'onclick'=>'openFancyBox(this);return false;'),
     'encodeLabel'=>false,
	));*/
echo CHtml::link(Yii::t('app', '发私信'), array('message/create', 'toUserId' => $user->id), array('onclick' => 'openFancyBox(this);return false;', 'class' => 'btn btn-default dxd-message-btn'));
?>
	<?php 
Ejemplo n.º 29
0
<div style="margin-bottom:15px"> 
<div class="pull-left">
	<?php 
$img = CHtml::image(Yii::app()->baseUrl . "/" . DxdUtil::xImage($data->face, 40, 40), $data->name, array('style' => 'width:40px;height:40px;'));
echo CHtml::link($img, $data->pageUrl, array('class' => 'dxd-username', 'data-userId' => $data->id), array('style' => 'display:block;width:40px;height:50px;'));
?>
</div>
<div style="line-height:16px;margin-left:50px;">
<?php 
echo CHtml::link($data->name, $data->pageUrl, array('class' => 'dxd-username', 'data-userId' => $data->id, 'style' => 'margin-top:5px;'));
?>
<div class="pull-right muted">
<?php 
echo date('m-d H:i', $data->addTime);
?>
</div>
	<div style="margin-top: 8px">
	<?php 
echo $data->bio;
?>
	</div>
</div>
<div class="clearfix"></div>
</div>
Ejemplo n.º 30
0
 public function actionOrder($categoryId)
 {
     if (isset($_POST['order'])) {
         $ids = explode(",", $_POST['order']);
         for ($i = 0; $i < count($ids); $i++) {
             if (DxdUtil::startWith($ids[$i], 'page-')) {
                 $id = substr($ids[$i], 5);
                 $model = $this->loadModel($id);
                 //$model->updateByPk( $id,array("weight"=>$i+1));
                 $model->weight = $i + 1;
                 $model->save();
             }
         }
     }
 }