예제 #1
0
 function get_current_theme()
 {
     if ($this->theme == null) {
         CODOF\Util::get_config($this->db);
         $theme = CODOF\Util::get_opt('theme');
         $this->theme = $theme;
     }
     return $this->theme;
 }
예제 #2
0
function add_login_as($dom)
{
    $container = $dom->getElementById('codo_login_container');
    $sso_name = CODOF\Util::get_opt('sso_name');
    $html = <<<EOD
        <div class="row codo_sso">
          <div class="codo_sso_login_btn codo_sso_login_btn" id="codo_login_with_sso">with <span>{$sso_name}</span></div>
        </div>   
EOD;
    //prepend our code
    $container->innertext = $html . $container->innertext;
}
예제 #3
0
$smarty = \CODOF\Smarty\Single::get_instance();
$db = \DB::getPDO();
if (isset($_POST['theme']) && CODOF\Access\CSRF::valid($_POST['CSRF_token'])) {
    $cfgs = array();
    foreach ($_POST as $key => $value) {
        $query = "UPDATE " . PREFIX . "codo_config SET option_value=:value WHERE option_name=:key";
        $ps = $db->prepare($query);
        $ps->execute(array(':key' => $key, ':value' => $value));
        //echo $query."<br>\n";
    }
}
CODOF\Util::get_config($db);
$files = array();
if ($handle = opendir(THEME_DIR)) {
    $i = 0;
    $curr_theme = CODOF\Util::get_opt('theme');
    while (false !== ($entry = readdir($handle))) {
        if ($entry != "." && $entry != ".." && $entry != "index.html" && $entry != "default") {
            $entry = str_replace(".php", "", $entry);
            include DATA_PATH . 'themes/' . $entry . '/info.php';
            if ($curr_theme == $entry) {
                $files[$i]['active'] = true;
            } else {
                $files[$i]['active'] = false;
            }
            $files[$i]['name'] = $entry;
            $files[$i]['description'] = $info['description'];
            $files[$i]['thumb'] = A_DURI . 'themes/' . $entry . '/thumbnail.png';
            $i++;
        }
    }