コード例 #1
0
ファイル: smt_loader.php プロジェクト: raku/simitcms
@mysql_query("SET NAMES 'utf8'");
class Load
{
    function cur_theme()
    {
        return mysql_result(mysql_query('SELECT setting_value FROM settings WHERE setting_owner="theme_information" AND setting_name="current_theme" LIMIT 1'), 0);
    }
    function view($file_name, $data = null)
    {
        if (is_array($data)) {
            extract($data);
        }
        include 'templates/' . self::cur_theme() . '/' . $file_name;
    }
}
$path = 'templates/' . Load::cur_theme() . '/';
function smt_form($id)
{
    $id = (int) $id;
    $var = json_decode(mysql_result(mysql_query("SELECT setting_value FROM settings WHERE setting_owner='form_action' and setting_name='form{$id}'"), 0));
    $form = new form('POST', 'form.php', 'normalclass', $var->name);
    /*
    $selectId = $form->addSelect('select test','açıkla', TRUE);
    $form->addSelect_item($selectId,'item1val','bir');
    $form->addSelect_item($selectId,'item2val','iki');
    */
    foreach ($var->vars as $id => $var) {
        if ($var->type == 'text') {
            $form->addTextBox('text_test', 'tx_value', $var->name);
        } elseif ($var->type == 'mail') {
            $form->addTextBox('text_test', 'tx_value', $var->name);