コード例 #1
0
ファイル: d2Upload.php プロジェクト: dbrisinajumi/d2files
 private function loadFilesType()
 {
     $files_types = D2filesType::model()->findAll(array('condition' => 'model = "' . $this->model_name . '"', 'limit' => 1000));
     $t_listData = array();
     foreach ($files_types as $ft) {
         $t_listData[$ft['id']] = Yii::t('d2files', $ft['type']);
     }
     return $t_listData;
 }
コード例 #2
0
ファイル: admin.php プロジェクト: dbrisinajumi/d2files
?>

<?php 
$this->widget("TbBreadcrumbs", array("links" => $this->breadcrumbs));
?>
<div class="clearfix">
    <div class="btn-toolbar pull-left">
        <div class="btn-group">
        <?php 
$this->widget('bootstrap.widgets.TbButton', array('label' => Yii::t('D2filesModule.crud_static', 'Create'), 'icon' => 'icon-plus', 'size' => 'large', 'type' => 'success', 'url' => array('create'), 'visible' => Yii::app()->user->checkAccess('D2files.D2files.*') || Yii::app()->user->checkAccess('D2files.D2files.Create')));
?>
</div>
        <div class="btn-group">
            <h1>
                <i class=""></i>
                <?php 
echo Yii::t('D2filesModule.model', 'D2files');
?>
            </h1>
        </div>
    </div>
</div>

<?php 
Yii::beginProfile('D2files.view.grid');
?>


