$comment_options[] = $msgform_class_start . '<label><input type="checkbox" class="checkbox" name="comment_allow_msgform" tabindex="8"' . ($comment_allow_msgform ? ' checked="checked"' : '') . ' value="1" /> ' . T_('Allow message form') . '</label>' . ' <span class="note">(' . T_('Allow users to contact me through a message form -- Your email will <strong>not</strong> be revealed!') . ')</span>' . $msgform_class_end;
        // TODO: If we have an email in a cookie, Add links called "Add a contact icon to all my previous comments" and "Remove contact icon from all my previous comments".
    }
    // Display renderers
    $comment_renderer_checkboxes = $Plugins->get_renderer_checkboxes(array('default'), array('Blog' => &$Blog, 'setting_name' => 'coll_apply_comment_rendering'));
    if (!empty($comment_renderer_checkboxes)) {
        $Form->begin_fieldset();
        echo '<div class="label">' . T_('Text Renderers') . ':</div>';
        echo '<div class="input">';
        echo $comment_renderer_checkboxes;
        echo '</div>';
        $Form->end_fieldset();
    }
    $Plugins->trigger_event('DisplayCommentFormFieldset', array('Form' => &$Form, 'Item' => &$Item));
    $Form->begin_fieldset();
    echo '<div class="input">';
    $preview_text = $Item->can_attach() ? T_('Preview/Add file') : T_('Preview');
    $Form->button_input(array('name' => 'submit_comment_post_' . $Item->ID . '[save]', 'class' => 'submit', 'value' => $params['form_submit_text'], 'tabindex' => 10));
    $Form->button_input(array('name' => 'submit_comment_post_' . $Item->ID . '[preview]', 'class' => 'preview', 'value' => $preview_text, 'tabindex' => 9));
    $Plugins->trigger_event('DisplayCommentFormButton', array('Form' => &$Form, 'Item' => &$Item));
    echo '</div>';
    $Form->end_fieldset();
    ?>

	<div class="clear"></div>

	<?php 
    $Form->end_form();
    echo $params['after_comment_form'];
    echo_comment_reply_js($Item);
}
    }
    if (isset($cache_user_contacts_groups[$user_ID])) {
        // user has groups
        echo $cache_user_contacts_groups[$user_ID];
    }
}
$Results->cols[] = array('th' => T_('Groups'), 'th_class' => 'shrinkwrap', 'td_class' => 'left nowrap', 'td' => '%contacts_groups( #mct_to_user_ID# )%');
$Results->display($display_params);
if (count($Results->rows) > 0) {
    // Display actions buttons
    global $module_contacts_list_params;
    modules_call_method('get_contacts_list_params');
    $Form = new Form(get_dispctrl_url('contacts'), 'add_group_contacts');
    echo '<div class="form_send_contacts">';
    $multi_action_icon = get_icon('multi_action', 'imgtag', array('style' => 'margin:0 2px 0 14px;position:relative;top:-5px;'));
    $Form->button_input(array('type' => 'button', 'value' => $module_contacts_list_params['title_selected'], 'onclick' => 'location.href=\'' . $module_contacts_list_params['recipients_link'] . '\'', 'id' => 'send_selected_recipients', 'input_prefix' => $multi_action_icon));
    echo '</div>';
    $Form->switch_layout('none');
    $Form->switch_template_parts(array('formstart' => '<div class="form_add_contacts">', 'labelstart' => '<span class="label">', 'labelend' => '</span> <span class="controls">', 'formend' => '</div>'));
    $Form->begin_form();
    $Form->add_crumb('messaging_contacts');
    $Form->hidden('users', '');
    if (isset($module_contacts_list_params['form_hiddens']) && !empty($module_contacts_list_params['form_hiddens'])) {
        // Append the hidden input elements from module
        foreach ($module_contacts_list_params['form_hiddens'] as $hidden_input) {
            $Form->hidden($hidden_input['name'], $hidden_input['value']);
        }
    }
    $Form->combo_box('group', param('group_combo', 'string', ''), get_contacts_groups_options(param('group', 'string', '-1'), false), $multi_action_icon . T_('Add all selected contacts to this group'), array('new_field_size' => '8'));
    $Form->buttons(array(array('submit', 'actionArray[add_group]', T_('Add'), 'SaveButton btn-primary btn-sm')));
    echo '</span>';
 /**
  * Display the widget!
  *
  * @param array MUST contain at least the basic display params
  */
 function display($params)
 {
     global $Blog, $Settings, $Session, $redirect_to, $dummy_fields;
     if (is_logged_in()) {
         // No display when user is already registered
         return false;
     }
     if ($Settings->get('newusers_canregister') != 'yes' || !$Settings->get('quick_registration')) {
         // Display error message when quick registration is disabled
         echo '<p class="error">' . T_('Quick registration is currently disabled on this system.') . '</p>';
         return false;
     }
     // Restore the typed in params from the redirected page:
     $widget_param_input_err_messages = $Session->get('param_input_err_messages_' . $this->ID);
     $widget_param_input_values = $Session->get('param_input_values_' . $this->ID);
     if (!empty($widget_param_input_err_messages)) {
         // Convert param errors to global $param_input_err_messages that is used to display an error text under input field
         global $param_input_err_messages;
         $param_input_err_messages = $widget_param_input_err_messages;
     }
     // Clear the temp session vars
     $Session->delete('param_input_err_messages_' . $this->ID);
     $Session->delete('param_input_values_' . $this->ID);
     $Session->dbsave();
     $this->init_display($params);
     if (isset($this->BlockCache)) {
         // Do NOT cache some of these links are using a redirect_to param, which makes it page dependent.
         // Note: also beware of the source param.
         // so this will be cached by the PageCache; there is no added benefit to cache it in the BlockCache
         // (which could have been shared between several pages):
         $this->BlockCache->abort_collect();
     }
     echo $this->disp_params['block_start'];
     $redirect_to = param('redirect_to', 'url', regenerate_url('', '', '', '&'));
     $this->disp_title();
     echo $this->disp_params['block_body_start'];
     if (!empty($this->disp_params['intro'])) {
         // Intro text
         echo '<p>' . $this->disp_params['intro'] . '</p>';
     }
     $Form = new Form(get_secure_htsrv_url() . 'register.php', 'register_form', 'post');
     $Form->begin_form();
     $Form->add_crumb('regform');
     $Form->hidden('action', 'quick_register');
     $Form->hidden('inskin', true);
     $Form->hidden('blog', $Blog->ID);
     $Form->hidden('widget', $this->ID);
     $Form->hidden('redirect_to', $redirect_to);
     // E-mail
     $email_value = isset($widget_param_input_values[$dummy_fields['email']]) ? $widget_param_input_values[$dummy_fields['email']] : '';
     $Form->text_input($dummy_fields['email'], $email_value, 50, T_('Your email'), '', array('maxlength' => 255, 'class' => 'input_text', 'required' => true));
     if ($this->disp_params['ask_firstname'] != 'no') {
         // First name
         $firstname_value = isset($widget_param_input_values['firstname']) ? $widget_param_input_values['firstname'] : '';
         $Form->text_input('firstname', $firstname_value, 18, T_('First name'), '', array('maxlength' => 50, 'class' => 'input_text', 'required' => $this->disp_params['ask_firstname'] == 'required'));
     }
     if ($this->disp_params['ask_lastname'] != 'no') {
         // Last name
         $lastname_value = isset($widget_param_input_values['lastname']) ? $widget_param_input_values['lastname'] : '';
         $Form->text_input('lastname', $lastname_value, 18, T_('Last name'), '', array('maxlength' => 50, 'class' => 'input_text', 'required' => $this->disp_params['ask_lastname'] == 'required'));
     }
     // Submit button
     $Form->begin_fieldset('', array('class' => 'fieldset field_register_btn'));
     $Form->button_input(array('value' => $this->disp_params['button'], 'class' => 'submit'));
     $Form->end_fieldset();
     $Form->end_form();
     echo $this->disp_params['block_body_end'];
     echo $this->disp_params['block_end'];
     if (!empty($widget_param_input_err_messages)) {
         // Clear param errors here because we already display them above
         // Don't display them twice on another widget form
         $param_input_err_messages = NULL;
     }
     return true;
 }
Example #4
0
 /**
  * Event handler: Gets invoked when our tab is selected and should get displayed.
  *
  * @see Plugin::AdminTabPayload()
  */
 function AdminTabPayload()
 {
     echo 'Hello, this is the AdminTabPayload for the TEST plugin.';
     echo $this->text_from_AdminTabAction;
     // TODO: this is tedious.. should either be a global function (get_admin_Form()) or a plugin helper..
     $Form = new Form();
     $Form->begin_form();
     $Form->add_crumb('plugin_test');
     $Form->hidden_ctrl();
     // needed to pass the "ctrl=tools" param
     $Form->hiddens_by_key(get_memorized());
     // needed to pass all other memorized params, especially "tab"
     $Form->text_input($this->get_class_id() . '_text', $this->param_text, '20', 'Text');
     $Form->button_input();
     // default "submit" button
     $Form->end_form();
 }
Example #5
0
if (isset($Blog)) {
    $Form->hidden('blog', $Blog->ID);
}
$Form->hidden('recipient_id', $recipient_id);
$Form->hidden('post_id', $post_id);
$Form->hidden('comment_id', $comment_id);
$Form->hidden('redirect_to', url_rel_to_same_host($redirect_to, $samedomain_htsrv_url));
$Form->info(T_('To'), $recipient_link);
// Note: we use funky field names in order to defeat the most basic guestbook spam bots:
// email form
$Form->text_input($dummy_fields['name'], $email_author, 40, T_('From'), T_('Your name.'), array('maxlength' => 50, 'class' => 'wide_input', 'required' => true));
$Form->text_input($dummy_fields['email'], $email_author_address, 40, T_('Email'), T_('Your email address. (Will <strong>not</strong> be displayed on this site.)'), array('maxlength' => 150, 'class' => 'wide_input', 'required' => true));
$Form->text_input($dummy_fields['subject'], $subject, 40, T_('Subject'), T_('Subject of your message.'), array('maxlength' => 255, 'class' => 'wide_input', 'required' => true));
$Form->textarea($dummy_fields['content'], $message, 15, T_('Message'), T_('Plain text only.'), 35, 'wide_textarea', true);
$Plugins->trigger_event('DisplayMessageFormFieldset', array('Form' => &$Form, 'recipient_ID' => &$recipient_id, 'item_ID' => $post_id, 'comment_ID' => $comment_id));
$Form->begin_fieldset();
?>
		<div class="input">
			<?php 
$Form->button_input(array('name' => 'submit_message_' . $recipient_id, 'class' => 'submit', 'value' => T_('Send message')));
$Plugins->trigger_event('DisplayMessageFormButton', array('Form' => &$Form, 'recipient_ID' => &$recipient_id, 'item_ID' => $post_id, 'comment_ID' => $comment_id));
?>
		</div>
		<?php 
$Form->end_fieldset();
?>

	<div class="clear"></div>

<?php 
$Form->end_form();
echo $Widget->replace_vars($template['block_start']);
// CALENDAR:
// Call the Calendar plugin:
$Plugins->call_by_code('evo_Calr', array('block_start' => '', 'block_end' => '', 'title' => '', 'link_type' => 'context', 'itemlist_prefix' => $pp));
echo $template['block_end'];
$Widget = new Widget();
$Widget->title = T_('Filters');
if ($ItemList->is_filtered()) {
    // List is filtered, offer option to reset filters:
    $Widget->global_icon(T_('Reset all filters!'), 'reset_filters', '?ctrl=items&amp;blog=' . $Blog->ID . '&amp;filter=reset', T_('Reset filters'), 4, 4, array('class' => 'action_icon btn btn-warning btn-sm'));
}
echo $Widget->replace_vars($template['block_start']);
$Form = new Form(NULL, 'resetform', 'get', 'none');
$Form->begin_form('');
$Form->hidden_ctrl();
$Form->button_input(array('tag' => 'button', 'value' => get_icon('filter') . ' ' . T_('Filter'), 'class' => 'search btn-info pull-right'));
$Form->hidden('tab', $tab);
$Form->hidden('blog', $Blog->ID);
echo '<fieldset class="clear">';
echo '<legend>' . T_('Posts to show') . '</legend>';
?>
		<div>

		<input type="checkbox" name="<?php 
echo $pp;
?>
show_past" value="1" id="ts_min" class="checkbox" <?php 
if ($show_past) {
    echo 'checked="checked" ';
}
?>
if ($ajax_form_enabled) {
    // ajax form is enabled, add hidden action param, because we will catch the form submit button action
    $Form->hidden('login_action', array('login' => 'login'));
}
$Form->hidden('crumb_loginform', '');
$Form->hidden('pwd_salt', '');
$Form->hidden('pwd_hashed', '');
$Form->hidden('source', $source);
$Form->hidden('inskin', true);
$Form->hidden('redirect_to', $redirect_to);
$Form->text_input($dummy_fields['login'], '', 18, T_('Login'), '', array('maxlength' => 255, 'class' => 'input_text', 'required' => true));
$Form->password_input($dummy_fields['pwd'], '', 18, T_('Password'), array('maxlength' => 70, 'class' => 'input_text', 'required' => true));
// Submit button and lost password link:
$submit_button = array('id' => 'submit_login_form', 'name' => 'login_action[login]', 'value' => T_('Log in!'), 'class' => 'submit');
$Form->begin_fieldset('', array('class' => 'fieldset field_login_btn'));
$Form->button_input($submit_button);
if ($Widget && $Widget->get_param('password_link_show')) {
    // Display a link to recovery password
    $lost_password_url = url_add_param(empty($Blog) ? $baseurl : $Blog->gen_blogurl(), 'disp=lostpassword');
    echo '<a href="' . $lost_password_url . '">' . $Widget->get_param('password_link') . '</a>';
}
$Form->end_fieldset();
$Form->end_form();
// Display only button to login if JS scripts or AJAX forms are disabled
echo $ajax_form_enabled ? '<noscript>' : '';
echo get_user_login_link('<br /><strong>', '</strong><br /><br />', T_('Login now...'), '#', $source, $redirect_to);
echo $ajax_form_enabled ? '</noscript>' : '';
if ($Widget && $Widget->get_param('register_link_show')) {
    // Display a link to register
    echo get_user_register_link('<span class="register_link">', '</span>', $Widget->get_param('register_link'), '#', true, $redirect_to, $source);
}