当前位置: 首页>>代码示例>>PHP>>正文


PHP UserSettings::getProperty方法代码示例

本文整理汇总了PHP中UserSettings::getProperty方法的典型用法代码示例。如果您正苦于以下问题:PHP UserSettings::getProperty方法的具体用法?PHP UserSettings::getProperty怎么用?PHP UserSettings::getProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserSettings的用法示例。


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

示例1: getNavigation

    public static function getNavigation($callerBadgerRoot)
    {
        global $badgerDb;
        NavigationFromDB::$callerBadgerRoot = $callerBadgerRoot;
        $settings = new UserSettings($badgerDb);
        $itemTypes = array('i' => 'item', 'm' => 'menu', 's' => 'separator');
        $sql = 'SELECT navi_id, parent_id, menu_order, item_type, item_name, tooltip, icon_url, command
			FROM navi
			ORDER BY parent_id, menu_order';
        $res =& $badgerDb->query($sql);
        $menus = array();
        $row = array();
        while ($res->fetchInto($row, DB_FETCHMODE_ASSOC)) {
            $menuId = $row['parent_id'];
            //create containing menu if it does not exist
            if (!isset($menus[$menuId])) {
                $menus[$menuId] = array();
            }
            //fill most of the fields
            $menus[$menuId][] = array('type' => $itemTypes[$row['item_type']], 'name' => getBadgerTranslation2("Navigation", $row['item_name']), 'tooltip' => $row['tooltip'], 'icon' => BADGER_ROOT . "/tpl/" . $settings->getProperty("badgerTemplate") . "/Navigation/" . $row['icon_url'], 'command' => NavigationFromDB::replaceBadgerRoot($row['command']));
            //if current row is a menu
            if ($row['item_type'] == 'm') {
                //create sub-menu if it does not exist
                if (!isset($menus[$row['navi_id']])) {
                    $menus[$row['navi_id']] = array();
                }
                //add menu field to the previously created item and assign a reference to the proper
                //sub-menu to it
                $menus[$menuId][count($menus[$menuId]) - 1]['menu'] =& $menus[$row['navi_id']];
            }
        }
        //All sub-menus are within element 0 as references
        return $menus[0];
    }
开发者ID:BackupTheBerlios,项目名称:badger-svn,代码行数:34,代码来源:NavigationFromDB.class.php

示例2: printInsert

function printInsert()
{
    global $tpl, $us, $badgerDb;
    $widgets = new WidgetEngine($tpl);
    $widgets->addNavigationHead();
    $insertTitle = getBadgerTranslation2('importExport', 'insertTitle');
    $updateInfo = '';
    echo $tpl->getHeader($insertTitle);
    $goToStartPagePreLink = getBadgerTranslation2('importExport', 'goToStartPagePreLink');
    $goToStartPageLinkText = getBadgerTranslation2('importExport', 'goToStartPageLinkText');
    $goToStartPagePostLink = getBadgerTranslation2('importExport', 'goToStartPagePostLink');
    if (!isset($_POST['confirmUpload']) || getGPC($_POST, 'confirmUpload') !== 'yes') {
        $insertMsg = getBadgerTranslation2('importExport', 'insertNoInsert');
    } else {
        if (!isset($_FILES['sqlDump']) || !is_uploaded_file($_FILES['sqlDump']['tmp_name'])) {
            $insertMsg = getBadgerTranslation2('importExport', 'insertNoFile');
        } else {
            $insertMsg = getBadgerTranslation2('importExport', 'insertSuccessful');
            $newerVersionMsg = getBadgerTranslation2('importExport', 'newerVersion');
            if (applySqlDump() === 'newerVersion') {
                eval(' $updateInfo = "' . $tpl->getTemplate('importExport/newerVersion') . '";');
            }
        }
    }
    $us = new UserSettings($badgerDb);
    $startPageURL = BADGER_ROOT . '/' . $us->getProperty('badgerStartPage');
    eval('echo "' . $tpl->getTemplate('importExport/insert') . '";');
    eval('echo "' . $tpl->getTemplate('badgerFooter') . '";');
}
开发者ID:BackupTheBerlios,项目名称:badger-svn,代码行数:29,代码来源:importExport.php

