コード例 #1
0
ファイル: themes3.php プロジェクト: erico-deh/ocPortal
/**
 * Delete a theme.
 *
 * @param  ID_TEXT		The theme name
 */
function actual_delete_theme($theme)
{
    if ($theme == 'default') {
        fatal_exit(do_lang_tempcode('INTERNAL_ERROR'));
    }
    global $CACHED_THEME;
    if (!is_null($CACHED_THEME) && $CACHED_THEME == $theme) {
        $CACHED_THEME = 'default';
    }
    require_code('abstract_file_manager');
    force_have_afm_details();
    afm_delete_directory('themes/' . $theme, true);
    $GLOBALS['SITE_DB']->query_delete('theme_images', array('theme' => $theme));
    log_it('DELETE_THEME', $theme);
}
コード例 #2
0
ファイル: zones3.php プロジェクト: erico-deh/ocPortal
/**
 * Delete a zone.
 *
 * @param  ID_TEXT		The name of the zone
 */
function actual_delete_zone($zone)
{
    if (get_file_base() != get_custom_file_base()) {
        warn_exit(do_lang_tempcode('SHARED_INSTALL_PROHIBIT'));
    }
    require_code('abstract_file_manager');
    force_have_afm_details();
    if (function_exists('set_time_limit')) {
        @set_time_limit(0);
    }
    disable_php_memory_limit();
    $pages = find_all_pages_wrap($zone, false, false, FIND_ALL_PAGES__ALL);
    $bad = array();
    foreach (array_keys($pages) as $page) {
        if (substr($page, 0, 6) != 'panel_' && $page != 'start') {
            $bad[] = $page;
        }
    }
    if ($bad != array()) {
        require_lang('zones');
        warn_exit(do_lang_tempcode('DELETE_ZONE_ERROR', '<kbd>' . implode('</kbd>, <kbd>', $bad) . '</kbd>'));
    }
    actual_delete_zone_lite($zone);
    if (file_exists(get_custom_file_base() . '/' . filter_naughty($zone))) {
        afm_delete_directory(filter_naughty($zone), true);
    }
}