public function actionTree()
 {
     $id = Yii::app()->request->getParam("id", 0);
     if (!empty($id)) {
         $images = CatGallery::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("catalog=:catalog AND item_id=:item_id")->setParams(array(":catalog" => "catalog_gardens_tree", ":item_id" => $id))->setLimit(10));
         $tree = CatalogGardensTree::fetch($id);
         $this->render("usertree", array("images" => $images, "tree" => $tree));
     }
 }
 public function actionUserProfile()
 {
     $user_id = (int) Yii::app()->request->getParam("id", 0);
     if (!empty($user_id)) {
         $user = CatalogUsers::fetch($user_id);
         if ($user->id > 0) {
             Yii::app()->page->title = Yii::t("user", "Профиль");
             $user_tree = CatalogGardensTree::findByAttributes(array("user_id" => $user->id));
             $this->render('user_profile', array("user" => $user, "user_tree" => $user_tree));
         }
     }
 }
Example #3
0
        ?>
</div>
        <div class="GGardens">
        <?php 
        $listCardens = CatalogGardens::findByAttributes(array("country" => $country->id));
        foreach ($listCardens as $garden) {
            ?>
                <div class="GGTitle"><?php 
            echo $garden->name;
            ?>
</div>
                    <div class="GPlaces">
                        <?php 
            $lisPlaces = CatalogGardensPlaces::findByAttributes(array("garden_id" => $garden->id));
            foreach ($lisPlaces as $place) {
                $countTree = CatalogGardensTree::count(DBQueryParamsClass::CreateParams()->setConditions("place_id=:place_id")->setParams(array(":place_id" => $place->id)));
                $countImages = CatGallery::count(DBQueryParamsClass::CreateParams()->setConditions("catalog=:catalog AND item_id=:item_id")->setParams(array(":catalog" => "catalog_gardens_places", ":item_id" => $place->id)));
                ?>
                                <div clas="GPItems<?php 
                if ($id > 0 && $id == $place->id) {
                    ?>
 GPSel<?php 
                }
                ?>
"><a href="<?php 
                echo SiteHelper::createUrl("/gallery/index", array("id" => $place->id));
                ?>
" title="<?php 
                echo $country->name;
                ?>
, <?php