<?php 
$this->widget('TbGridView', array('id' => 'd2files-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'template' => '{summary}{pager}{items}{pager}', 'pager' => array('class' => 'TbPager', 'displayFirstAndLast' => true), 'columns' => array(array('class' => 'CLinkColumn', 'header' => '', 'labelExpression' => '$data->itemLabel', 'urlExpression' => 'Yii::app()->controller->createUrl("view", array("id" => $data["id"]))'), array('class' => 'editable.EditableColumn', 'name' => 'id', 'editable' => array('url' => $this->createUrl('/d2files/d2files/editableSaver')), 'htmlOptions' => array('class' => 'numeric-column')), array('class' => 'editable.EditableColumn', 'name' => 'type_id', 'editable' => array('type' => 'select', 'url' => $this->createUrl('/d2files/d2files/editableSaver'), 'source' => CHtml::listData(D2filesType::model()->findAll(array('limit' => 1000)), 'id', 'itemLabel'))), array('class' => 'editable.EditableColumn', 'name' => 'file_name', 'editable' => array('url' => $this->createUrl('/d2files/d2files/editableSaver'))), array('class' => 'editable.EditableColumn', 'name' => 'upload_path', 'editable' => array('type' => 'textarea', 'url' => $this->createUrl('/d2files/d2files/editableSaver'))), array('class' => 'editable.EditableColumn', 'name' => 'add_datetime', 'editable' => array('type' => 'datetime', 'url' => $this->createUrl('/d2files/d2files/editableSaver'))), array('class' => 'editable.EditableColumn', 'name' => 'user_id', 'editable' => array('url' => $this->createUrl('/d2files/d2files/editableSaver')), 'htmlOptions' => array('class' => 'numeric-column')), array('class' => 'editable.EditableColumn', 'name' => 'deleted', 'editable' => array('url' => $this->createUrl('/d2files/d2files/editableSaver')), 'htmlOptions' => array('class' => 'numeric-column')), array('class' => 'editable.EditableColumn', 'name' => 'notes', 'editable' => array('type' => 'textarea', 'url' => $this->createUrl('/d2files/d2files/editableSaver'))), array('class' => 'TbButtonColumn', 'buttons' => array('view' => array('visible' => 'Yii::app()->user->checkAccess("D2files.D2files.View")'), 'update' => array('visible' => 'FALSE'), 'delete' => array('visible' => 'Yii::app()->user->checkAccess("D2files.D2files.Delete")')), 'viewButtonUrl' => 'Yii::app()->controller->createUrl("view", array("id" => $data->id))', 'deleteButtonUrl' => 'Yii::app()->controller->createUrl("delete", array("id" => $data->id))', 'deleteConfirmation' => Yii::t('D2filesModule.crud_static', 'Do you want to delete this item?'), 'viewButtonOptions' => array('data-toggle' => 'tooltip'), 'deleteButtonOptions' => array('data-toggle' => 'tooltip')))));
Yii::endProfile('D2files.view.grid');
コード例 #3
0
ファイル: view.php プロジェクト: dbrisinajumi/d2files
        </div>
    </div>
</div>



<div class="row">
    <div class="span12">
        <h2>
            <?php 
echo Yii::t('D2filesModule.crud_static', 'Data');
?>
            <small>
                #<?php 
echo $model->id;
?>
            </small>
        </h2>

        <?php 
$this->widget('TbDetailView', array('data' => $model, 'attributes' => array(array('name' => 'id', 'type' => 'raw', 'value' => $this->widget('EditableField', array('model' => $model, 'attribute' => 'id', 'url' => $this->createUrl('/d2files/d2files/editableSaver')), true)), array('name' => 'type_id', 'type' => 'raw', 'value' => $this->widget('EditableField', array('model' => $model, 'type' => 'select', 'url' => $this->createUrl('/d2files/d2files/editableSaver'), 'source' => CHtml::listData(D2filesType::model()->findAll(array('limit' => 1000)), 'id', 'itemLabel'), 'attribute' => 'type_id'), true)), array('name' => 'file_name', 'type' => 'raw', 'value' => $this->widget('EditableField', array('model' => $model, 'attribute' => 'file_name', 'url' => $this->createUrl('/d2files/d2files/editableSaver')), true)), array('name' => 'upload_path', 'type' => 'raw', 'value' => $this->widget('EditableField', array('model' => $model, 'attribute' => 'upload_path', 'url' => $this->createUrl('/d2files/d2files/editableSaver')), true)), array('name' => 'add_datetime', 'type' => 'raw', 'value' => $this->widget('EditableField', array('model' => $model, 'type' => 'datetime', 'url' => $this->createUrl('/d2files/d2files/editableSaver'), 'attribute' => 'add_datetime'), true)), array('name' => 'user_id', 'type' => 'raw', 'value' => $this->widget('EditableField', array('model' => $model, 'attribute' => 'user_id', 'url' => $this->createUrl('/d2files/d2files/editableSaver')), true)), array('name' => 'deleted', 'type' => 'raw', 'value' => $this->widget('EditableField', array('model' => $model, 'attribute' => 'deleted', 'url' => $this->createUrl('/d2files/d2files/editableSaver')), true)), array('name' => 'notes', 'type' => 'raw', 'value' => $this->widget('EditableField', array('model' => $model, 'attribute' => 'notes', 'url' => $this->createUrl('/d2files/d2files/editableSaver')), true)), array('name' => 'model', 'type' => 'raw', 'value' => $this->widget('EditableField', array('model' => $model, 'attribute' => 'model', 'url' => $this->createUrl('/d2files/d2files/editableSaver')), true)), array('name' => 'model_id', 'type' => 'raw', 'value' => $this->widget('EditableField', array('model' => $model, 'attribute' => 'model_id', 'url' => $this->createUrl('/d2files/d2files/editableSaver')), true)))));
?>
    </div>

    </div>
    <div class="row">
    
</div>

<?php 
echo $cancel_buton;
コード例 #4
0
 public function loadModel($id)
 {
     $m = D2filesType::model();
     // apply scope, if available
     $scopes = $m->scopes();
     if (isset($scopes[$this->scope])) {
         $m->{$this->scope}();
     }
     $model = $m->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, Yii::t('D2filesModule.crud_static', 'The requested page does not exist.'));
     }
     return $model;
 }