/**
  * This is the default 'index' action that is invoked
  * when an action is not explicitly requested by users.
  */
 public function actionIndex($tab = 'new')
 {
     // renders the view file 'protected/views/site/index.php'
     // using the default layout 'protected/views/layouts/main.php'
     //$this->layout='//layouts/mainindex';
     $model = new ScriptForm();
     $count = $model->getCountAllScripts('');
     if (isset($_GET['page'])) {
         $page = $_GET['page'];
     } else {
         $page = 1;
     }
     $limit = 10;
     $start = ((int) $page - 1) * $limit;
     $pages = new CPagination($count);
     $pages->pageSize = $limit;
     $data = $model->getAllScripts('', $start, $limit, $tab);
     $this->render('index', array('data' => $data, 'pages' => $pages, 'count' => $count, 'tab' => $tab));
 }
 public function InsertTags($scriptid, $tags)
 {
     //$tags = trim($tags);
     ScriptForm::model()->InsertTags($scriptid, $tags);
 }
 public function actionTags()
 {
     $model = new ScriptForm();
     $rows = $model->getAllTags();
     $this->render('tags', array('rows' => $rows));
 }
 public function actionFavorites()
 {
     $scripts = new ScriptForm();
     $scripts->memberid = Yii::app()->user->id;
     $records = $scripts->getScriptFav(Yii::app()->user->id);
     $this->render('fav', array('model' => $scripts, 'records' => $records));
 }
示例#5
0
echo CHtml::submitButton('search');
?>

</form>
</li>
</ul>
</div>

</div> <!-- end top menu -->

<div class="clear"> </div>

<div id="bottommenu">

<?php 
$catlist = ScriptForm::getCategoryList();
$list = CHtml::listData($catlist, 'catlistid', 'catlistname');
?>

<ul>
<?php 
foreach ($list as $listitem) {
    ?>

<li><?php 
    echo CHtml::Link($listitem, $this->createUrl("script/list", array('cat' => $listitem)));
    ?>
</li>


<?php