Пример #1
0
 function preforward()
 {
     $this->af->setApp('params', $this->af->getArray(false));
     $this->af->setApp('options', array('いいえ', 'はい'));
     $this->af->setApp('group_options', array('いいえ', 'はい(一行)', 'はい(改行)'));
     $this->af->setApp('custom_options', array('' => 'なし', 'checkHiragana' => 'ふりがな', 'checkKatakana' => 'フリガナ', 'checkMailaddress' => 'メールアドレス ( 例: info@example.com )', 'checkMailaddress_r' => 'メールアドレス ( このアドレスに控えメールを送信します。 )', 'checkRepeat' => '上段のフォーム内容の再入力 ( 確認の為に再度入力して下さい。 )', 'checkURL' => 'URL ( 例: http://www.example.com/ )', 'checkAlphabet' => '英字 ( 英字を入力して下さい。 )', 'checkAlphanum' => '英数字 ( 英数字を入力して下さい。 )', 'checkNumber' => '数字', 'checkInteger' => '正整数', 'checkZipcode' => '郵便番号 ( 例: 000-1111 )', 'checkZipcode_d' => '郵便番号 ( 例: 0001111 (ハイフン不要) )', 'checkPhone' => '固定電話 ( 例: 03-111-2222 )', 'checkPhone_d' => '固定電話 ( 例: 031112222 (ハイフン不要) )', 'checkMbphone' => '携帯電話 ( 例: 090-1111-2222 )', 'checkMbphone_d' => '携帯電話 ( 例: 09011112222 (ハイフン不要) )'));
     if ($this->af->getApp('attr') != null) {
         $params = $this->af->getArray();
         $params['id'] = 'none';
         $values =& $params['values'];
         $values = preg_replace('/\\r\\n?/', "\n", $values);
         $form = FormBuilder::build($params);
         $default = $params['default'];
         $t = $params['type_name'][0];
         // 初期値代入
         if ($t == 't' || $t == 'f') {
             $form = str_replace('<?=$none_v?>', $default, $form);
         } else {
             $selected = $t == 's' ? ' selected="selected"' : ' checked="checked"';
             $value = $t == 'c' ? preg_split('/[、,]/u', $default) : array($default);
             $values = explode("\n", $values);
             foreach ($values as $i => $v) {
                 $v = in_array($v, $value) ? $selected : '';
                 $form = str_replace(sprintf('<?=$none%d_v?>', $i), $v, $form);
             }
         }
         $this->af->setAppNE('form', $form);
     }
 }
Пример #2
0
 function preforward()
 {
     $type = $this->af->get('type');
     if ($type === null) {
         $type = 'text';
     }
     $type_options = array('text' => '一行入力', 'textarea' => '複数行入力', 'select' => 'セレクトボックス', 'radio' => 'ラジオボタン', 'checkbox' => 'チェックボックス', 'file' => 'ファイル選択');
     $data =& $this->backend->getManager('Data');
     $index_options = range(0, count($data->get('attr')) + 1);
     unset($index_options[0]);
     $this->af->setApp('id', $this->af->get('id'));
     $this->af->setApp('index', $this->af->get('index'));
     $this->af->setApp('index_options', $index_options);
     $this->af->setApp('type', $type);
     $this->af->setApp('type_options', $type_options);
     $this->af->setApp('form_name', $data->get('name'));
     $forms = array();
     $attr_list = $data->get('attr');
     if (is_array($attr_list)) {
         foreach ($attr_list as $attr) {
             $attr = Ethna_Util::escapeHtml($attr);
             $t = $attr['type_name'][0];
             $attr['style'] = $attr['type_name'] == 'textarea' ? 'overflow-y: scroll;height: 2.8em;' : '';
             $attr['width'] = 1;
             $attr['height'] = 1;
             $attr['values'] = ' ';
             $form = FormBuilder::build($attr);
             if ($t == 'c' || $t == 'r') {
                 $v = ' checked="checked"';
             } else {
                 $v = '';
             }
             $form = preg_replace('/\\<\\?.+?\\?\\>/', $v, $form);
             $attr['form'] = $form;
             $forms[] = $attr;
         }
         $this->af->setAppNE('forms', $forms);
     }
 }
Пример #3
0
                         border-top:1px solid #ddd;
                         margin:5px -5px 0px 0px;
                         padding-top:5px;">
                        <img style="max-width:100%;" ng-src="{{thumb}}" alt="" />
                    </div>
                </div>
                <div ng-if="!file.name" style="font-size:12px;color:#999;text-align:center;">
                    &mdash; EMPTY &mdash;
                </div>
            </div>

            <div ng-if="(file === null || loading) && mode == 'Download Only'" class="form-control"
                 style="padding:5px 5px 3px 0px;height:auto;box-shadow:none; border-color:#ececeb;">
                <div style="font-size:12px;color:#999;text-align:center;">
                    &mdash; {{ file == null ? 'EMPTY' : 'LOADING' }} &mdash;
                </div>
            </div>

            <!-- error -->
            <div ng-if="errors[name]" class="alert error alert-danger">
                {{ errors[name][0]}}
            </div>
            <!-- /error -->
        </div>

        <?php 
echo FormBuilder::build('RepoBrowser', ['name' => 'BrowseDialog', 'showBrowseButton' => 'No']);
?>

    </div>
</div>
Пример #4
0
<?php

