public function run()
 {
     // Parameters
     $cid = $_REQUEST['q'];
     if (isset($cid)) {
         $categoryHierarchy = CategoryUtils::getCategoryHierarchy($cid);
         $result["result"] = 0;
         $result["categories"] = $categoryHierarchy;
     } else {
         $result["result"] = -1;
         $result["message"] = Yii::t('category', 'No cid set');
     }
     echo CJSON::encode($result);
     exit(0);
     // To avoid loggers append things to request
 }
Esempio n. 2
0
////foreach($category->useres as $v) {
////    print_r("<br/>".$v);
////}
//echo "</p>";
?>

<?php 
//$location = Location::model()->findByPk(1);
SampleHierarchyWidget::$view = 'application.components.widgets.hierarchy.views.nestedSelects';
$this->widget('SampleHierarchyWidget', array('name' => 'Juanito', 'selectedId' => 10));
$location = Location::model()->findByPk(1);
$this->widget('SampleHierarchyWidget', array('id' => 'juan', 'model' => $location, 'attribute' => 'zid'));
?>

<hr/>

<pre>
<?php 
print_r(CategoryUtils::getCategoryHierarchy(20));
?>
</pre>

asdfasdffsd
<?php 
$this->widget('application.components.widgets.popup.Popup', array());
?>
pepepasdfasdf
<?php 
$this->widget('application.components.widgets.popup.Popup', array('id' => 'Manolo'));
?>
asdfasdfasddfsfd
Esempio n. 3
0
 public function afterDelete()
 {
     CategoryUtils::unlinkCategories($this->getOwner());
 }