示例#1
0
/**
 * Returns an uri.
 * @return string
 */
function uriFull()
{
    return uriSite(Router::getUriFull());
}
示例#2
0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@exidoengine.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade ExidoEngine to newer
 * versions in the future. If you wish to customize ExidoEngine for your
 * needs please refer to http://www.exidoengine.com for more information.
 *
 * @license   http://www.exidoengine.com/license/gpl-3.0.html (GNU General Public License v3)
 * @author    ExidoTeam
 * @copyright Copyright (c) 2009 - 2013, ExidoEngine Solutions
 * @link      http://www.exidoengine.com/
 * @since     Version 1.0
 * @filesource
 *******************************************************************************/
$form = '<script>$(function(){$("#welcome_dialog").dialog({height:140,modal:true,autoOpen:false,open:function(event,ui){$("button").attr("title","' . __('Close') . '");}});$("form").validate({rules:{username:"******",password:"******"},messages:{username:"******",password:"******"},submitHandler:function(form){$.post("' . uriSite('auth') . '",{uid:$("input[name=username]").val(),pwd:$("input[name=password]").val()},function(data){if(data.status == true){
      $("#welcome_dialog p").html(data.text);
      $("#welcome_dialog").dialog("open");
      setTimeout(function(){window.location.reload();},1000);
    } else {
      alert(data.text);
      form.reset();
    }},"json");}});});</script>' . '<form class="-i-form" method="POST" action="">' . '<fieldset>' . '<legend>' . __('Username') . '</legend><input class="-i-text" type="text" name="username" value="exidoengine" maxlength="32" autocomplete="off" /><label for="username" generated="true" class="error">&nbsp;</label>' . '</fieldset>' . '<fieldset>' . '<legend>' . __('Password') . '</legend><input class="-i-text" type="password" name="password" value="exidoengine" /><label for="password" generated="true" class="error">&nbsp;</label>' . '</fieldset>' . '<fieldset>' . '<input class="-b-button" type="submit" name="submit" value="' . __('Sign in') . '" />' . '</fieldset>' . '</form>';
