• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getConf函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getConf函数的典型用法代码示例。如果您正苦于以下问题:PHP getConf函数的具体用法?PHP getConf怎么用?PHP getConf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getConf函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: testTemplate

 public function testTemplate()
 {
     newConf('tpl', "\ncomponents:\n  tpl:\n    template_dir: " . dirname(__FILE__) . "/view\n    compile_dir:  " . dirname(__FILE__) . "/view/_compile\n    config_dir:   " . dirname(__FILE__) . "/view/_config\n    cache_dir:    " . dirname(__FILE__) . "/view/_cache\n");
     $site = new Site(getConf('tpl'));
     $site->tpl->display('test.tpl');
     killConf('tpl');
 }
开发者ID:ericpridham,项目名称:site,代码行数:7,代码来源:SiteTplTest.php


示例2: cron_main

/**
 * main cron function
 * @return string
 */
function cron_main()
{
    global $config;
    // always send reminders and reminders
    churchcore_sendReminders();
    churchcore_sendMails();
    if (getVar("standby")) {
        // email with feedback image
        if ($id = getVar("mailqueue_id")) {
            db_query("UPDATE {cc_mail_queue} \n                SET reading_count = reading_count + 1 \n                WHERE id=:id", array(":id" => $id));
        }
        // Check if it's time to do a normal cron job
        if (getConf("cronjob_delay") > 0) {
            $last_cron = db_query("SELECT value old,  UNIX_TIMESTAMP() act \n                             FROM {cc_config} \n                             WHERE name='last_cron'")->fetch();
            if ($last_cron) {
                if ($last_cron->act - $config["cronjob_delay"] > $last_cron->old) {
                    db_query("UPDATE {cc_config} \n                    SET VALUE= UNIX_TIMESTAMP() \n                    WHERE name='last_cron'");
                    do_cron();
                }
            }
        }
        header('Content-Type: image/gif');
        //tiniest transparent GIF, credit: http://probablyprogramming.com/2009/03/15/the-tiniest-gif-ever
        echo base64_decode('R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==');
    } else {
        do_cron();
        if (getVar("manual")) {
            addInfoMessage(t("cronjob.succeed"));
            return " ";
        }
    }
}
开发者ID:toXel,项目名称:churchtools_basic,代码行数:36,代码来源:cron.php


示例3: getMasterData

 /**
  * @see CTModuleInterface::getMasterData()
  */
 public function getMasterData()
 {
     global $user;
     $res = array();
     include_once CHURCHCAL . '/churchcal_db.php';
     $res = $this->getMasterDataTables();
     $res["masterDataTables"] = $this->getMasterDataTablenames();
     $res["entriesLastDays"] = getConf("churchresource_entries_last_days", 90);
     $res["auth"] = churchresource_getAuthForAjax();
     $res["status"] = churchcore_getTableData("cr_status");
     $res["minutes"] = churchcore_getTableData("cr_minutes");
     $res["hours"] = churchcore_getTableData("cr_hours");
     $res["repeat"] = churchcore_getTableData("cc_repeat");
     $res["cdb_bereich"] = churchcore_getTableData("cdb_bereich");
     $res["cdb_status"] = churchcore_getTableData("cdb_status");
     $res["cdb_station"] = churchcore_getTableData("cdb_station");
     $res["modulename"] = $this->getModuleName();
     $res["modulespath"] = $this->getModulePath();
     $res["userid"] = $user->cmsuserid;
     // CMS Username#
     $res["user_pid"] = $user->id;
     $res["user_name"] = "{$user->vorname} {$user->name}";
     $res["settings"] = $this->getSettings();
     $res["lastLogId"] = churchresource_getLastLogId();
     $res["churchcal_name"] = getConf('churchcal_name');
     $res["category"] = churchcore_getTableData("cc_calcategory", null, null, "id, color, bezeichnung");
     $res["views"] = array("WeekView" => array("filename" => "cr_weekview"), "MaintainView" => array("filename" => "cr_maintainview"));
     return $res;
 }
