$delete_notes[] = array(T_('WARNING: You are about to delete the default collection.'), 'warning');
        }
        if (($info_Blog =& get_setting_Blog('info_blog_ID')) && $info_Blog->ID == $edited_Blog->ID) {
            // Info blog
            $delete_notes[] = array(T_('WARNING: You are about to delete the collection used for info pages.'), 'warning');
        }
        if (($login_Blog =& get_setting_Blog('login_blog_ID')) && $login_Blog->ID == $edited_Blog->ID) {
            // Login blog
            $delete_notes[] = array(T_('WARNING: You are about to delete the collection used for login/registration pages.'), 'warning');
        }
        if (($msg_Blog =& get_setting_Blog('msg_blog_ID')) && $msg_Blog->ID == $edited_Blog->ID) {
            // Messaging blog
            $delete_notes[] = array(T_('WARNING: You are about to delete the collection used for messaging pages.'), 'warning');
        }
        $delete_notes[] = array(T_('Note: Some files in this collection\'s fileroot may be linked to users or to other collections posts and comments. Those files will ALSO be deleted, which may be undesirable!'), 'note');
        $edited_Blog->confirm_delete(sprintf(T_('Delete collection «%s»?'), $edited_Blog->get_name()), 'collection', $action, get_memorized('action'), $delete_notes);
        break;
    default:
        // List the blogs:
        $AdminUI->disp_payload_begin();
        // Display VIEW:
        switch ($tab) {
            case 'site_settings':
                $AdminUI->disp_view('collections/views/_coll_settings_site.form.php');
                break;
            case 'blog_settings':
                $AdminUI->disp_view('collections/views/_coll_settings_blog.form.php');
                break;
        }
        $AdminUI->disp_payload_end();
}
Beispiel #2
0
     // Find other users with the same email address
     $message_same_email_users = find_users_with_same_email($edited_User->ID, $edited_User->get('email'), T_('Note: this user has the same email address (%s) as: %s'));
     if ($message_same_email_users !== false) {
         $confirm_messages[] = array($message_same_email_users, 'note');
     }
     // Add a checkbox on deletion form
     $delete_form_params = array();
     if ($Settings->get('reportpm_enabled')) {
         // If this feature is enabled
         $user_count_reports = count(get_user_reported_user_IDs($edited_User->ID));
         if ($user_count_reports > 0) {
             // If the user has been reported at least one time
             $delete_form_params['before_submit_button'] = '<p><label>' . '<input type="checkbox" id="send_reportpm" name="send_reportpm" value="1"' . ($deltype == 'spammer' ? ' checked="checked"' : '') . ' /> ' . sprintf(T_('Send an info message to %s users who reported this account.'), $user_count_reports) . '</label></p>' . '<p><label>' . '<input type="checkbox" id="increase_spam_score" name="increase_spam_score" value="1"' . ($deltype == 'spammer' ? ' checked="checked"' : '') . ' /> ' . sprintf(T_('Increase spam fighter score for the %s users who reported this account.'), $user_count_reports) . '</label></p>';
         }
     }
     $edited_User->confirm_delete($msg, 'user', $action, get_memorized('action'), $confirm_messages, $delete_form_params);
     // Display user identity form:
     $AdminUI->disp_view('users/views/_user_identity.form.php');
     $AdminUI->disp_payload_end();
     // Init JS for user reporting
     echo_user_report_window();
     break;
 case 'promote':
 default:
     // Display user list:
     // NOTE: we don't want this (potentially very long) list to be displayed again and again)
     $AdminUI->disp_payload_begin();
     if ($tab == 'stats') {
         $AdminUI->disp_view('users/views/_user_stats.view.php');
     } else {
         $AdminUI->disp_view('users/views/_user_list.view.php');
Beispiel #3
0
$AdminUI->breadcrumbpath_add(T_('Countries'), '?ctrl=countries');
// Display <html><head>...</head> section! (Note: should be done early if actions do not redirect)
$AdminUI->disp_html_head();
// Display title, menu, messages, etc. (Note: messages MUST be displayed AFTER the actions)
$AdminUI->disp_body_top();
$AdminUI->disp_payload_begin();
/**
 * Display payload:
 */
switch ($action) {
    case 'nil':
        // Do nothing
        break;
    case 'delete':
        // We need to ask for confirmation:
        $edited_Country->confirm_delete(sprintf(T_('Delete country &laquo;%s&raquo;?'), $edited_Country->dget('name')), 'country', $action, get_memorized('action'));
    case 'new':
    case 'create':
    case 'create_new':
    case 'create_copy':
    case 'edit':
    case 'update':
        $AdminUI->disp_view('regional/views/_country.form.php');
        break;
    default:
        // No specific request, list all countries:
        // Cleanup context:
        forget_param('ctry_ID');
        // Display country list:
        $AdminUI->disp_view('regional/views/_country_list.view.php');
        break;
 * @copyright (c)2009-2015 by Francois Planque - {@link http://fplanque.com/}
 * Parts of this file are copyright (c)2009 by The Evo Factory - {@link http://www.evofactory.com/}.
 *
 * @package evocore
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
load_class('users/model/_userfieldgroup.class.php', 'UserfieldGroup');
/**
 * @var Userfield
 */
global $edited_UserfieldGroup;
// Determine if we are creating or updating...
global $action;
$creating = is_create_action($action);
$Form = new Form(NULL, 'userfieldgroup_checkchanges', 'post', 'compact');
$Form->global_icon(T_('Delete this user field group!'), 'delete', regenerate_url('action', 'action=delete&amp;' . url_crumb('userfieldgroup')));
$Form->global_icon(T_('Cancel editing!'), 'close', '?ctrl=userfields');
$Form->begin_form('fform', $creating ? T_('New user field group') : T_('User field group'));
$Form->add_crumb('userfieldgroup');
$Form->hiddens_by_key(get_memorized('action' . ($creating ? ',ufgp_ID' : '')));
// (this allows to come back to the right list order & page)
$Form->hidden('ufgp_ID', $edited_UserfieldGroup->ID);
$Form->text_input('ufgp_name', $edited_UserfieldGroup->name, 50, T_('Name'), '', array('maxlength' => 255, 'required' => true));
$Form->text_input('ufgp_order', $edited_UserfieldGroup->order, 50, T_('Order number'), '', array('maxlength' => 11, 'required' => true));
if ($creating) {
    $Form->end_form(array(array('submit', 'actionArray[create]', T_('Record'), 'SaveButton'), array('submit', 'actionArray[create_new]', T_('Record, then Create New'), 'SaveButton'), array('submit', 'actionArray[create_copy]', T_('Record, then Create Similar'), 'SaveButton')));
} else {
    $Form->end_form(array(array('submit', 'actionArray[update]', T_('Save Changes!'), 'SaveButton')));
}
Beispiel #5
0
$AdminUI->breadcrumbpath_add(T_('Conversations'), '?ctrl=threads');
// Display <html><head>...</head> section! (Note: should be done early if actions do not redirect)
$AdminUI->disp_html_head();
// Display title, menu, messages, etc. (Note: messages MUST be displayed AFTER the actions)
$AdminUI->disp_body_top();
$AdminUI->disp_payload_begin();
/**
 * Display payload:
 */
switch ($action) {
    case 'nil':
        // Do nothing
        break;
    case 'delete':
        // We need to ask for confirmation:
        $edited_Thread->confirm_delete(sprintf(T_('Delete thread &laquo;%s&raquo;?'), $edited_Thread->dget('title')), 'messaging_threads', $action, get_memorized('action'));
        $AdminUI->disp_view('messaging/views/_thread_list.view.php');
        break;
    case 'new':
    case 'create':
        $AdminUI->disp_view('messaging/views/_thread.form.php');
        break;
    default:
        // No specific request, list all threads:
        // Cleanup context:
        forget_param('thrd_ID');
        forget_param('msg_ID');
        // Display threads list:
        $AdminUI->disp_view('messaging/views/_thread_list.view.php');
        break;
}
Beispiel #6
0
$AdminUI->disp_html_head();
// Display title, menu, messages, etc. (Note: messages MUST be displayed AFTER the actions)
$AdminUI->disp_body_top();
// Begin payload block:
$AdminUI->disp_payload_begin();
/**
 * Display Payload:
 */
switch ($action) {
    case 'new':
        // Display VIEW:
        $AdminUI->disp_view('skins/views/_skin_list_available.view.php');
        break;
    case 'delete':
        // We need to ask for confirmation:
        $edited_Skin->confirm_delete(sprintf(T_('Uninstall skin &laquo;%s&raquo;?'), $edited_Skin->dget('name')), 'skin', $action, get_memorized('action'));
    case 'edit':
    case 'update':
        // we return in this state after a validation error
        // Display VIEW:
        $AdminUI->disp_view('skins/views/_skin.form.php');
        break;
    case 'list':
        // Display VIEW:
        $AdminUI->disp_view('skins/views/_skin_list.view.php');
        break;
}
// End payload block:
$AdminUI->disp_payload_end();
// Display body bottom, debug info and close </html>:
$AdminUI->disp_global_footer();
Beispiel #7
0
		<?php 
        break;
    case 'uninstall':
        // We come here either if the plugin requested a call to BeforeUninstallPayload() or if there are tables to be dropped {{{
        ?>

		<div class="panelinfo">

			<?php 
        $Form = new Form('', 'uninstall_plugin', 'post', 'compact');
        $Form->global_icon(T_('Cancel uninstall!'), 'close', regenerate_url());
        $Form->begin_form('fform', sprintf(T_('Uninstall plugin #%d (%s)'), $edit_Plugin->ID, $edit_Plugin->name));
        $Form->add_crumb('plugin');
        // We may need to use memorized params in the next page
        $Form->hiddens_by_key(get_memorized('action,plugin_ID'));
        $Form->hidden('action', 'uninstall');
        $Form->hidden('plugin_ID', $edit_Plugin->ID);
        $Form->hidden('uninstall_confirmed_drop', 1);
        if ($uninstall_tables_to_drop) {
            echo '<p>' . T_('Uninstalling this plugin will also delete its database tables:') . '</p>' . '<ul>' . '<li>' . implode('</li><li>', $uninstall_tables_to_drop) . '</li>' . '</ul>';
        }
        if ($uninstall_ok === NULL) {
            // Plugin requested this:
            $admin_Plugins->call_method($edit_Plugin->ID, 'BeforeUninstallPayload', $params = array('Form' => &$Form));
        }
        echo '<p>' . T_('THIS CANNOT BE UNDONE!') . '</p>';
        $Form->submit(array('', T_('I am sure!'), 'DeleteButton btn-danger'));
        $Form->end_form();
        ?>
}
/*
 * UPLOAD:
 */
if ($Settings->get('upload_enabled') && $current_User->check_perm('files', 'add', false, $fm_FileRoot)) {
    // Upload is enabled and we have permission to use it...
    echo "<!-- QUICK UPLOAD: -->\n";
    echo '<div class="toolbaritem">';
    $Form = new Form(NULL, '', 'post', 'none', 'multipart/form-data');
    $Form->begin_form();
    $Form->add_crumb('file');
    $Form->hidden('ctrl', 'upload');
    $Form->hidden('upload_quickmode', 1);
    // The following is mainly a hint to the browser.
    $Form->hidden('MAX_FILE_SIZE', $Settings->get('upload_maxkb') * 1024);
    $Form->hiddens_by_key(get_memorized('ctrl'));
    echo '<div>';
    echo '<span class="btn btn-default btn-file">';
    echo T_('Choose File') . '<input name="uploadfile[]" type="file" size="10" />';
    echo '</span> ';
    echo '<span>' . T_('No file selected') . '</span> &nbsp; ';
    echo '<input class="ActionButton btn btn-default" type="submit" value="&gt; ' . T_('Quick upload!') . '" />';
    echo '</div>';
    $Form->end_form();
    echo '</div>';
}
echo '<div class="clear"></div>';
echo '</div>';
echo '</td>';
?>
		</tr>
Beispiel #9
0
switch ($action) {
    case 'nil':
        // Display NO payload!
        break;
    case 'delete_user':
        // We need to ask for confirmation:
        $edited_User->confirm_delete(sprintf(T_('Delete user &laquo;%s&raquo; [%s]?'), $edited_User->dget('fullname'), $edited_User->dget('login')), $action, get_memorized('action'));
    case 'new_user':
    case 'view_user':
    case 'edit_user':
        // Display user form:
        $AdminUI->disp_view('users/views/_user.form.php');
        break;
    case 'delete_group':
        // We need to ask for confirmation:
        $edited_Group->confirm_delete(sprintf(T_('Delete group &laquo;%s&raquo;?'), $edited_Group->dget('name')), $action, get_memorized('action'));
    case 'new_group':
    case 'edit_group':
    case 'view_group':
        // Display group form:
        $AdminUI->disp_view('users/views/_group.form.php');
        break;
    case 'promote':
    default:
        // Display user list:
        // NOTE: we don't want this (potentially very long) list to be displayed again and again)
        $AdminUI->disp_payload_begin();
        $AdminUI->disp_view('users/views/_user_list.view.php');
        $AdminUI->disp_payload_end();
}
// Display body bottom, debug info and close </html>:
Beispiel #10
0
                 $messages_count = $edited_User->get_num_messages();
                 if ($messages_count > 0 && $current_User->check_perm('perm_messaging', 'abuse')) {
                     // Display a confirm message if curent user can delete the messages sent by the edited user
                     $confirm_message = sprintf(T_('Delete %d private messages sent by the user?'), $messages_count);
                 }
                 break;
             case 'delete_all_userdata':
                 if ($current_User->ID != $edited_User->ID && $edited_User->ID != 1) {
                     // User can NOT delete admin and own account
                     $confirm_message = T_('Delete user and all his contributions?');
                 }
                 break;
         }
         if (!empty($confirm_message)) {
             // Displays form to confirm deletion
             $DataObject->confirm_delete($confirm_message, 'user', $action, get_memorized('action'));
         }
     }
     $AdminUI->disp_view('users/views/_user_activity.view.php');
     $AdminUI->disp_payload_end();
     break;
 case 'deldata':
     if ($display_mode == 'js') {
         // Do not append Debuglog & Debug JSlog to response!
         $debug = false;
         $debug_jslog = false;
     }
     if ($display_mode != 'js') {
         $AdminUI->disp_payload_begin();
     }
     $user_tab = param('user_tab_from', 'string', 'profile');
Beispiel #11
0
}
// Display <html><head>...</head> section! (Note: should be done early if actions do not redirect)
$AdminUI->disp_html_head();
// Display title, menu, messages, etc. (Note: messages MUST be displayed AFTER the actions)
$AdminUI->disp_body_top();
$AdminUI->disp_payload_begin();
/**
 * Display payload:
 */