$fb = new FormBuilder();
//$fb->action = isset($_GET['action'])?$_GET['action']:'';
if (!isset($_GET['action'])) {
    $fb->build();
} else {
    if ($_GET['action'] == 'download') {
        $fb->download_zip();
    } else {
        if ($_GET['action'] == 'manual') {
            $fb->manual_download($_GET['directory']);
        }
    }
}
class FormBuilder
{
    public $output_directory;
    public $default_width;
    public $rules;
    public $form_html;
    public $form_width;
    public $form_directory;
    public $output_method;
    public $file_names;
    public $theme;
    function __construct()
    {
        $this->output_directory = rtrim(dirname(__FILE__), 'application') . 'your_forms';
        //$this->resp_directory = rtrim(dirname(__FILE__), 'application') . 'your_forms';
        $this->default_width = 500;
    function makeParts_m($attr_list)
    {
        $cycle = 1;
        $forms = array();
        $confirms = array();
        foreach ($attr_list as $i => $attr) {
            $attr = Ethna_Util::escapeHtml($attr);
            extract($attr);
            $form = FormBuilder::build($attr);
            $form = $this->lightweighting($form);
            if ($i === 0) {
                $group = '0';
            }
            if ($required === '1') {
                $name .= '<em class="required">※</em>';
            }
            if ($suffix != '') {
                $form .= ' ' . $suffix;
            }
            if ($example !== '') {
                $example = nl2br($example);
                $form .= <<<EOM
<br />
\t\t\t<em class="example">{$example}</em>
EOM;
            }
            // =================================================================================
            $error = <<<EOM
\t\t\t<?error(\$vars, '{$id}')?>
EOM;
            if ($group === '0' && $i > 0) {
                $forms[] = <<<EOM
\t\t</div>
\t\t<hr />
EOM;
            }
            if ($group === '0') {
                $cycle ^= 1;
                $forms[] = <<<EOM
\t\t<div>
\t\t\t■{$name}<br />
{$error}
EOM;
            } else {
                $this->insertError($forms, $error);
                if ($group === '2') {
                    $forms[count($forms) - 1] .= '<br />';
                }
            }
            $forms[] = <<<EOM
\t\t\t{$form}
EOM;
            // =================================================================================
            if ($group === '0' && $i > 0) {
                $confirms[] = <<<EOM
\t</div>
\t<hr />
EOM;
            }
            if ($group === '0') {
                $confirms[] = <<<EOM
\t<div>
\t\t■{$name}<br />
EOM;
            } else {
                if ($group === '2') {
                    $confirms[count($confirms) - 1] .= '<br />';
                }
            }
            $confirms[] = <<<EOM
\t\t<?=\${$id}_c?> {$suffix}
EOM;
            // =================================================================================
        }
        // endforeach
        if ((bool) $forms) {
            $forms[] = <<<EOM
\t\t</div>
EOM;
            $confirms[] = <<<EOM
\t</div>
EOM;
        }
        return array($confirms, $forms);
    }
Пример #6
0
            <div ui-header>
                <i ng-if="mode == 'custom'" class="fa fa-sitemap" style="float:left;margin:6px 7px 0px  -7px;"></i>
                {{ mode == 'normal' ? 'Properties' : '<?php 
echo $class;
?>
'}}
                <span style="color:black;font-size:11px;" ng-if="mode == 'custom'" ng-show='saving'>
                    &nbsp; &nbsp; <span style="border:1px solid black;padding:0px 4px;border-radius:2px;"><i
                            class="fa fa-check"></i> Saving ...</span>
                </span>
                <span style="color:green;font-size:11px;display:none;" class="saved">
                    &nbsp; &nbsp; <span style="border:1px solid green;padding:0px 4px;border-radius:2px;"><i
                            class="fa fa-check"></i> Saved</span>
                </span>
                <?php 
echo FormBuilder::build('ToggleSwitch', ['name' => 'mode', 'size' => 'small', 'offLabel' => 'Custom Script', 'onLabel' => 'Normal Menu', 'options' => ['style' => 'float:right;width:140px;', 'ng-change' => 'switchMode()', 'ng-show' => "codeValid && !modeLocked"]]);
?>
                <div ng-if="!codeValid" style="float:right;margin:0px 10px;color:red;">
                    <i class="fa fa-warning fa-fw"></i> Invalid Code
                </div>
                <div ng-if="modeLocked && codeValid" style="float:right;margin:0px 10px;color:#555;" tooltip="MANTA">
                    <i class="fa fa-lock fa-fw"></i> Custom Mode
                </div>

            </div>
            <div ui-content style="padding:3px 20px;">
                <div ng-if="mode == 'normal'">
                    <div ng-show="active == null">
                        <?php 
include "empty.php";
?>
Пример #7
0
            <?php 
echo $this->label;
?>
 

        </div>
    </div>
    <table style="width:100%;margin-right:-1px;">
        <tr>
            <td style="padding:3px;border-right:0px;">
                
                <center ng-show='isLoading' style='padding:10px;color:#999;font-size:12px;'>
                    <i class="fa fa-link"></i> Loading SQL
                </center>
                
                <div ng-show='!isLoading' ng-bind-html="previewSQL" style="
                    margin-bottom:-10px;
                    -moz-user-select:text;
                    -webkit-user-select:text;
                    user-select:text;
                "></div>
            </td>
        </tr>
    </table>

    <?php 
echo FormBuilder::build('ModalDialog', ['name' => 'CriteriaDialog', 'subForm' => 'SqlCriteriaForm']);
?>

</div>