Exemplo n.º 1
0
 * Section 5 of the GNU Affero General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * X2Engine" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by X2Engine".
 *****************************************************************************************/
$folderForm = $this->beginWidget('X2ActiveForm', array('formModel' => $model, 'id' => 'folder-form-inner'));
X2Flashes::renderFlashes('error');
X2Flashes::renderFlashes('success');
echo $folderForm->labelEx($model, 'name');
echo $folderForm->textField($model, 'name');
echo $folderForm->hiddenField($model, 'parentFolder');
echo $folderForm->labelEx($model, 'visibility');
echo $folderForm->dropDownList($model, 'visibility', X2PermissionsBehavior::getVisibilityOptions(), array('data-default' => 1));
echo X2Html::ajaxSubmitButton('', '', array('dataType' => 'json', 'success' => 'function(data){
        var folderForm$ = $("#folder-form")
        if (data.success) {
            folderForm$.dialog("close");
            x2.forms.clearForm ($("#folder-form form"), true);
            x2.flashes.displayFlashes({
                success:[' . CJSON::encode(Yii::t('docs', 'Folder created.')) . ']});

            $.fn.yiiGridView.update("folder-contents", {complete:function(){ 
                x2.folderManager.setUpDragAndDrop(); }});
        } else {
            folderForm$.find ("form").replaceWith (data.form);
        }
    }'), array('class' => 'x2-button', 'live' => false, 'style' => 'display: none;'));
$this->endWidget();
Exemplo n.º 2
0
 public function getVisibility()
 {
     if (is_null($this->visibility)) {
         $this->visibility = 1;
     }
     $visibilities = X2PermissionsBehavior::getVisibilityOptions();
     return $visibilities[$this->visibility];
 }