switch ($action) {
    case 'nil':
        // Do nothing
        break;
    case 'delete':
        // We need to ask for confirmation:
        $edited_Subregion->confirm_delete(sprintf(T_('Delete sub-region &laquo;%s&raquo;?'), $edited_Subregion->dget('name')), 'subregion', $action, get_memorized('action'));
    case 'new':
    case 'create':
    case 'create_new':
    case 'create_copy':
    case 'edit':
    case 'update':
        $AdminUI->disp_view('regional/views/_subregion.form.php');
        break;
    default:
        // No specific request, list all subregions:
        // Cleanup context:
        forget_param('subrg_ID');
        // Display subregions list:
        $AdminUI->disp_view('regional/views/_subregion_list.view.php');
        break;
Beispiel #12
0
}
// Display <html><head>...</head> section! (Note: should be done early if actions do not redirect)
$AdminUI->disp_html_head();
// Display title, menu, messages, etc. (Note: messages MUST be displayed AFTER the actions)
$AdminUI->disp_body_top();
$AdminUI->disp_payload_begin();
/**
 * Display payload:
 */
switch ($action) {
    case 'nil':
        // Do nothing
        break;
    case 'delete':
        // We need to ask for confirmation:
        $edited_Goal->confirm_delete(sprintf(T_('Delete goal &laquo;%s&raquo;?'), $edited_Goal->dget('name')), 'goal', $action, get_memorized('action'));
        /* no break */
    /* no break */
    case 'new':
    case 'copy':
    case 'create':
        // we return in this state after a validation error
    // we return in this state after a validation error
    case 'create_new':
        // we return in this state after a validation error
    // we return in this state after a validation error
    case 'create_copy':
        // we return in this state after a validation error
    // we return in this state after a validation error
    case 'edit':
    case 'update':
}
// Display <html><head>...</head> section! (Note: should be done early if actions do not redirect)
$AdminUI->disp_html_head();
// Display title, menu, messages, etc. (Note: messages MUST be displayed AFTER the actions)
$AdminUI->disp_body_top();
$AdminUI->disp_payload_begin();
/**
 * Display payload:
 */