示例3: getAll

 /**
  * Returns all fields in an array.
  * 
  * The result has the following form:
  * array (
  *   array (
  *     'field name 0' => 'value of field 0',
  *     'field name 1' => 'value of field 1'
  *   )
  * );
  * 
  * The inner array is repeated for each row.
  * The fields need to be in the order returned by @link getFieldNames().
  * 
  * @return array A list of all fields.
  */
 public function getAll()
 {
     global $badgerDb;
     $us = new UserSettings($badgerDb);
     $tpl = new TemplateEngine($us, BADGER_ROOT);
     $widgets = new WidgetEngine($tpl);
     $currentLanguage = $us->getProperty('badgerLanguage');
     $result = array();
     switch ($this->type) {
         case 'transaction':
             $this->fetchTransactions();
             $sum = new Amount();
             foreach ($this->finishedTransactions as $currentTransaction) {
                 $sum->add($currentTransaction->getAmount());
                 $result[] = array('transactionId' => $currentTransaction->getId(), 'type' => $widgets->addImage($currentTransaction->getType() == 'FinishedTransaction' ? 'Account/finished_transaction.png' : 'Account/planned_transaction.png', 'title="' . getBadgerTranslation2('Account', $currentTransaction->getType()) . '"'), 'title' => $currentTransaction->getTitle(), 'description' => $currentTransaction->getDescription(), 'valutaDate' => ($tmp = $currentTransaction->getValutaDate()) ? $tmp->getFormatted() : '', 'amount' => $currentTransaction->getAmount()->getFormatted(), 'outsideCapital' => is_null($tmp = $currentTransaction->getOutsideCapital()) ? '' : $tmp, 'transactionPartner' => $currentTransaction->getTransactionPartner(), 'categoryId' => ($tmp = $currentTransaction->getCategory()) ? $tmp->getId() : '', 'categoryTitle' => ($tmp = $currentTransaction->getCategory()) ? $tmp->getTitle() : '', 'sum' => $sum->getFormatted());
             }
             break;
         case 'finished':
             while ($this->fetchNextFinishedTransaction()) {
             }
             foreach ($this->finishedTransactions as $currentTransaction) {
                 $result[] = array('finishedTransactionId' => $currentTransaction->getId(), 'title' => $currentTransaction->getTitle(), 'description' => $currentTransaction->getDescription(), 'valutaDate' => ($tmp = $currentTransaction->getValutaDate()) ? $tmp->getFormatted() : '', 'amount' => $currentTransaction->getAmount()->getFormatted(), 'outsideCapital' => is_null($tmp = $currentTransaction->getOutsideCapital()) ? '' : $tmp, 'transactionPartner' => $currentTransaction->getTransactionPartner(), 'categoryId' => ($tmp = $currentTransaction->getCategory()) ? $tmp->getId() : '', 'categoryTitle' => ($tmp = $currentTransaction->getCategory()) ? $tmp->getTitle() : '', 'exceptional' => is_null($tmp = $currentTransaction->getExceptional()) ? '' : $tmp, 'periodical' => is_null($tmp = $currentTransaction->getPeriodical()) ? '' : $tmp);
             }
             break;
         case 'planned':
             while ($this->fetchNextPlannedTransaction()) {
             }
             foreach ($this->plannedTransactions as $currentTransaction) {
                 $result[] = array('plannedTransactionId' => 'p' . $currentTransaction->getId() . '_X', 'title' => $currentTransaction->getTitle(), 'description' => $currentTransaction->getDescription(), 'amount' => $currentTransaction->getAmount()->getFormatted(), 'outsideCapital' => is_null($tmp = $currentTransaction->getOutsideCapital()) ? '' : $tmp, 'transactionPartner' => $currentTransaction->getTransactionPartner(), 'beginDate' => $currentTransaction->getBeginDate()->getFormatted(), 'endDate' => ($tmp = $currentTransaction->getEndDate()) ? $tmp->getFormatted() : '', 'repeatUnit' => getBadgerTranslation2('Account', $currentTransaction->getRepeatUnit()), 'repeatFrequency' => $currentTransaction->getRepeatFrequency(), 'categoryId' => ($tmp = $currentTransaction->getCategory()) ? $tmp->getId() : '', 'categoryTitle' => ($tmp = $currentTransaction->getCategory()) ? $tmp->getTitle() : '');
             }
             break;
     }
     return $result;
 }
开发者ID:BackupTheBerlios,项目名称:badger-svn,代码行数:50,代码来源:Account.class.php

示例4: UserSettings

