Ejemplo n.º 1
0
	public function actionUpdate($dir, $fileName)
	{
		if (isset($_POST['fileContent'])) {
			FileSystem::write('./'.$dir.'/'.$fileName, $_POST['fileContent'], 'w');
            Y::end();
        }

		$content = '';
		$info = FileSystem::getInfo('./'.$dir.'/'.$fileName, array('name', 'ext'));
		if (in_array($info['ext'], array('js', 'css'))) {
			if (substr($dir, 0, 2) == 'js' || substr($dir, 0, 3) == 'css') {
				$content = FileSystem::read('./'.$dir.'/'.$fileName);
			}
		}
		
		$output = $this->renderPartial('fileDetails', array(
			'fileName' => $fileName,
			'content' => $content,
			'type' => $info['ext'] == 'css' ? 'css' : 'javascript',
			'filePath' => './'.$dir.'/'.$fileName
		), true);

        Y::tab('Содержимое файла', $output);

        $output = Y::getTabs('cssFileForm', true);
        Y::clientScript()->render($output);
        echo CHtml::tag('div', array(), $output);
	}
Ejemplo n.º 2
0
<div class="form">
    <?php $form=$this->beginWidget('CActiveForm', array(
        'id'=>'posts-form',
        'enableAjaxValidation'=>true,
        'enableClientValidation'=>true,
        'clientOptions'=>array(
            'validateOnSubmit'=>true,
        ),
        'htmlOptions' => array(
            'enctype'=>'multipart/form-data'
        )
    ));
        echo $form->errorSummary($model);

        Y::hooks()->cmsAdminGetTabs($this, array('model'=>$model, 'form'=>$form));

        echo Y::getTabs();

    $this->endWidget();
    ?>
</div><!-- form -->
Ejemplo n.º 3
0
<div class="form">
<?php
$form = Admin::beginForm($model, array('id'=>'page-form'));
	Admin::makeTinyTabs($form, $model, array('text', 'sidebar'));
	Y::getTabs('page-tabs', false);
$this->endWidget() ?>

</div><!-- form -->
Ejemplo n.º 4
0
        Admin::makeTextFields($form, $model, array('title', 'alias')) ?>
        <div class="row">
            <div class="left"><?php echo $form->labelEx($model,'published') ?></div>
            <div class="right">
                <?php echo $form->radioButtonList($model,'published',Lookup::items('MPublished')) ?>
            </div>
        </div>
        <div class="row">
            <div class="left"<?php echo $form->labelEx($model,'is_empty') ?></div>
            <div class="right">
                <?php echo $form->radioButtonList($model,'is_empty',Lookup::items('YesNo')) ?>
            </div>
        </div>
        <?php if ($model->isNewRecord) { ?>
            <div class="row">
                <div class="left"><?php echo $form->labelEx($model,'type') ?></div>
                <div class="right">
                    <?php echo $form->dropDownList($model,'type',ModelFactory::getTypes()) ?>
                </div>
            </div>
        <?php } ?>
    <?php
    Y::endTab();
    Y::beginTab('Метаданные');
            Admin::makeTextFields($form, $model, array('meta_title', 'meta_descr', 'meta_keywords'));
    Y::endTab();
    Y::getTabs();

$this->endWidget() ?>
</div><!-- form -->
Ejemplo n.º 5
0
<?php Y::beginTab('Дополнительно') ?>
    <div class="row">
        <?php echo CHtml::label('Название', 'Extra[title]') ?>
        <?php echo CHtml::textField('Extra[title]', $model->title) ?>
    </div>
    <div class="row">
        <?php echo CHtml::label('Опубликован', 'Extra[published]')  ?>
        <?php echo CHtml::checkBox('Extra[published]', $model->published)  ?>
    </div>
<?php Y::endTab() ?>

<?php echo Y::getTabs($id) ?>