$msg1 = '<span>' . __('Welcome to administration panel') . '</span>' . '<span>' . __('Please authorize your person') . '</span>';
$msg2 = '<span>' . __('Please enter your credentials in the box above.') . '</span>' . '<span>' . __('You have 3 attempts to authorize yourself.') . '</span>' . '<span>' . __('After third incorrect attempt, you will be rejected for a some time.') . '</span>';
$dialogs = '<div id="welcome_dialog" title="' . __('Welcome') . '">' . '<p></p>' . '</div>';
$helper->doctype()->openHtml()->openHead()->base()->title(__('ExidoEngine administration panel'))->charset()->fav('exidoengine')->css('exido-bootstrap/bootstrap')->css('exido-bootstrap/bootstrap-green')->css('administrator/signin-form')->css('administrator/jqueryui')->js('administrator/jquery')->js('administrator/jqueryui')->js('administrator/form.validate')->js('administrator/common')->closeHead()->openBody()->open('wrapper', 'wrapper')->open('container')->open('form-text')->notifier($msg1, 'msg1 messages')->notifier($form, 'signin-form')->notifier($msg2, 'msg2 messages');
print $dialogs;
$helper->close()->close()->close()->notifier('<a href="http://www.exidoengine.com" target="_blank">ExidoEngine Web-sites manager</a>', 'footer')->closeBody()->closeHtml();
示例#3
0
function eavCreateFormValidationJS($id, array $attributes)
{
    $script = '<script type="text/javascript">';
    $script .= '$(function() {';
    $script .= "\$('#" . $id . "').validate({";
    $rules = array();
    $messages = array();
    foreach ($attributes as $field) {
        if ($field->backend_object != null) {
            if (!isset($field->entity_id)) {
                $field->entity_id = 0;
            }
            // Generate rules for JS validator
            switch ($field->data_type_key) {
                case 'text':
                    // Text value
                // Text value
                case 'varchar':
                    // Varchar value
                // Varchar value
                case 'bool':
                    // Bool value
                    if ($field->is_required) {
                        $rules[$field->attribute_key]['required'] = 'true';
                        $messages[$field->attribute_key]['required'] = __('This field is required');
                    }
                    if ($field->is_unique) {
                        $rules[$field->attribute_key]['remote'] = '"' . uriSite(uriSegment(1) . '/ajax/unique?entity_id=' . (int) $field->entity_id) . '"';
                        $messages[$field->attribute_key]['remote'] = __('This field must be unique');
                    }
                    break;
                case 'int':
                    $rules[$field->attribute_key]['number'] = 'true';
                    $messages[$field->attribute_key]['number'] = __('Please enter a valid number');
                    if ($field->is_required) {
                        $rules[$field->attribute_key]['required'] = 'true';
                        $messages[$field->attribute_key]['required'] = __('This field is required');
                    }
                    if ($field->is_unique) {
                        $rules[$field->attribute_key]['remote'] = '"' . uriSite(uriSegment(1) . '/ajax/unique?entity_id=' . (int) $field->entity_id) . '"';
                        $messages[$field->attribute_key]['remote'] = __('This field must be unique');
                    }
                    break;
                case 'decimal':
                    break;
                case 'datetime':
                    break;
            }
        }
    }
    // Generate rules string
    if (!empty($rules)) {
        $script .= 'rules: {';
        $c_rule = count($rules);
        $c = 1;
        foreach ($rules as $key => $rule) {
            $script .= $key . ': {';
            $b_rule = count($rule);
            $b = 1;
            foreach ($rule as $k => $v) {
                $script .= $k . ': ' . $v;
                if ($b < $b_rule) {
                    $script .= ',';
                }
                $b++;
            }
            $script .= '}';
            if ($c < $c_rule) {
                $script .= ',';
            }
            $c++;
        }
        $script .= '},';
    }
    // Generate messages string
    if (!empty($messages)) {
        $script .= 'messages: {';
        $c_msg = count($messages);
        $c = 1;
        foreach ($messages as $key => $message) {
            $script .= $key . ': {';
            $b_msg = count($message);
            $b = 1;
            foreach ($message as $k => $v) {
                $script .= $k . ": '" . $v . "'";
                if ($b < $b_msg) {
                    $script .= ',';
                }
                $b++;
            }
            $script .= '}';
            if ($c < $c_msg) {
                $script .= ',';
            }
            $c++;
        }
        $script .= '},';
    }
    $script .= 'errorClass: "-i-error"';
    //$script.= ",submitHandler: function(form){ $('input[name=submit]').attr('disabled', true).val('".__('Saving...')."');}";
    $script .= '});});' . EXIDO_EOL;
    $script .= '</script>';
    return $script;
}
示例#4
0
print __('Email is already exists');
?>
"
      },
      role_name: '<?php 
print __('Please choose role');
?>
'
    },
    errorClass: "-i-error"
  });
});
</script>
<?
$helper->heading(__('Users - Create user'));
print formOpen(uriSite('/user/action/create'), array(
  'id'     => '-x-user-add',
  'class'  => '-i-form',
  'method' => 'POST'
));
// Form fields
print formFieldsetOpen(__('User name (login name)'), array(
  'id'          => '-x-field-user_name',
  'is_required' => true
));
print formInput(array(
  'id'    => '-x-input-user_name',
  'name'  => 'user_name',
  'class' => '-i-text'
  ), ''
);
示例#5
0
/**
 * Returns an A tag.
 * @param string $url
 * @param string $title
 * @param string $class
 * @return string
 */
function htmlA($url, $title, $class = '')
{
    Helper::load('uri');
    return '<a' . (empty($class) ? '' : ' class="' . $class . '"') . ' href="' . uriSite($url) . '">' . $title . "</a>" . EXIDO_EOL;
}