*| |_) | /  \  | |  | | |  __| |__  | |__) |
*|  _ < / /\ \ | |  | | | |_ |  __| |  _  / 
*| |_) / ____ \| |__| | |__| | |____| | \ \ 
*|____/_/    \_\_____/ \_____|______|_|  \_\
* Open Source Financial Management
* Visit http://www.badger-finance.org 
*
**/
define("BADGER_ROOT", "..");
require_once BADGER_ROOT . "/includes/fileHeaderBackEnd.inc.php";
//require_once(BADGER_ROOT . "/core/UserSettings.class.php"); // sollte das nicht auch in die Includes??
header('Content-Type: text/javascript');
$badgerRoot = $_GET['badgerRoot'];
//we need this bagerRoot for images path
$settings = new UserSettings($badgerDb);
$badgerTemplate = $settings->getProperty("badgerTemplate");
//We do our best to get this cached
//header('Cache-Control: public');
//header('Expires: ' . date('r', time() + 24 * 60 * 60));
?>
 
//	written	by Tan Ling Wee
//	last updated 28 July 2003
//	email :	info@sparrowscripts.com
//	modified by ALQUANTO 30 July 2003 - german language included.
//									  - modified languageLogic with the ISO-2letter-strings
//									  - changes in in showCalendar: defaultLanguage is already set...
//									  - js and html corrected... more xhtml-compliant... simplier css
//	email: popcalendar@alquanto.de
//
//	modified by PinoToy 25 July 2003  - new logic for multiple languages (English, Spanish and ready for more).
开发者ID:BackupTheBerlios,项目名称:badger-svn,代码行数:31,代码来源:calendar.js.php

示例5: UserSettings

