Exemplo n.º 1
0
$returnLocation = "../admin/theme_list.php";
/**
 * Checking permissions
 */
require_once "../auth/login_check.php";
loginCheck(OPEN_PROFILE_ADMINISTRATOR);
/**
 * Checking for query string flag to read data from database.
 * This is only used when copying an existing theme.
 */
if (isset($_GET["id_theme"])) {
    $idTheme = intval($_GET["id_theme"]);
    include_once "../model/Query/Theme.php";
    $themeQ = new Query_Theme();
    $themeQ->select($idTheme);
    $theme = $themeQ->fetch();
    if ($theme) {
        $formVar["css_file"] = $theme->getCssFile();
        $filename = "../css/" . $theme->getCssFile();
        $fp = fopen($filename, 'r');
        $formVar["css_rules"] = fread($fp, filesize($filename));
        fclose($fp);
    } else {
        Error::fetch($themeQ, false);
    }
    $themeQ->freeResult();
    $themeQ->close();
    unset($themeQ);
    unset($theme);
} elseif (!isset($formError)) {
    $filename = "../css/" . "scheme.css";
Exemplo n.º 2
0
    /**
     * Theme use form
     */
    echo HTML::start('form', array('method' => 'post', 'action' => '../admin/theme_use.php'));
    echo Form::fieldset($legend, $body, $foot);
    echo HTML::end('form');
}
echo HTML::section(2, _("Themes List:"));
$thead = array(_("#"), _("Function") => array('colspan' => 5), _("Theme Name"), _("Usage"));
$validateLink = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
$validateLink = str_replace("/admin/", "/css/", $validateLink);
$validateLink = substr($validateLink, 0, strrpos($validateLink, "/") + 1);
$validateLink = "http://jigsaw.w3.org/css-validator/validator?uri=" . $validateLink;
$tbody = array();
$i = 0;
while ($theme = $themeQ->fetch()) {
    /**
     * Row construction
     */
    $row = ++$i . '.';
    $row .= OPEN_SEPARATOR;
    if ($theme->isCssReserved($theme->getCssFile())) {
        $row .= '**';
        //"** " . _("edit");
    } else {
        $row .= HTML::link(HTML::image('../img/action_edit.png', _("edit")), '../admin/theme_edit_form.php', array('id_theme' => $theme->getId()));
    }
    $row .= OPEN_SEPARATOR;
    $row .= HTML::link(HTML::image('../img/action_copy.png', _("copy")), '../admin/theme_new_form.php', array('id_theme' => $theme->getId()));
    $row .= OPEN_SEPARATOR;
    $row .= HTML::link(HTML::image('../img/action_view.png', _("preview")), '../admin/theme_preview.php', array('id_theme' => $theme->getId()), array('class' => 'popup'));