roundcubemail/plugins/new_user_dialog/new_user_dialog.php
function render_page($p)
    {
        if ($_SESSION['plugin.newuserdialog']) {
            $this->add_texts('localization');

            $rcmail           = rcmail::get_instance();
            $identity         = $rcmail->user->get_identity();
            $identities_level = intval($rcmail->config->get('identities_level', 0));

            // compose user-identity dialog
            $table = new html_table(array('cols' => 2));

            $table->add('title', $this->gettext('name'));
            $table->add(null, html::tag('input', array(
                    'type'     => 'text',
                    'name'     => '_name',
                    'value'    => $identity['name'],
                    'disabled' => $identities_level == 4
            )));

            $table->add('title', $this->gettext('email'));
            $table->add(null, html::tag('input', array(
                    'type'     => 'text',
                    'name'     => '_email',
                    'value'    => rcube_utils::idn_to_utf8($identity['email']),
                    'disabled' => in_array($identities_level, array(1, 3, 4))
            )));

            $table->add('title', $this->gettext('organization'));
            $table->add(null, html::tag('input', array(
                    'type'     => 'text',
                    'name'     => '_organization',
                    'value'    => $identity['organization'],
                    'disabled' => $identities_level == 4
            )));

            $table->add('title', $this->gettext('signature'));
            $table->add(null, html::tag('textarea', array(
                    'name' => '_signature',
                    'rows' => '3',
                ),
                $identity['signature']
            ));

            // add overlay input box to html page
            $rcmail->output->add_footer(html::tag('form', array(
                    'id' => 'newuserdialog',
                    'action' => $rcmail->url('plugin.newusersave'),
                    'method' => 'post'
                ),
                html::p('hint', rcube::Q($this->gettext('identitydialoghint'))) .
                    $table->show() .
                    html::p(array('class' => 'formbuttons'),
                        html::tag('input', array('type' => 'submit',
                            'class' => 'button mainaction', 'value' => $this->gettext('save'))))
            ));

            $title  = rcube::JQ($this->gettext('identitydialogtitle'));
            $script = "
$('#newuserdialog').show()
  .dialog({modal:true, resizable:false, closeOnEscape:false, width:450, title:'$title'})
  .submit(function() {
    var i, request = {}, form = $(this).serializeArray();
    for (i in form)
      request[form[i].name] = form[i].value;

      rcmail.http_post('plugin.newusersave', request, true);
      return false;
  });

$('input[name=_name]').focus();
rcube_webmail.prototype.new_user_dialog_close = function() { $('#newuserdialog').dialog('close'); }
";
            // disable keyboard events for messages list (#1486726)
            $rcmail->output->add_script($script, 'docready');

            $this->include_stylesheet('newuserdialog.css');
        }
    }
function render_page($p)
    {
        if ($_SESSION['plugin.newuserdialog']) {
            $this->add_texts('localization');

            $rcmail           = rcmail::get_instance();
            $identity         = $rcmail->user->get_identity();
            $identities_level = intval($rcmail->config->get('identities_level', 0));

            // compose user-identity dialog
            $table = new html_table(array('cols' => 2));

            $table->add('title', $this->gettext('name'));
            $table->add(null, html::tag('input', array(
                    'type'     => 'text',
                    'name'     => '_name',
                    'value'    => $identity['name'],
                    'disabled' => $identities_level == 4
            )));

            $table->add('title', $this->gettext('email'));
            $table->add(null, html::tag('input', array(
                    'type'     => 'text',
                    'name'     => '_email',
                    'value'    => rcube_utils::idn_to_utf8($identity['email']),
                    'disabled' => in_array($identities_level, array(1, 3, 4))
            )));

            $table->add('title', $this->gettext('organization'));
            $table->add(null, html::tag('input', array(
                    'type'     => 'text',
                    'name'     => '_organization',
                    'value'    => $identity['organization'],
                    'disabled' => $identities_level == 4
            )));

            $table->add('title', $this->gettext('signature'));
            $table->add(null, html::tag('textarea', array(
                    'name' => '_signature',
                    'rows' => '3',
                ),
                $identity['signature']
            ));

            // add overlay input box to html page
            $rcmail->output->add_footer(html::tag('form', array(
                    'id' => 'newuserdialog',
                    'action' => $rcmail->url('plugin.newusersave'),
                    'method' => 'post'
                ),
                html::p('hint', rcube::Q($this->gettext('identitydialoghint'))) .
                    $table->show() .
                    html::p(array('class' => 'formbuttons'),
                        html::tag('input', array('type' => 'submit',
                            'class' => 'button mainaction', 'value' => $this->gettext('save'))))
            ));

            $title  = rcube::JQ($this->gettext('identitydialogtitle'));
            $script = "
$('#newuserdialog').show()
  .dialog({modal:true, resizable:false, closeOnEscape:false, width:450, title:'$title'})
  .submit(function() {
    var i, request = {}, form = $(this).serializeArray();
    for (i in form)
      request[form[i].name] = form[i].value;

      rcmail.http_post('plugin.newusersave', request, true);
      return false;
  });

$('input[name=_name]').focus();
rcube_webmail.prototype.new_user_dialog_close = function() { $('#newuserdialog').dialog('close'); }
";
            // disable keyboard events for messages list (#1486726)
            $rcmail->output->add_script($script, 'docready');

            $this->include_stylesheet('newuserdialog.css');
        }
    }