* ____          _____   _____ ______ _____  
*|  _ \   /\   |  __ \ / ____|  ____|  __ \ 
*| |_) | /  \  | |  | | |  __| |__  | |__) |
*|  _ < / /\ \ | |  | | | |_ |  __| |  _  / 
*| |_) / ____ \| |__| | |__| | |____| | \ \ 
*|____/_/    \_\_____/ \_____|______|_|  \_\
* Open Source Financial Management
* Visit http://www.badger-finance.org 
*
**/
define("BADGER_ROOT", "../..");
require_once BADGER_ROOT . "/includes/fileHeaderFrontEnd.inc.php";
require_once BADGER_ROOT . '/core/UserSettings.class.php';
$us = new UserSettings($badgerDb);
try {
    echo $us->getProperty('password') . "<br />\n";
} catch (BadgerException $ex) {
    echo "Exception!" . "<br />\n";
}
// set test 2
$us->setProperty('password', 'Hans');
echo $us->getProperty('password') . "<br />\n";
$us->setProperty('password', 'Paul');
echo $us->getProperty('password') . "<br />\n";
// set
$us->setProperty('123', 'Haus');
echo $us->getProperty('123') . "<br />\n";
// del
$us->delProperty('123');
try {
    echo $us->getProperty('123') . "<br />\n";
开发者ID:BackupTheBerlios,项目名称:badger-svn,代码行数:31,代码来源:UserSettingsTest.php

示例6: getAll

 /**
  * Returns all fields in an array.
  * 
  * The result has the following form:
  * array (
  *   array (
  *     'field name 0' => 'value of field 0',
  *     'field name 1' => 'value of field 1'
  *   )
  * );
  * 
  * The inner array is repeated for each row.
  * The fields need to be in the order returned by @link getFieldNames().
  * 
  * @return array A list of all fields.
  */
 public function getAll()
 {
     global $badgerDb;
     $us = new UserSettings($badgerDb);
     $tpl = new TemplateEngine($us, BADGER_ROOT);
     $widgets = new WidgetEngine($tpl);
     $currentLanguage = $us->getProperty('badgerLanguage');
     while ($this->fetchNextCategory()) {
     }
     $this->sortCategories();
     $result = array();
     foreach ($this->categories as $currentCategory) {
         $parent = $currentCategory->getParent();
         if (is_null($parent)) {
             $title = '';
             $parentId = '';
             $parentTitle = $currentCategory->getTitle();
         } else {
             $title = $currentCategory->getTitle();
             $parentId = $parent->getId();
             $parentTitle = $parent->getTitle();
         }
         if ($currentCategory->getOutsideCapital()) {
             $image = "Account/{$currentLanguage}/outside_capital.png";
             $tooltip = 'title="' . getBadgerTranslation2('CategoryManager', 'outsideCapital') . '"';
         } else {
             $image = "Account/{$currentLanguage}/own_capital.png";
             $tooltip = 'title="' . getBadgerTranslation2('CategoryManager', 'ownCapital') . '"';
         }
         $result[] = array('categoryId' => $currentCategory->getId(), 'title' => $title, 'description' => $currentCategory->getDescription(), 'outsideCapital' => $widgets->addImage($image, $tooltip), 'parentId' => $parentId, 'parentTitle' => $parentTitle);
     }
     return $result;
 }
开发者ID:BackupTheBerlios,项目名称:badger-svn,代码行数:49,代码来源:CategoryManager.class.php

示例7: initDataGridJS

 /**
  * function initDataGridJS ()
  */
 public function initDataGridJS()
 {
     global $badgerDb;
     global $tpl;
     $us = new UserSettings($badgerDb);
     if ($this->discardSelectedRows == true) {
         $this->discardSelectedRows = "true";
     } else {
         $this->discardSelectedRows = "false";
     }
     $this->tpl->addJavaScript('js/dataGrid.js');
     //add global variable dataGrid'.$this->UniqueId.'
     $this->tpl->addHeaderTag('<script>dataGrid' . $this->UniqueId . ' = new Object()</script>');
     $this->tpl->addOnLoadEvent('badgerRoot = "' . $tpl->getBadgerRoot() . '";');
     $this->tpl->addOnLoadEvent('dataGrid' . $this->UniqueId . ' = new DataGrid( {');
     $this->tpl->addOnLoadEvent('  uniqueId: "' . $this->UniqueId . '",');
     $this->tpl->addOnLoadEvent('  sourceXML: "' . $this->sourceXML . '",');
     $this->tpl->addOnLoadEvent('  headerName: new Array("' . implode('","', $this->headerName) . '"),');
     $this->tpl->addOnLoadEvent('  columnOrder: new Array("' . implode('","', $this->columnOrder) . '"),');
     $this->tpl->addOnLoadEvent('  headerSize: new Array(' . implode(',', $this->headerSize) . '),');
     $this->tpl->addOnLoadEvent('  cellAlign: new Array("' . implode('","', $this->cellAlign) . '"),');
     $this->tpl->addOnLoadEvent('  noRowSelectedMsg: "' . $this->noRowSelectedMsg . '",');
     $this->tpl->addOnLoadEvent('  deleteMsg: "' . $this->deleteMsg . '",');
     $this->tpl->addOnLoadEvent('  deleteRefreshType: "' . $this->deleteRefreshType . '",');
     $this->tpl->addOnLoadEvent('  deleteAction: "' . $this->deleteAction . '",');
     $this->tpl->addOnLoadEvent('  editAction: "' . $this->editAction . '",');
     $this->tpl->addOnLoadEvent('  newAction: "' . $this->newAction . '",');
     $this->tpl->addOnLoadEvent('  discardSelectedRows: ' . $this->discardSelectedRows . ',');
     $this->tpl->addOnLoadEvent('  loadingMessage: "' . $this->LoadingMessage . '",');
     try {
         $dgParameter = $us->getProperty('dgParameter' . $this->UniqueId);
     } catch (BadgerException $e) {
     }
     if (isset($dgParameter)) {
         $this->tpl->addOnLoadEvent('  parameter: "' . $dgParameter . '",');
     }
     $this->tpl->addOnLoadEvent('  tplPath: "' . BADGER_ROOT . '/tpl/' . $this->tpl->getThemeName() . '/Widgets/dataGrid/"');
     $this->tpl->addOnLoadEvent('});');
     $this->tpl->addOnLoadEvent('$("dataGrid' . $this->UniqueId . '").obj = dataGrid' . $this->UniqueId . ';');
     //$this->tpl->addOnLoadEvent('dataGrid'.$this->UniqueId.'.htmlDiv = $("dataGrid'.$this->UniqueId.'");');
     $this->tpl->addOnLoadEvent('Behaviour.register(dataGrid' . $this->UniqueId . '.behaviour);');
     $this->tpl->addOnLoadEvent('Behaviour.apply();');
     $this->tpl->addOnLoadEvent('Event.observe($("dataGrid' . $this->UniqueId . '"), \'keypress\', dataGrid' . $this->UniqueId . '.KeyEvents, false);');
     //TODO: find a solution that's working with multiple datagrids
     //$this->tpl->addOnLoadEvent('Event.observe(window, \'unload\', dataGrid'.$this->UniqueId.'.saveSelectedRows, false);');
     //$this->tpl->addOnLoadEvent('window.addEventListener(\'unload\', dataGrid'.$this->UniqueId.'.saveSelectedRows, false);');
 }
开发者ID:BackupTheBerlios,项目名称:badger-svn,代码行数:50,代码来源:DataGrid.class.php


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