Beispiel #1
0
/**
 * Perform action:
 */
switch ($action) {
    case 'create':
        param('skin_folder', 'string', true);
        // Check validity of requested skin name:
        if (preg_match('~([^-A-Za-z0-9._]|\\.\\.)~', $skin_folder)) {
            debug_die('The requested skin name is invalid.');
        }
        // Check that this action request is not a CSRF hacked request:
        $Session->assert_received_crumb('skin');
        // Check permission to edit:
        $current_User->check_perm('options', 'edit', true);
        // CREATE NEW SKIN:
        $edited_Skin =& skin_install($skin_folder);
        $Messages->add(T_('Skin has been installed.'), 'success');
        // We want to highlight the edited object on next list display:
        $Session->set('fadeout_array', array('skin_ID' => array($edited_Skin->ID)));
        // PREVENT RELOAD & Switch to list mode:
        header_redirect($redirect_to);
        break;
    case 'update':
        // Update skin properties:
        // Check that this action request is not a CSRF hacked request:
        $Session->assert_received_crumb('skin');
        // Check permission:
        $current_User->check_perm('options', 'edit', true);
        // Make sure we got an skin_ID:
        param('skin_ID', 'integer', true);
        // load data from request
/**
 * Install basic skins.
 */
function install_basic_skins($install_mobile_skins = true)
{
    load_funcs('skins/_skin.funcs.php');
    task_begin('Installing default skins... ');
    // Note: Skin #1 will we used by Home
    skin_install('bootstrap_main_skin');
    // Note: Skin #2 will we used by Blog A and Blog B
    skin_install('bootstrap_blog_skin');
    // Note: Skin #3 will we used by Photos
    skin_install('bootstrap_gallery_skin');
    // Note: Skin #4 will we used by Forums
    skin_install('bootstrap_forums_skin');
    // Note: Skin #5 will we used by Manual
    skin_install('bootstrap_manual_skin');
    skin_install('asevo');
    skin_install('dating_mood');
    skin_install('evocamp');
    skin_install('evopress');
    skin_install('forums');
    skin_install('manual');
    skin_install('photoalbums');
    skin_install('photoblog');
    skin_install('pixelgreen');
    skin_install('pureforums');
    if ($install_mobile_skins) {
        skin_install('touch');
    }
    skin_install('_atom');
    skin_install('_rss2');
    task_end();
}