开发者ID:toXel,项目名称:churchtools_basic,代码行数:32,代码来源:CTChurchResourceModule.class.php


示例4: testDataFiles

    public function testDataFiles()
    {
        newConf('df', "components:\n  df:\n    files_path: /var/www/imagineapuddle.com/www/siteplay/site/test/files/\n");
        if (!file_exists(dirname(__FILE__) . '/files/')) {
            mkdir(dirname(__FILE__) . '/files/');
        }
        if (!file_exists(dirname(__FILE__) . '/files/test/')) {
            mkdir(dirname(__FILE__) . '/files/test/');
        }
        file_put_contents(dirname(__FILE__) . '/files/test/testfile', 'Title: A Bing-a-bong
Bar Biz: Bang

Content
');
        $site = new Site(getConf('df'));
        $this->assertType('SiteDataFilesController', $site->df);
        $this->assertType('SiteDataFiles', $site->df->test);
        $f = $site->df->test->get(array('title' => 'A Bing-a-bong'));
        $this->assertType('SiteDataFile', $f);
        $this->assertEquals($f->title, 'A Bing-a-bong');
        $this->assertEquals($f->bar_biz, 'Bang');
        $this->assertEquals($f->content, "Content\n");
        $f = $site->df->test->get(array('title' => 'Not-a-Title'));
        $this->assertNull($f);
        unlink(dirname(__FILE__) . '/files/test/.index');
        unlink(dirname(__FILE__) . '/files/test/testfile');
        rmdir(dirname(__FILE__) . '/files/test/');
        rmdir(dirname(__FILE__) . '/files/');
        killConf('df');
    }
开发者ID:ericpridham,项目名称:site,代码行数:30,代码来源:SiteDFTest.php


示例5: getMasterData

 /**
  *
  * @see CTModuleInterface::getMasterData()
  */
 public function getMasterData()
 {
     global $user, $base_url, $files_dir, $config;
     include_once CHURCHCAL . '/churchcal_db.php';
     $auth = churchservice_getAuthorization();
     $res = $this->getMasterDataTables();
     $res["masterDataTables"] = $this->getMasterDataTablenames();
     $res["auth"] = $auth;
     $res["modulespath"] = churchservice_getModulesPath();
     $res["base_url"] = $base_url;
     $res["files_url"] = $base_url . $files_dir;
     $res["files_dir"] = $files_dir;
     $res["modulename"] = "churchservice";
     $res["adminemail"] = getConf('site_mail', '');
     $res["user_pid"] = $user->id;
     $res["user_name"] = $user->vorname . " " . $user->name;
     $res["userid"] = $user->cmsuserid;
     $res["settings"] = churchservice_getUserSettings($user->id);
     $res["notification"] = churchcore_getMyNotifications();
     $res["notificationtype"] = churchcore_getTableData("cc_notificationtype");
     $res["lastLogId"] = churchservice_getLastLogId();
     $res["eventtemplate"] = churchcore_getTableData("cs_eventtemplate", "sortkey");
     $res["category"] = churchcal_getAllowedCategories(false);
     $res["repeat"] = churchcore_getTableData("cc_repeat");
     $res["eventtemplate_services"] = churchservice_getEventtemplateServices($auth);
     $res["churchcal_name"] = $config["churchcal_name"];
     $res["churchservice_name"] = $config["churchservice_name"];
     $res["songwithcategoryasdir"] = getConf("churchservice_songwithcategoryasdir", "0");
     $res["songcategory"] = churchcore_getTableData("cs_songcategory", "sortkey");
     $res["views"] = array("ListView" => array("filename" => "cs_listview"), "SettingsView" => array("filename" => "cs_settingsview"), "CalView" => array("filename" => "cs_calview"), "SongView" => array("filename" => "cs_songview"), "AgendaView" => array("filename" => "cs_agendaview"), "FactView" => array("filename" => "cs_factview"), "MaintainView" => array("filename" => "cs_maintainview"));
     return $res;
 }
开发者ID:toXel,项目名称:churchtools_basic,代码行数:36,代码来源:CTChurchServiceModule.class.php


示例6: testAddons

    public function testAddons()
    {
        newConf('addons', "\naddon_path: " . dirname(__FILE__) . "/addons1/:" . dirname(__FILE__) . "/addons2/\n");
        if (!file_exists(dirname(__FILE__) . '/addons1/')) {
            mkdir(dirname(__FILE__) . '/addons1/');
        }
        if (!file_exists(dirname(__FILE__) . '/addons2/')) {
            mkdir(dirname(__FILE__) . '/addons2/');
        }
        file_put_contents(dirname(__FILE__) . '/addons1/addon1.php', '
<?php
class SiteAddon1 extends SiteComponent {
}
?>
');
        file_put_contents(dirname(__FILE__) . '/addons2/addon2.php', '
<?php
class SiteAddon2 extends SiteComponent {
}
?>
');
        $site = new Site(getConf('addons'));
        $this->assertType('SiteAddon1', $site->addon1);
        $this->assertType('SiteAddon2', $site->addon2);
        unlink(dirname(__FILE__) . '/addons1/addon1.php');
        unlink(dirname(__FILE__) . '/addons2/addon2.php');
        rmdir(dirname(__FILE__) . '/addons1/');
        rmdir(dirname(__FILE__) . '/addons2/');
        killConf('addons');
    }
开发者ID:ericpridham,项目名称:site,代码行数:30,代码来源:SiteTest.php


示例7: getMasterData

 /**
  * get MasterData
  *
  * @return array with objects
  *
  */
 public function getMasterData()
 {
     global $config;
     $res = array();
     $res["auth_table_plain"] = getAuthTable();
     foreach ($res["auth_table_plain"] as $auth) {
         if ($auth->datenfeld && !isset($res[$auth->datenfeld])) {
             $res[$auth->datenfeld] = churchcore_getTableData($auth->datenfeld);
         }
     }
     $res["modules"] = churchcore_getModulesSorted(true, false);
     $res["person"] = churchcore_getTableData("cdb_person", "name, vorname", null, "id, concat(name, ', ', vorname) as bezeichnung");
     $res["person"][-1] = new stdClass();
     $res["person"][-1]->id = -1;
     $res["person"][-1]->bezeichnung = "- " . t("public.user") . " -";
     $res["publiccalendar_name"] = getConf("churchcal_maincalname", "Church Calendar");
     $res["gruppe"] = churchcore_getTableData("cdb_gruppe", null, null, "id, bezeichnung");
     $res["status"] = churchcore_getTableData("cdb_status");
     $res["category"] = churchcore_getTableData("cc_calcategory", null, null, "id, bezeichnung, privat_yn, oeffentlich_yn");
     $res["modulename"] = "churchcore";
     $res["admins"] = $config["admin_ids"];
     $auths = churchcore_getTableData("cc_domain_auth");
     if ($auths) {
         foreach ($auths as $auth) {
             $domaintype = array();
             // initalize $res[domain_tye]
             if (isset($res[$auth->domain_type])) {
                 $domaintype = $res[$auth->domain_type];
             }
             $object = new stdClass();
             if (isset($domaintype[$auth->domain_id])) {
                 $object = $domaintype[$auth->domain_id];
             } else {
                 $object->id = $auth->domain_id;
                 if (isset($db[$auth->domain_type][$auth->domain_id])) {
                     $object->bezeichnung = $db[$auth->domain_type][$auth->domain_id]->bezeichnung;
                 } else {
                     $object->bezeichnung = t("non.existent");
                 }
             }
             if ($auth->daten_id == null) {
                 $object->auth[$auth->auth_id] = $auth->auth_id;
             } else {
                 if (!isset($object->auth[$auth->auth_id])) {
                     $object->auth[$auth->auth_id] = array();
                 }
                 $object->auth[$auth->auth_id][$auth->daten_id] = $auth->daten_id;
             }
             $domaintype[$auth->domain_id] = $object;
             $res[$auth->domain_type] = $domaintype;
         }
     }
     foreach (churchcore_getModulesSorted() as $name) {
         if (isset($config[$name . "_name"])) {
             $res["names"][$name] = $config[$name . "_name"];
         }
     }
     return $res;
 }
开发者ID:toXel,项目名称:churchtools_basic,代码行数:65,代码来源:CTAuthModule.class.php


示例8: getOverloadConf

/**
 * Get overloaded configuration value
 *
 * @param string $path Config path
 *
 * @return null|string
 */
function getOverloadConf($path)
{
    include __DIR__ . "/../includes/config_overload.php";
    if (empty($dPconfig)) {
        return null;
    }
    return getConf($path, $dPconfig);
}
开发者ID:fbone,项目名称:mediboard4,代码行数:15,代码来源:getConfig.php


示例9: __construct

 public function __construct()
 {
     $application = getConf();
     $database = getConf()['database'];
     $host = getConf()['host'];
     $port = getConf()['port'];
     parent::__construct("mysql:dbname={$database};" . "host={$host};" . "port={$port};", getConf()['user'], getConf()['password']);
 }
开发者ID:bigeyessolution,项目名称:FestivalEdesio,代码行数:8,代码来源:Database.php


示例10: parseaddons

function parseaddons($addonspath, $filename, $shop_lang)
{
    global $modx, $modulea, $moduleid, $tables, $tsvshop;
    $out = "";
    $tmp = "";
    $temp = "";
    $num = 1;
    $lang = isset($lang) ? $lang : $modx->config['manager_language'];
    //$filename=$modx->config['base_path'].'assets/snippets/tsvshop/admin/tpl/addonstable.tpl';
    $tpl = get_file_contents($filename);
    if (!empty($addonspath) && !empty($filename)) {
        $folders = scandir($addonspath, 1);
        foreach ($folders as $folder) {
            if ($folder != "." && $folder != ".." && file_exists($addonspath . $folder . "/main.inc.php")) {
                $temp = str_replace('[+moduleid+]', $_GET['id'], $tpl);
                $temp = str_replace('[+lang+]', $lang, $temp);
                $temp = str_replace('[+num+]', $num++, $temp);
                $temp = str_replace('[+addon+]', $shop_lang[$folder . '_title'], $temp);
                if (is_install($folder)) {
                    if ($tables[$folder] == "system") {
                        $temp = str_replace('[+actions+]', '<img src="' . TSVSHOP_SURL . 'addons/addons/img/system.png" alt="" />', $temp);
                    } else {
                        $temp = str_replace('[+actions+]', '<a href="/' . MGR_DIR . '/index.php?id=' . $moduleid . '&a=' . $modulea . '&act=addonuninstall&addon=' . $folder . '" title="' . $shop_lang['addons_uninstall'] . '" onclick="uninstall(\'' . $shop_lang['addons_uninstall_question'] . '\');return false"><img src="' . TSVSHOP_SURL . 'addons/addons/img/uninstall.png" alt="' . $shop_lang['addons_uninstall'] . '" /></a>', $temp);
                    }
                    if (getConf("addons", $folder . "_active") == "yes") {
                        if ($tables[$folder] == "system") {
                            $temp = str_replace('[+status+]', '<img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="" /> <img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="" />', $temp);
                        } else {
                            $temp = str_replace('[+status+]', '<img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_on.png" alt="' . $shop_lang['addons_on'] . '" title="' . $shop_lang['addons_on'] . '" /> <a href="/' . MGR_DIR . '/index.php?id=' . $moduleid . '&a=' . $modulea . '&act=addonoff&addon=' . $folder . '" title="' . $shop_lang['addons_off_act'] . '"><img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="' . $shop_lang['addons_off_act'] . '" /></a>', $temp);
                        }
                    } else {
                        if ($tables[$folder] == "system") {
                            $temp = str_replace('[+status+]', '<img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="" /> <img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="" />', $temp);
                        } else {
                            $temp = str_replace('[+status+]', '<a href="/' . MGR_DIR . '/index.php?id=' . $moduleid . '&a=' . $modulea . '&act=addonon&addon=' . $folder . '" title="' . $shop_lang['addons_on_act'] . '"><img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="' . $shop_lang['addons_on_act'] . '" /></a> <img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_off.png" alt="' . $shop_lang['addons_off'] . '" title="' . $shop_lang['addons_off'] . '" />', $temp);
                        }
                    }
                } else {
                    if ($tables[$folder] == "system") {
                        $temp = str_replace('[+actions+]', '<img src="' . TSVSHOP_SURL . 'addons/addons/img/system.png" alt="" />', $temp);
                        $temp = str_replace('[+status+]', '<img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="' . $shop_lang['addons_on'] . '" title="' . $shop_lang['addons_on'] . '" /> <img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="' . $shop_lang['addons_on'] . '" title="' . $shop_lang['addons_on'] . '" />', $temp);
                    } else {
                        $temp = str_replace('[+actions+]', '<a href="/' . MGR_DIR . '/index.php?id=' . $moduleid . '&a=' . $modulea . '&act=addoninstall&addon=' . $folder . '" title="' . $shop_lang['addons_install'] . '"><img src="' . TSVSHOP_SURL . 'addons/addons/img/install.png" alt="' . $shop_lang['addons_install'] . '" /></a>', $temp);
                        $temp = str_replace('[+status+]', '<img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="' . $shop_lang['addons_on'] . '" title="' . $shop_lang['addons_on'] . '" /> <img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="' . $shop_lang['addons_on'] . '" title="' . $shop_lang['addons_on'] . '" />', $temp);
                    }
                }
                $temp = str_replace('[+description+]', $shop_lang[$folder . '_desc'], $temp);
                $out .= $temp;
            }
        }
        $out = preg_replace('/(\\[\\+.*?\\+\\])/', '', $out);
        return $out;
    } else {
        return "";
    }
}
开发者ID:myindexlike,项目名称:tsvshop,代码行数:56,代码来源:functions.inc.php


示例11: __construct

 public function __construct($modulename)
 {
     global $config;
     parent::__construct("AdminForm_{$modulename}", "admin_saveSettings");
     if ($m = getConf($modulename . "_name")) {
         $this->addField($modulename . "_inmenu", "", "CHECKBOX", t("add.to.menu", $m))->setValue(getConf($modulename . "_inmenu", "0"));
         $this->addField($modulename . "_startbutton", "", "CHECKBOX", t('show.as.button.on.home', $m))->setValue(getConf($modulename . "_startbutton", "0"));
         $this->addField($modulename . "_sortcode", "", "INPUT_REQUIRED", t('sortorder.in.menu'))->setValue(getConf($modulename . "_sortcode", "0"));
     }
 }
开发者ID:toXel,项目名称:churchtools_basic,代码行数:10,代码来源:CTModuleForm.class.php


示例12: getDatabaseConnection

function getDatabaseConnection()
{
    $conf = getConf();
    $db = $conf['db'];
    $databaseConnection = new mysqli($db['host'], $db['username'], $db['password'], $db['name']);
    if ($databaseConnection->connect_error) {
        throw new Exception("Could not connect to database.");
    }
    return $databaseConnection;
}
开发者ID:WBittner,项目名称:Warkle2,代码行数:10,代码来源:Connect.php


示例13: churchresource_getAdminForm

/**
 * form for admin seddings
 * @return CTModuleForm
 */
function churchresource_getAdminForm()
{
    global $config;
    $model = new CTModuleForm("churchresource");
    $model->addField("churchresource_entries_last_days", "", "INPUT_REQUIRED", t('data.from.x.how.many.days.in.the.past.to.load', 'ChurchResource'))->setValue($config["churchresource_entries_last_days"]);
    if (getConf("churchresource_send_emails", null) == null) {
        $config["churchresource_send_emails"] = true;
    }
    $model->addField("churchresource_send_emails", "", "CHECKBOX", t('enable.sending.emails'))->setValue($config["churchresource_send_emails"]);
    return $model;
}
开发者ID:toXel,项目名称:churchtools_basic,代码行数:15,代码来源:churchresource.php


示例14: logout_main

function logout_main()
{
    logout_current_user();
    // When called per tool (api), then offer a JSEND-answer
    if (isset($_POST['directtool'])) {
        include_once CHURCHCORE . '/churchcore_db.php';
        drupal_json_output(jsend()->success());
    } else {
        header("Location: ?q=" . getConf("site_startpage", "home"));
    }
}
开发者ID:toXel,项目名称:churchtools_basic,代码行数:11,代码来源:logout.php


示例15: testDBs

 public function testDBs()
 {
     newConf('dbs', "\ncomponents:\n  dbs:\n    rw:\n      model: true\n      pool:\n        - host: localhost\n          username: fake\n          password: fake\n          database: fake\n        - host: localhost\n          username: sitetest\n          password: st123\n          database: sitetest_rw2\n    ro:\n      model: true\n      host: localhost\n      username: sitetest\n      password: st123\n      database: sitetest_ro1\n\n    rw1:\n      model: true\n      host: localhost\n      username: sitetest\n      password: st123\n      database: sitetest_rw1\n    ro1:\n      model: true\n      host: localhost\n      username: sitetest\n      password: st123\n      database: sitetest_ro1\n");
     $site = new Site(getConf('dbs'));
     $this->assertType('SiteDatabase', $site->dbs->rw);
     $this->assertType('SiteDatabase', $site->dbs->ro);
     $this->assertFalse($site->dbs->rw === $site->dbs->ro);
     $this->assertType('null', $site->dbs->notadb);
     $site->dbs->ro1->ro1->all(1);
     $site->dbs->rw1->rw1->all(1);
     killConf('dbs');
 }
开发者ID:ericpridham,项目名称:site,代码行数:12,代码来源:SiteDBsTest.php


示例16: getMasterData

 /**
  * get master data
  * @see CTModuleInterface::getMasterData()
  */
 public function getMasterData()
 {
     global $user, $base_url, $files_dir, $config;
     $data["wikicategory"] = churchcore_getTableData("cc_wikicategory");
     $data["auth"] = churchwiki_getAuthForAjax();
     $data["settings"] = array();
     $data["masterDataTables"] = $this->getMasterDataTablenames();
     $data["files_url"] = $base_url . $files_dir;
     $data["files_dir"] = $files_dir;
     $data["modulename"] = "churchwiki";
     $data["modulespath"] = CHURCHWIKI;
     $data["adminemail"] = getConf('site_mail', '');
     return $data;
 }
开发者ID:toXel,项目名称:churchtools_basic,代码行数:18,代码来源:CTChurchWikiModule.class.php


示例17: POST

 public function POST()
 {
     $flag_pode_votar = TRUE;
     $message = '';
     $d1start = getConf()['dia1_inicio'];
     $d1end = getConf()['dia1_fim'];
     $d2start = getConf()['dia2_inicio'];
     $d2end = getConf()['dia2_fim'];
     $ctime = (new DateTime())->getTimestamp();
     $day = $d1start < $ctime and $ctime < $d1end ? 1 : $d2start < $ctime and $ctime < $d2end ? 2 : FALSE;
     //Fazer verificacoes
     if (!$day) {
         $flag_pode_votar = FALSE;
         $error = "NOTOPEN";
         $message = "Votações fechadas ou encerradas.";
     } elseif (!isset($_POST['idmusica']) or !isset($_POST['uuid'])) {
         $flag_pode_votar = FALSE;
         $error = "MISSING_PARAM";
         $message = "Parâmetros insuficientes.";
     } elseif (!Application::checkAuth()) {
         $flag_pode_votar = FALSE;
         $error = "NOT_AUTH";
         $message = "Dispositivo não autorizado para votação";
     } elseif (!podeVotar($_POST['uuid'], $day)) {
         //O uuid tem 0 votos no dia?
         $flag_pode_votar = FALSE;
         $error = "CANTVOTE";
         $message = "Dispositivo já votou em uma música hoje.";
     } elseif (!podeSerVotada($_POST['idmusica'], $day)) {
         $flag_pode_votar = FALSE;
         $error = "CANTVOTE";
         $message = "Esta música não existe ou não está disponível para votação";
     }
     if ($flag_pode_votar) {
         if (Database::getDatabase()->insert('votacao', array('idmusica'), array($_POST['idmusica']), array(PDO::PARAM_INT))) {
             $message = "Voto computado com sucesso!";
         } else {
             $flag_pode_votar = FALSE;
             $error = "SQLERR";
             $message = "Ocorreu um erro ao computar o voto.";
         }
     }
     $result['status'] = $flag_pode_votar ? 'OK' : 'ERROR';
     $result['message'] = $message;
     if (isset($error)) {
         $result['error'] = $error;
     }
     $this->setResult($result);
 }
开发者ID:bigeyessolution,项目名称:FestivalEdesio,代码行数:49,代码来源:Votacao.php


示例18: getMasterData

 /**
  * get master data
  * @see CTModuleInterface::getMasterData()
  *
  * @return array
  */
 public function getMasterData()
 {
     global $user, $base_url, $files_dir, $config;
     $res = churchdb_getMasterDataTables();
     $res["feldtyp"] = churchcore_getTableData("cdb_feldtyp");
     $res["fields"] = getAllFields();
     $res["groups"] = getAllGroups();
     $res["tags"] = getAllTags();
     $res["FUNachfolgeDomains"] = array("0" => array("id" => "0", "bezeichnung" => "Kein"), "1" => array("id" => "1", "bezeichnung" => $res["fields"]["f_group"]["fields"]["gruppentyp_id"]["text"]), "2" => array("id" => "2", "bezeichnung" => $res["fields"]["f_group"]["fields"]["distrikt_id"]["text"]), "3" => array("id" => "3", "bezeichnung" => t("group")));
     $res["groupMemberTypes"] = getGroupMemberTypes();
     $res["groupFilterTypes"] = churchdb_getGroupFilterTypes();
     // master data information for maintain masterdata and statistics
     if (user_access("edit masterdata", "churchdb") || user_access("view statistics", "churchdb")) {
         $res["masterDataTables"] = churchdb_getMasterDataTablenames();
     }
     $res["user_pid"] = $user->id;
     $res["userid"] = $user->vorname . " " . $user->cmsuserid . " [" . $user->id . "]";
     $res["auth"] = churchdb_getAuthForAjax();
     $res["site_name"] = getConf('site_name');
     $res["modulespath"] = churchdb_getModulesPath();
     $res["files_url"] = $base_url . $files_dir;
     $res["modulename"] = "churchdb";
     $res["max_uploadfile_size_kb"] = getConf('max_uploadfile_size_kb');
     $res["adminemail"] = getConf('site_mail', '');
     $res["max_exporter"] = getConf('churchdb_maxexporter', '150');
     $res["groupnotchoosable"] = getConf('churchdb_groupnotchoosable', 30);
     $res["home_lat"] = getConf('churchdb_home_lat', '53.568537');
     $res["home_lng"] = getConf('churchdb_home_lng', '10.03656');
     $res["settings"] = churchdb_getUserSettings($user->id);
     $res["last_log_id"] = churchdb_getLastLogId();
     $res["mailchimp"] = getConf('churchdb_mailchimp_apikey') != "";
     $res["views"] = array("ArchiveView" => array("filename" => "cdb_archiveview"), "MapView" => array("filename" => "cdb_mapview"), "StatisticView" => array("filename" => "cdb_statisticview"), "SettingsView" => array("filename" => "cdb_settingsview"), "MaintainView" => array("filename" => "cdb_maintainview"), "WeekView" => array("filename" => "../churchresource/cr_weekview"));
     if (user_access("administer persons", "churchcore")) {
         $res["auth_table"] = churchdb_getAuthTable();
     }
     if (isset($res["auth"]["edit newsletter"])) {
         $nl = churchdb_getTableData("cdb_newsletter");
         $newsletter = array();
         foreach ($res["auth"]["edit newsletter"] as $n) {
             $newsletter = $nl[$n];
         }
         $res["newsletter"] = $newsletter;
     }
     return $res;
 }
开发者ID:toXel,项目名称:churchtools_basic,代码行数:51,代码来源:CTChurchDBModule.class.php


示例19: getMasterData

 /**
  *
  * @see CTModuleInterface::getMasterData()
  */
 public function getMasterData()
 {
     global $user, $base_url, $files_dir, $config;
     $data["auth"] = $this->getAuthForAjax();
     $data["settings"] = array();
     $data["masterDataTables"] = $this->getMasterDataTablenames();
     $data["files_url"] = $base_url . $files_dir;
     $data["files_dir"] = $files_dir;
     $data["modulename"] = "churchreport";
     $data["modulespath"] = CHURCHREPORT;
     $data["adminemail"] = getConf('site_mail', '[email protected]');
     $queries = churchcore_getTableData("crp_query");
     $data["query"] = array();
     foreach ($queries as $query) {
         $data["query"][$query->id] = array("id" => $query->id, "sortkey" => $query->sortkey, "query_sql" => $query->query_sql, "bezeichnung" => $query->bezeichnung);
     }
     $data["report"] = churchcore_getTableData("crp_report");
     return $data;
 }
开发者ID:toXel,项目名称:churchtools_basic,代码行数:23,代码来源:CTChurchReportModule.class.php


示例20: getMasterData

 /**
  * get getMasterData
  */
 public function getMasterData()
 {
     global $user, $base_url;
     $ret = array();
     $ret["modulename"] = "churchcal";
     $ret["modulespath"] = CHURCHCAL;
     $ret["churchservice_name"] = getConf("churchservice_name");
     $ret["churchcal_name"] = getConf("churchcal_name");
     $ret["churchresource_name"] = getConf("churchresource_name");
     $ret["maincal_name"] = getConf("churchcal_maincalname", "Gemeindekalender");
     $ret["firstDayInWeek"] = getConf("churchcal_firstdayinweek", 1);
     $ret["notification"] = churchcore_getMyNotifications();
     $ret["notificationtype"] = churchcore_getTableData("cc_notificationtype");
     $ret["reminder"] = ct_getMyReminders($user->id, "event");
     $ret["base_url"] = $base_url;
     $ret["user_pid"] = $user->id;
     if (user_access("view", "churchdb")) {
         $ret["cdb_bereich"] = churchcore_getTableData("cdb_bereich");
         $ret["cdb_status"] = churchcore_getTableData("cdb_status");
         $ret["cdb_station"] = churchcore_getTableData("cdb_station");
         $ret["absent_reason"] = churchcore_getTableData("cs_absent_reason");
         foreach ($ret["absent_reason"] as $key => $reason) {
             if (isset($reason->color)) {
                 $ret["absent_reason"][$key]->textColor = getContrastYIQ($reason->color);
             }
         }
     }
     if (user_access("view", "churchresource") || user_access("create bookings", "churchresource")) {
         $ret["resources"] = churchcore_getTableData("cr_resource");
         $ret["resourceTypes"] = churchcore_getTableData("cr_resourcetype");
         $ret["bookingStatus"] = churchcore_getTableData("cr_status");
     }
     $ret["category"] = churchcal_getAllowedCategories(true);
     $ret["settings"] = churchcore_getUserSettings("churchcal", $user->id);
     $ret["repeat"] = churchcore_getTableData("cc_repeat");
     if (count($ret["settings"]) == 0) {
         $arr["checkboxEvents"] = "true";
         $ret["settings"] = $arr;
     }
     $ret["auth"] = churchcal_getAuthForAjax();
     $ret["views"] = array("WeekView" => array("filename" => "../churchresource/cr_weekview"));
     return $ret;
 }
开发者ID:toXel,项目名称:churchtools_basic,代码行数:46,代码来源:CTChurchCalModule.class.php



注:本文中的getConf函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getConfig函数代码示例发布时间:2022-05-15
下一篇:
PHP getComments函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap