admin.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. /**
  3. * The following variables are available in this template:
  4. * - $this: the CrudCode object
  5. */
  6. ?>
  7. <?php echo "<?php\n"; ?>
  8. /* @var $this <?php echo $this->getControllerClass(); ?> */
  9. /* @var $model <?php echo $this->getModelClass(); ?> */
  10. <?php
  11. $label=$this->pluralize($this->class2name($this->modelClass));
  12. echo "\$this->breadcrumbs=array(
  13. '$label'=>array('index'),
  14. 'Manage',
  15. );\n";
  16. ?>
  17. $this->menu=array(
  18. array('label'=>'List <?php echo $this->modelClass; ?>', 'url'=>array('index')),
  19. array('label'=>'Create <?php echo $this->modelClass; ?>', 'url'=>array('create')),
  20. );
  21. Yii::app()->clientScript->registerScript('search', "
  22. $('.search-button').click(function(){
  23. $('.search-form').toggle();
  24. return false;
  25. });
  26. $('.search-form form').submit(function(){
  27. $('#<?php echo $this->class2id($this->modelClass); ?>-grid').yiiGridView('update', {
  28. data: $(this).serialize()
  29. });
  30. return false;
  31. });
  32. ");
  33. ?>
  34. <h1>Manage <?php echo $this->pluralize($this->class2name($this->modelClass)); ?></h1>
  35. <p>
  36. You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
  37. or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
  38. </p>
  39. <?php echo "<?php echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?>"; ?>
  40. <div class="search-form" style="display:none">
  41. <?php echo "<?php \$this->renderPartial('_search',array(
  42. 'model'=>\$model,
  43. )); ?>\n"; ?>
  44. </div><!-- search-form -->
  45. <?php echo "<?php"; ?> $this->widget('zii.widgets.grid.CGridView', array(
  46. 'id'=>'<?php echo $this->class2id($this->modelClass); ?>-grid',
  47. 'dataProvider'=>$model->search(),
  48. 'filter'=>$model,
  49. 'columns'=>array(
  50. <?php
  51. $count=0;
  52. foreach($this->tableSchema->columns as $column)
  53. {
  54. if(++$count==7)
  55. echo "\t\t/*\n";
  56. echo "\t\t'".$column->name."',\n";
  57. }
  58. if($count>=7)
  59. echo "\t\t*/\n";
  60. ?>
  61. array(
  62. 'class'=>'CButtonColumn',
  63. ),
  64. ),
  65. )); ?>