function render_page ( $ p ) { if ( $ _SESSION [ 'plugin.newuserdialog' ] ) { $ this -> add_texts ( 'localization' ) ; $ rcmail = rcmail :: get_instance ( ) ; $ identity = $ rcmail -> user -> get_identity ( ) ; $ identities_level = intval ( $ rcmail -> config -> get ( 'identities_level' , 0 ) ) ; // compose user-identity dialog $ table = new html_table ( array ( 'cols' => 2 ) ) ; $ table -> add ( 'title' , $ this -> gettext ( 'name' ) ) ; $ table -> add ( null , html :: tag ( 'input' , array ( 'type' => 'text' , 'name' => '_name' , 'value' => $ identity [ 'name' ] , 'disabled' => $ identities_level == 4 ) ) ) ; $ table -> add ( 'title' , $ this -> gettext ( 'email' ) ) ; $ table -> add ( null , html :: tag ( 'input' , array ( 'type' => 'text' , 'name' => '_email' , 'value' => rcube_utils :: idn_to_utf8 ( $ identity [ 'email' ] ) , 'disabled' => in_array ( $ identities_level , array ( 1 , 3 , 4 ) ) ) ) ) ; $ table -> add ( 'title' , $ this -> gettext ( 'organization' ) ) ; $ table -> add ( null , html :: tag ( 'input' , array ( 'type' => 'text' , 'name' => '_organization' , 'value' => $ identity [ 'organization' ] , 'disabled' => $ identities_level == 4 ) ) ) ; $ table -> add ( 'title' , $ this -> gettext ( 'signature' ) ) ; $ table -> add ( null , html :: tag ( 'textarea' , array ( 'name' => '_signature' , 'rows' => '3' , ) , $ identity [ 'signature' ] ) ) ; // add overlay input box to html page $ rcmail -> output -> add_footer ( html :: tag ( 'form' , array ( 'id' => 'newuserdialog' , 'action' => $ rcmail -> url ( 'plugin.newusersave' ) , 'method' => 'post' ) , html :: p ( 'hint' , rcube :: Q ( $ this -> gettext ( 'identitydialoghint' ) ) ) . $ table -> show ( ) . html :: p ( array ( 'class' => 'formbuttons' ) , html :: tag ( 'input' , array ( 'type' => 'submit' , 'class' => 'button mainaction' , 'value' => $ this -> gettext ( 'save' ) ) ) ) ) ) ; $ title = rcube :: JQ ( $ this -> gettext ( 'identitydialogtitle' ) ) ; $ script = "
$('#newuserdialog').show()
  .dialog({modal:true, resizable:false, closeOnEscape:false, width:450, title:'$title'})
  .submit(function() {
    var i, request = {}, form = $(this).serializeArray();
    for (i in form)
      request[form[i].name] = form[i].value;

      rcmail.http_post('plugin.newusersave', request, true);
      return false;
  });

$('input[name=_name]').focus();
rcube_webmail.prototype.new_user_dialog_close = function() { $('#newuserdialog').dialog('close'); }
" ; // disable keyboard events for messages list (#1486726) $ rcmail -> output -> add_script ( $ script , 'docready' ) ; $ this -> include_stylesheet ( 'newuserdialog.css' ) ; } }
Callback function when HTML page is rendered
We'll add an overlay box here.
Callback function when HTML page is rendered We ll add an overlay box here .