switch ($action) {
    case 'nil':
        // Do nothing
        break;
    case 'delete':
        // We need to ask for confirmation:
        $edited_ItemStatus->confirm_delete(sprintf(T_('Delete Post Status &laquo;%s&raquo;?'), $edited_ItemStatus->dget('name')), 'itemstatus', $action, get_memorized('action'));
        /* no break */
    /* no break */
    case 'new':
    case 'create':
    case 'create_new':
    case 'create_copy':
    case 'edit':
    case 'update':
        // we return in this state after a validation error
        $AdminUI->disp_view('items/views/_itemstatus.form.php');
        break;
    default:
        // No specific request, list all post statuses:
        // Cleanup context:
        forget_param('pst_ID');
Beispiel #14
0
 /**
  * Event handler: Called when displaying the block in the "Tools" menu.
  *
  * @see Plugin::AdminToolPayload()
  */
 function AdminToolPayload($params)
 {
     $Form = new Form();
     $Form->begin_form('fform');
     $Form->add_crumb('tools');
     $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->hidden('action', 'geoip_find_country');
     echo '<p>' . T_('This tool finds all users that do not have a registration country yet and then assigns them a registration country based on their registration IP.') . '</p>';
     $Form->button(array('value' => T_('Find Registration Country for all Users NOW!')));
     if (!empty($this->text_from_AdminTabAction)) {
         // Display a report of executed action
         echo '<p><b>' . T_('Report') . ':</b></p>';
         echo $this->text_from_AdminTabAction;
     }
     $Form->end_form();
 }
 */
switch ($action) {
    case 'nil':
        // Do nothing
        break;
    case 'new':
    case 'copy':
    case 'create':
    case 'edit':
    case 'update':
    case 'delete':
        // Begin payload block:
        $AdminUI->disp_payload_begin();
        if ($action == 'delete') {
            // We need to ask for confirmation:
            $edited_GenericCategory->confirm_delete(sprintf(T_('Delete element &laquo;%s&raquo;?'), $edited_GenericCategory->dget('name')), 'element', $action, get_memorized('action'));
        }
        if ($form_below_list) {
            // Display list VIEW before form view:
            if (!empty($list_view_path)) {
                $AdminUI->disp_view($list_view_path);
            } else {
                $AdminUI->disp_view('generic/_generic_recursive_list.inc.php');
            }
        }
        // Display category edit form:
        if (!empty($edit_view_path)) {
            $AdminUI->disp_view($edit_view_path);
        } else {
            $AdminUI->disp_view('generic/_generic_category.form.php');
        }
$AdminUI->set_page_manual_link('organizations');
// Display <html><head>...</head> section! (Note: should be done early if actions do not redirect)
$AdminUI->disp_html_head();
// Display title, menu, messages, etc. (Note: messages MUST be displayed AFTER the actions)
$AdminUI->disp_body_top();
$AdminUI->disp_payload_begin();
/**
 * Display payload:
 */
switch ($action) {
    case 'nil':
        // Do nothing
        break;
    case 'delete':
        // We need to ask for confirmation:
        $edited_Organization->confirm_delete(sprintf(T_('Delete organization &laquo;%s&raquo;?'), $edited_Organization->dget('name')), 'organization', $action, get_memorized('action'));
        /* no break */
    /* no break */
    case 'new':
    case 'create':
    case 'create_new':
    case 'create_copy':
    case 'edit':
    case 'update':
        // we return in this state after a validation error
        $AdminUI->disp_view('users/views/_organization.form.php');
        break;
    default:
        // No specific request, list all organizations:
        // Cleanup context:
        forget_param('org_ID');
Beispiel #17
0
$AdminUI->breadcrumbpath_add(T_('Slugs'), '?ctrl=slugs');
// Display <html><head>...</head> section! (Note: should be done early if actions do not redirect)
$AdminUI->disp_html_head();
// Display title, menu, messages, etc. (Note: messages MUST be displayed AFTER the actions)
$AdminUI->disp_body_top();
$AdminUI->disp_payload_begin();
/**
 * Display payload:
 */
switch ($action) {
    case 'nil':
        // Do nothing
        break;
    case 'new':
    case 'edit':
        // Display slug form
        $AdminUI->disp_view('slugs/views/_slug.form.php');
        break;
    case 'delete':
        // We need to ask for confirmation:
        $edited_Slug->confirm_delete(sprintf(T_('Delete slug &laquo;%s&raquo;?'), $edited_Slug->dget('title')), 'slug', $action, get_memorized('action'));
        // NO BREAK
    // NO BREAK
    case 'list':
        // list slugs:
        $AdminUI->disp_view('slugs/views/_slug_list.view.php');
        break;
}
$AdminUI->disp_payload_end();
// Display body bottom, debug info and close </html>:
$AdminUI->disp_global_footer();
Beispiel #18
0
}
// Display <html><head>...</head> section! (Note: should be done early if actions do not redirect)
$AdminUI->disp_html_head();
// Display title, menu, messages, etc. (Note: messages MUST be displayed AFTER the actions)
$AdminUI->disp_body_top();
// Begin payload block:
$AdminUI->disp_payload_begin();
evo_flush();
if ($tab == "refsearches" && $tab3 == "intsearches") {
    switch ($action) {
        case 'nil':
            // Do nothing
            break;
        case 'delete':
            // We need to ask for confirmation:
            $edited_Goal->confirm_delete(sprintf(T_('Delete internal search item &laquo;%s&raquo;?'), $edited_intsearch->dget('keywords')), 'internalsearch', $action, get_memorized('action'));
            /* no break */
        /* no break */
        case 'new':
        case 'copy':
        case 'create':
            // we return in this state after a validation error
        // we return in this state after a validation error
        case 'create_new':
            // we return in this state after a validation error
        // we return in this state after a validation error
        case 'create_copy':
            // we return in this state after a validation error
        // we return in this state after a validation error
        case 'edit':
        case 'update':
Beispiel #19
0
// Display <html><head>...</head> section! (Note: should be done early if actions do not redirect)
$AdminUI->disp_html_head();
// Display title, menu, messages, etc. (Note: messages MUST be displayed AFTER the actions)
$AdminUI->disp_body_top();
$AdminUI->disp_payload_begin();
/**
 * Display payload:
 */
switch ($action) {
    case 'nil':
        // Do nothing
        break;
    case 'delete':
        if ($perm_abuse_management) {
            // Save a tab param for hidden fields of the form
            memorize_param('tab', 'string', 'abuse');
        }
        // We need to ask for confirmation:
        $edited_Message->confirm_delete(T_('Delete message?'), 'messaging_messages', $action, get_memorized('action'));
    default:
        // No specific request, list all messages:
        // Cleanup context:
        forget_param('msg_ID');
        // Display messages list:
        $action = $action == 'preview' ? $action : 'create';
        $AdminUI->disp_view('messaging/views/_message_list.view.php', array('messages_list_form_start' => '', 'messages_list_form_end' => '', 'messages_list_body_start' => '', 'messages_list_body_end' => ''));
        break;
}
$AdminUI->disp_payload_end();
// Display body bottom, debug info and close </html>:
$AdminUI->disp_global_footer();
Beispiel #20
0
 /**
  * TODO
  *
  */
 function disp_form()
 {
     global $ctrl, $action, $edited_name_maxlen, $form_below_list;
     // Determine if we are creating or updating...
     $creating = is_create_action($action);
     $Form =& new Form(NULL, 'form');
     if (!$form_below_list) {
         // We need to display a link to cancel editing:
         $Form->global_icon(T_('Cancel editing!'), 'close', regenerate_url('action'));
     }
     $Form->begin_form('fform', $creating ? T_('New element') : T_('Element'));
     $Form->hidden('action', $creating ? 'create' : 'update');
     $Form->hidden('ctrl', $ctrl);
     $Form->hiddens_by_key(get_memorized('action, ctrl'));
     $Form->text_input($this->dbprefix . 'name', $this->name, $edited_name_maxlen, T_('name'), '', array('required' => true));
     if (!$creating) {
         $Form->hidden($this->dbIDname, $this->ID);
     }
     if ($creating) {
         $Form->end_form(array(array('submit', 'submit', T_('Record'), 'SaveButton'), array('reset', '', T_('Reset'), 'ResetButton')));
     } else {
         $Form->end_form(array(array('submit', 'submit', T_('Update'), 'SaveButton'), array('reset', '', T_('Reset'), 'ResetButton')));
     }
 }
Beispiel #21
0
    die('Please, do not access this page directly.');
}
/**
 * @global string
 */
global $fm_mode;
/**
 * @global Filelist
 */
global $fm_source_Filelist;
/**
 * @global array
 */
global $new_names;
$Form =& new Form(NULL, 'fm_copymove_checkchanges');
$Form->global_icon(T_('Quit copy/move mode!'), 'close', regenerate_url('fm_sources,fm_mode'));
$Form->begin_form('fform', $fm_mode == 'file_copy' ? T_('Copy') : T_('Move'));
$Form->hidden_ctrl();
$Form->hiddens_by_key(get_memorized());
$Form->hidden('confirm', 1);
$fm_source_Filelist->restart();
while ($loop_src_File =& $fm_source_Filelist->get_next()) {
    $Form->begin_fieldset(T_('Source') . ': ' . $loop_src_File->get_rdfp_rel_path());
    if (isset($overwrite[$loop_src_File->get_md5_ID()])) {
        $Form->checkbox('overwrite[' . $loop_src_File->get_md5_ID() . ']', $overwrite[$loop_src_File->get_md5_ID()], T_('Overwrite'), T_('Check to overwrite the existing file'));
    }
    $Form->text('new_names[' . $loop_src_File->get_md5_ID() . ']', $new_names[$loop_src_File->get_md5_ID()], 32, T_('New name'), $loop_src_File->dget('title'), 128);
    $Form->end_fieldset();
}
$Form->end_form(array(array('submit', 'submit', $fm_mode == 'file_copy' ? T_('Copy') : T_('Move'), 'SaveButton'), array('reset', '', T_('Reset'), 'ResetButton')));
echo '<p class="notes"><strong>' . T_('You are in copy/move mode.') . '</strong> ' . T_('Please navigate to the desired target location.') . '</p>';
 */
global $LinkOwner;
global $edited_User;
global $Blog, $blog;
global $fm_mode, $fm_hide_dirtree, $create_name, $ads_list_path, $mode;
// Abstract data we want to pass through:
global $linkctrl, $linkdata;
// Name of the iframe we want some actions to come back to:
global $iframe_name;
$Form = new Form(NULL, 'FilesForm', 'post', 'none');
$Form->begin_form();
$Form->hidden_ctrl();
$Form->hidden('confirmed', '0');
$Form->hidden('md5_filelist', $fm_Filelist->md5_checksum());
$Form->hidden('md5_cwd', md5($fm_Filelist->get_ads_list_path()));
$Form->hiddens_by_key(get_memorized('fm_selected'));
// 'fm_selected' gets provided by the form itself
?>
<table class="filelist table table-striped table-bordered table-hover table-condensed">
	<thead>
	<?php 
/*****************  Col headers  ****************/
echo '<tr>';
// "Go to parent" icon
echo '<th class="firstcol">';
if (empty($fm_Filelist->_rds_list_path)) {
    // cannot go higher
    echo '&nbsp;';
    // for IE
} else {
    echo action_icon(T_('Go to parent folder'), 'folder_parent', regenerate_url('path', 'path=' . $fm_Filelist->_rds_list_path . '..'));
Beispiel #23
0
}
// Display <html><head>...</head> section! (Note: should be done early if actions do not redirect)
$AdminUI->disp_html_head();
// Display title, menu, messages, etc. (Note: messages MUST be displayed AFTER the actions)
$AdminUI->disp_body_top();
$AdminUI->disp_payload_begin();
/**
 * Display payload:
 */
switch ($action) {
    case 'nil':
        // Do nothing
        break;
    case 'new':
    case 'edit':
        // Display tag form
        $AdminUI->disp_view('items/views/_itemtag.form.php');
        break;
    case 'delete':
        // We need to ask for confirmation:
        $edited_ItemTag->confirm_delete(sprintf(T_('Delete tag "%s"?'), '<b>' . $edited_ItemTag->dget('name') . '</b>'), 'tag', $action, get_memorized('action'));
        // NO BREAK
    // NO BREAK
    case 'list':
        // list tags:
        $AdminUI->disp_view('items/views/_itemtags.view.php');
        break;
}
$AdminUI->disp_payload_end();
// Display body bottom, debug info and close </html>:
$AdminUI->disp_global_footer();
Beispiel #24
0
$AdminUI->breadcrumbpath_add(T_('Settings'), '?ctrl=fileset');
$AdminUI->breadcrumbpath_add(T_('File types'), '?ctrl=filetypes');
// Display <html><head>...</head> section! (Note: should be done early if actions do not redirect)
$AdminUI->disp_html_head();
// Display title, menu, messages, etc. (Note: messages MUST be displayed AFTER the actions)
$AdminUI->disp_body_top();
/**
 * Display payload:
 */
switch ($action) {
    case 'nil':
        // Do nothing
        break;
    case 'delete':
        // We need to ask for confirmation:
        $edited_Filetype->confirm_delete(sprintf(T_('Delete file type &laquo;%s&raquo;?'), $edited_Filetype->dget('name')), 'filetype', $action, get_memorized('action'));
        /* no break */
    /* no break */
    case 'new':
    case 'copy':
    case 'create':
        // we return in this state after a validation error
    // we return in this state after a validation error
    case 'edit':
    case 'update':
        // we return in this state after a validation error
        $AdminUI->disp_payload_begin();
        $AdminUI->disp_view('files/views/_filetype.form.php');
        $AdminUI->disp_payload_end();
        break;
    default:
$AdminUI->breadcrumbpath_add(T_('User fields configuration'), '?ctrl=userfields');
// Display <html><head>...</head> section! (Note: should be done early if actions do not redirect)
$AdminUI->disp_html_head();
// Display title, menu, messages, etc. (Note: messages MUST be displayed AFTER the actions)
$AdminUI->disp_body_top();
$AdminUI->disp_payload_begin();
/**
 * Display payload:
 */
switch ($action) {
    case 'nil':
        // Do nothing
        break;
    case 'delete':
        // We need to ask for confirmation:
        $edited_UserfieldGroup->confirm_delete(sprintf(T_('Delete user field &laquo;%s&raquo;?'), $edited_UserfieldGroup->dget('name')), 'userfieldgroup', $action, get_memorized('action'));
        /* no break */
    /* no break */
    case 'new':
    case 'create':
    case 'create_new':
    case 'create_copy':
    case 'edit':
    case 'update':
        // we return in this state after a validation error
        $AdminUI->disp_view('users/views/_userfieldsgroup.form.php');
        break;
    default:
        // No specific request, list all user fields:
        // Cleanup context:
        forget_param('ufgp_ID');
<?php

/**
 * This file is part of b2evolution - {@link http://b2evolution.net/}
 * See also {@link https://github.com/b2evolution/b2evolution}.
 *
 * @license GNU GPL v2 - {@link http://b2evolution.net/about/gnu-gpl-license}
 *
 * @copyright (c)2009-2015 by Francois Planque - {@link http://fplanque.com/}
 * Parts of this file are copyright (c)2009 by The Evo Factory - {@link http://www.evofactory.com/}.
 *
 * Released under GNU GPL License - {@link http://b2evolution.net/about/gnu-gpl-license}
 *
 * @package maintenance
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
global $updates, $UserSettings;
$Form = new Form(NULL, 'upgrade_form', 'post', 'compact');
$Form->add_crumb('upgrade_export');
$Form->hiddens_by_key(get_memorized('action'), array('svn_url', 'svn_folder', 'svn_user', 'svn_password', 'svn_revision'));
$Form->begin_form('fform', T_('Upgrade from SVN') . get_manual_link('upgrade-from-svn'));
$Form->text_input('svn_url', $UserSettings->get('svn_upgrade_url'), 80, T_('URL of repository'), T_('e.g. https://server.com/svn/repository/'), array('maxlength' => 300, 'required' => true));
$Form->text_input('svn_folder', $UserSettings->get('svn_upgrade_folder'), 80, T_('SVN folder'), T_('e.g. trunk/blogs/'), array('maxlength' => 300));
$Form->text_input('svn_user', $UserSettings->get('svn_upgrade_user'), 32, T_('Login'), '', array('maxlength' => 300));
$Form->password_input('svn_password', get_param('svn_password'), 32, T_('Password'), '', array('maxlength' => 300));
$Form->text_input('svn_revision', $UserSettings->get('svn_upgrade_revision'), 7, T_('Revision'), T_('Leave blank to get the latest revision'));
$Form->end_form(array(array('submit', 'actionArray[export_svn]', T_('Export revision from SVN...'), 'SaveButton')));
Beispiel #27
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->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();
 }
}
// Display <html><head>...</head> section! (Note: should be done early if actions do not redirect)
$AdminUI->disp_html_head();
// Display title, menu, messages, etc. (Note: messages MUST be displayed AFTER the actions)
$AdminUI->disp_body_top();
$AdminUI->disp_payload_begin();
/**
 * Display payload:
 */
switch ($action) {
    case 'nil':
        // Do nothing
        break;
    case 'delete':
        // We need to ask for confirmation:
        $edited_Invitation->confirm_delete(sprintf(T_('Delete invitation code &laquo;%s&raquo;?'), $edited_Invitation->dget('code')), 'invitation', $action, get_memorized('action'));
        /* no break */
    /* no break */
    case 'new':
    case 'create':
    case 'create_new':
    case 'create_copy':
    case 'edit':
    case 'update':
        // we return in this state after a validation error
        $AdminUI->disp_view('users/views/_invitation.form.php');
        break;
    default:
        // No specific request, list all invitation codes:
        // Cleanup context:
        forget_param('ivc_ID');
Beispiel #29
0
 * @copyright (c)2003-2015 by Francois Planque - {@link http://fplanque.com/}
 *
 * @package admin
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
global $localtimenow, $edited_Cronjob;
// Determine if we are creating or updating...
global $action;
$creating = is_create_action($action);
$Form = new Form(NULL, 'cronjob');
$Form->global_icon(T_('Cancel!'), 'close', regenerate_url('action'));
$Form->begin_form('fform', $creating ? T_('New scheduled job') : T_('Edit scheduled job'));
$Form->add_crumb('crontask');
$Form->hiddens_by_key(get_memorized('action'));
$Form->hidden('action', $creating ? 'create' : 'update');
$Form->begin_fieldset(T_('Job details') . get_manual_link('scheduled-job-form'));
if ($creating && $action != 'copy') {
    // New cronjob
    $cron_jobs_names = get_cron_jobs_config('name');
    // Exclude these cron jobs from manual creating
    unset($cron_jobs_names['send-post-notifications']);
    unset($cron_jobs_names['send-comment-notifications']);
    $Form->select_input_array('cjob_type', get_param('cjob_type'), $cron_jobs_names, T_('Job type'));
} else {
    // Edit cronjob
    if ($action == 'edit') {
        $Form->info(T_('Job #'), $edited_Cronjob->ID);
    }
    $Form->info(T_('Default job name'), cron_job_name($edited_Cronjob->key, '', $edited_Cronjob->params));
Beispiel #30
0
 /**
  * Event handler: Called when displaying the block in the "Tools" menu.
  *
  * @see Plugin::AdminToolPayload()
  */
 function AdminToolPayload($params)
 {
     $action = param_action();
     echo '<a name="geoip" style="position:relative;top:-60px"></a>';
     switch ($action) {
         case 'geoip_download':
             // Display a process of downloading of GeoIP.dat
             global $admin_url;
             $this->print_tool_log(sprintf(T_('Downloading GeoIP.dat file from the url: %s ...'), '<a href="' . $this->geoip_download_url . '" target="_blank">' . $this->geoip_download_url . '</a>'));
             // DOWNLOAD:
             $gzip_contents = fetch_remote_page($this->geoip_download_url, $info, 1800);
             if ($gzip_contents === false || $info['status'] != 200) {
                 // Downloading is Failed
                 if (empty($info['error'])) {
                     // Some unknown error
                     $this->print_tool_log(T_('The URL is not available. It may correspond to an old version of the GeoIP.dat file.'), 'error');
                 } else {
                     // Display an error of request
                     $this->print_tool_log(T_($info['error']), 'error');
                 }
                 break;
             }
             $this->print_tool_log(' OK.<br />');
             $plugin_dir = dirname(__FILE__);
             if (!is_writable($plugin_dir)) {
                 // Check the write rights
                 $this->print_tool_log(sprintf(T_('Plugin folder %s must be writable to receive GeoIP.dat. Please fix the write permissions and try again.'), '<b>' . $plugin_dir . '</b>'), 'error');
                 break;
             }
             $gzip_file_name = explode('/', $this->geoip_download_url);
             $gzip_file_name = $gzip_file_name[count($gzip_file_name) - 1];
             $gzip_file_path = $plugin_dir . '/' . $gzip_file_name;
             if (!save_to_file($gzip_contents, $gzip_file_path, 'w')) {
                 // Impossible to save file...
                 $this->print_tool_log(sprintf(T_('Unable to create file: %s'), '<b>' . $gzip_file_path . '</b>'), 'error');
                 if (file_exists($gzip_file_path)) {
                     // Remove file from disk
                     if (!@unlink($gzip_file_path)) {
                         // File exists without the write rights
                         $this->print_tool_log(sprintf(T_('Unable to remove file: %s'), '<b>' . $gzip_file_path . '</b>'), 'error');
                     }
                 }
                 break;
             }
             // UNPACK:
             $this->print_tool_log(sprintf(T_('Extracting of the file %s...'), '<b>' . $gzip_file_path . '</b>'));
             if (!function_exists('gzopen')) {
                 // No extension
                 $this->print_tool_log(T_('There is no \'zip\' or \'zlib\' extension installed!'), 'error');
                 break;
             }
             if (!($gzip_handle = @gzopen($gzip_file_path, 'rb'))) {
                 // Try to open gzip file
                 $this->print_tool_log(T_('Could not open the source file!'), 'error');
                 break;
             }
             if (!($out_handle = @fopen($plugin_dir . '/' . str_replace('.gz', '', $gzip_file_name), 'w'))) {
                 $this->print_tool_log(sprintf(T_('The file %s cannot be written to disk. Please check the filesystem permissions.'), '<b>' . $plugin_dir . '/' . str_replace('.gz', '', $gzip_file_name) . '</b>'), 'error');
                 break;
             }
             $i = 0;
             while (!gzeof($gzip_handle)) {
                 // Extract file by 4Kb
                 fwrite($out_handle, gzread($gzip_handle, 4096));
                 if ($i == 100) {
                     // Display the process dots after each 400Kb
                     $this->print_tool_log(' .');
                     $i = 0;
                 }
                 $i++;
             }
             $this->print_tool_log(' OK.<br />');
             fclose($out_handle);
             gzclose($gzip_handle);
             $this->print_tool_log(sprintf(T_('Remove gzip file %s...'), '<b>' . $gzip_file_path . '</b>'));
             if (@unlink($gzip_file_path)) {
                 $this->print_tool_log(' OK.<br />');
             } else {
                 // Failed on removing
                 $this->print_tool_log(sprintf(T_('Impossible to remove the file %s. You can do it manually.'), $gzip_file_path), 'warning');
             }
             // Success message
             $this->print_tool_log('<br /><span class="text-success">' . sprintf(T_('%s file was downloaded successfully.'), 'GeoIP.dat') . '</span>');
             // Try to enable plugin automatically:
             global $Plugins;
             $enable_return = $this->BeforeEnable();
             if ($enable_return === true) {
                 // Success enabling
                 $this->print_tool_log('<br /><span class="text-success">' . T_('The plugin has been enabled.') . '</span>');
                 if ($this->status != 'enabled') {
                     // Enable this plugin automatically:
                     $Plugins->set_Plugin_status($this, 'enabled');
                 }
             } else {
                 // Some restriction for enabling
                 $this->print_tool_log('<br /><span class="text-warning">' . T_('The plugin could not be automatically enabled.') . '</span>');
                 if ($this->status != 'needs_config') {
                     // Make this plugin incomplete because it cannot be enabled:
                     $Plugins->set_Plugin_status($this, 'needs_config');
                 }
             }
             break;
         default:
             // Display a form to find countries for users
             if ($this->status != 'enabled') {
                 // Don't allow use this tool when GeoIP plugin is not enabled
                 echo '<p class="error">' . T_('You must enable the GeoIP plugin before to use this tool.') . '</p>';
                 break;
             }
             $Form = new Form();
             $Form->begin_form('fform');
             $Form->add_crumb('tools');
             $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->hidden('action', 'geoip_find_country');
             echo '<p>' . T_('This tool finds all users that do not have a registration country yet and then assigns them a registration country based on their registration IP.') . get_manual_link('geoip-plugin') . '</p>';
             $Form->button(array('value' => T_('Find Registration Country for all Users NOW!')));
             if (!empty($this->text_from_AdminTabAction)) {
                 // Display a report of executed action
                 echo '<p><b>' . T_('Report') . ':</b></p>';
                 echo $this->text_from_AdminTabAction;
             }
             $Form->end_form();
             break;
     }
 }