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


PHP SessionAccountHandler类代码示例

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


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

示例1: insertNewTag

 private function insertNewTag()
 {
     $InsertTag = new Model\Tag\Inserter($this->PDO, $this->TagObject);
     $InsertTag->setAccountID(\SessionAccountHandler::getId());
     $InsertTag->insert();
     return $InsertTag->insertedID();
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:7,代码来源:ChosenInserter.php

示例2: __construct

 /**
  * Construct importer
  * @param string $fileName relative to FRONTEND_PATH
  */
 public function __construct($fileName)
 {
     $this->Reader = new BigFileReaderGZip($fileName);
     $this->DB = DB::getInstance();
     $this->AccountID = USER_MUST_LOGIN ? SessionAccountHandler::getId() : 0;
     $this->Results = new RunalyzeJsonImporterResults();
 }
开发者ID:schoch,项目名称:Runalyze,代码行数:11,代码来源:class.RunalyzeJsonImporter.php

示例3: getFieldsetBlock

    /**
     * Get fieldset block
     * @return string
     */
    private function getFieldsetBlock()
    {
        $String = '';
        foreach ($this->TrainingObjects as $i => $TrainingObject) {
            $activityIDs[] = $TrainingObject->getActivityId();
        }
        $duplicates = (new DuplicateFinder(DB::getInstance(), SessionAccountHandler::getId()))->checkForDuplicates($activityIDs);
        $countDuplicates = count(array_filter($duplicates));
        $String .= HTML::info(sprintf(__('Found %s activities.'), count($this->TrainingObjects)));
        if ($countDuplicates > 0) {
            $String .= HTML::warning(_n('Found <strong>one</strong> duplicate activity.', 'Found duplicate activities.', $countDuplicates));
        }
        $String .= '<table class="fullwidth multi-import-table zebra-style c" id="multi-import-table">';
        $String .= '<thead><tr><th>' . __('Import') . '</th><th>' . __('Date') . '</th><th>' . __('Duration') . '</th><th>' . __('Distance') . '</th><th colspan="4"></th></tr></thead>';
        $String .= '<tbody>';
        foreach ($this->TrainingObjects as $i => $TrainingObject) {
            $String .= '<tr>' . $this->getTableRowFor($TrainingObject, $i, $duplicates[$TrainingObject->getActivityId()]) . '</tr>';
        }
        $String .= '</tbody>';
        $String .= '</table>';
        $String .= Ajax::wrapJSforDocumentReady('
			$("#multi-import-table td").click(function(e){
				if ($(e.target).closest(\'input[type="checkbox"]\').length == 0)
					$(this).parent().find(\'input:checkbox\').attr(\'checked\', !$(this).parent().find(\'input:checkbox\').attr(\'checked\'));
			});
		');
        return $String;
    }
开发者ID:rob-st,项目名称:Runalyze,代码行数:32,代码来源:class.MultiImporterFormular.php

示例4: __construct

 /**
  * Constructor
  * @param string $Type
  */
 public function __construct($Type)
 {
     $ExporterClass = 'Exporter' . $Type;
     if (class_exists($ExporterClass)) {
         $this->Exporter = new $ExporterClass(new Context(Request::sendId(), SessionAccountHandler::getId()));
     }
 }
开发者ID:n0rthface,项目名称:Runalyze,代码行数:11,代码来源:class.ExporterFactory.php

示例5: displayContent

    /**
     * Display the content
     * @see PluginPanel::displayContent()
     */
    protected function displayContent()
    {
        echo $this->getStyle();
        echo '<div id="schuhe">';
        // TODO: Use data from shoe factory
        $inuse = true;
        $schuhe = DB::getInstance()->query('SELECT * FROM `' . PREFIX . 'shoe` WHERE accountid = ' . SessionAccountHandler::getId() . ' ORDER BY `inuse` DESC, `km` DESC')->fetchAll();
        foreach ($schuhe as $schuh) {
            $Shoe = new Shoe($schuh);
            if ($inuse && $Shoe->isInUse() == 0) {
                echo '<div id="hiddenschuhe" style="display:none;">';
                $inuse = false;
            }
            echo '<p style="position:relative;">
				<span class="right">' . $Shoe->getKmString() . '</span>
				<strong>' . ShoeFactory::getSearchLink($schuh['id']) . '</strong>
				' . $this->getShoeUsageImage($Shoe->getKm()) . '
			</p>';
        }
        if (empty($schuhe)) {
            echo HTML::em(__('You don\'t have any shoes'));
        }
        if (!$inuse) {
            echo '</div>';
        }
        echo '</div>';
        if (!$inuse) {
            echo Ajax::toggle('<a class="right" href="#schuhe" name="schuhe">' . __('Show unused shoes') . '</a>', 'hiddenschuhe');
        }
        echo HTML::clearBreak();
    }
开发者ID:n0rthface,项目名称:Runalyze,代码行数:35,代码来源:class.RunalyzePluginPanel_Schuhe.php

示例6: initTraining

 /**
  * Init training
  */
 private function initTraining()
 {
     // TODO: Cache?
     $this->ActivityContext = new Activity\Context(SharedLinker::getTrainingId(), SessionAccountHandler::getId());
     if ($this->ActivityContext->activity()->id() <= 0) {
         $this->ActivityContext = null;
     }
 }
开发者ID:9x,项目名称:Runalyze,代码行数:11,代码来源:class.FrontendShared.php

示例7: __construct

 /**
  * Construct summary table
  * @param \Runalyze\Dataset\Configuration $datasetConfig
  * @param int $sportid
  * @param int $year
  */
 public function __construct(Dataset\Configuration $datasetConfig, $sportid, $year)
 {
     $this->AccountID = SessionAccountHandler::getId();
     $this->DatasetQuery = new Dataset\Query($datasetConfig, DB::getInstance(), $this->AccountID);
     $this->DatasetTable = new Runalyze\View\Dataset\Table($datasetConfig);
     $this->Sportid = $sportid;
     $this->Year = $year;
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:14,代码来源:class.SummaryTable.php

示例8: handleRequest

 /**
  * Handle request
  */
 private function handleRequest()
 {
     if (strlen(Request::param('public')) > 0) {
         $Updater = new Activity\Updater(DB::getInstance());
         $Updater->setAccountID(SessionAccountHandler::getId());
         $Updater->update(new Activity\Object(array('id' => $this->TrainingID, Activity\Object::IS_PUBLIC => Request::param('public') == 'true' ? 1 : 0)), array(Activity\Object::IS_PUBLIC));
     }
 }
开发者ID:9x,项目名称:Runalyze,代码行数:11,代码来源:class.ExporterWindow.php

示例9: fetchByID

 /**
  * Fetch row by id
  * @param string $table without PREFIX
  * @param int $ID
  * @return array
  */
 public function fetchByID($table, $ID)
 {
     $table = str_replace(PREFIX, '', $table);
     if ($table == 'account' || $table == 'plugin_conf') {
         return $this->query('SELECT * FROM `' . PREFIX . $table . '` WHERE `id`=' . (int) $ID . ' LIMIT 1')->fetch();
     }
     return $this->query('SELECT * FROM `' . PREFIX . $table . '` WHERE `id`=' . (int) $ID . ' AND `accountid`="' . SessionAccountHandler::getId() . '" LIMIT 1')->fetch();
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:14,代码来源:class.PDOforRunalyze.php

示例10: equipmentTypeIdForNewStuff

 /**
  * @return int|null
  */
 protected function equipmentTypeIdForNewStuff()
 {
     if (null === $this->NewEquipmentTypeId) {
         $this->NewEquipmentTypeId = DB::getInstance()->insert('equipment_type', ['name', 'accountid'], ['RunningAHEAD', SessionAccountHandler::getId()]);
         DB::getInstance()->exec('INSERT INTO `' . PREFIX . 'equipment_sport` (`sportid`, `equipment_typeid`) SELECT `id`, "' . $this->NewEquipmentTypeId . '" FROM `runalyze_sport` WHERE `accountid`=' . SessionAccountHandler::getId());
     }
     return $this->NewEquipmentTypeId;
 }
开发者ID:rob-st,项目名称:Runalyze,代码行数:11,代码来源:class.ParserXMLrunningAHEADMultiple.php

示例11: uninstall

 /**
  * Uninstall
  * @return bool
  */
 public function uninstall()
 {
     $Factory = new PluginFactory();
     $Plugin = $Factory->newInstance($this->Key);
     DB::getInstance()->deleteByID('plugin', $Plugin->id());
     DB::getInstance()->query('DELETE FROM `' . PREFIX . 'plugin_conf` WHERE `pluginid`=' . $Plugin->id() . ' AND accountid = ' . SessionAccountHandler::getId());
     PluginFactory::clearCache();
     return true;
 }
开发者ID:n0rthface,项目名称:Runalyze,代码行数:13,代码来源:class.PluginInstaller.php

示例12: cacheAllClothes

 /**
  * Cache Clothes
  */
 private static function cacheAllClothes()
 {
     $clothes = Cache::get(self::CACHE_KEY);
     if (is_null($clothes)) {
         $clothes = DB::getInstance()->query('SELECT * FROM `' . PREFIX . 'clothes` WHERE accountid = ' . SessionAccountHandler::getId())->fetchAll();
         Cache::set(self::CACHE_KEY, $clothes, '3600');
     }
     return $clothes;
 }
开发者ID:n0rthface,项目名称:Runalyze,代码行数:12,代码来源:class.ClothesFactory.php

示例13: fetchAllPlugins

 /**
  * Cache all from Table plugin for a user
  */
 private static function fetchAllPlugins()
 {
     $data = Cache::get(self::CACHE_KEY);
     if ($data == NULL) {
         $data = self::fetchAllPluginsFrom(DB::getInstance(), SessionAccountHandler::getId());
         Cache::set(self::CACHE_KEY, $data, '3600');
     }
     return $data;
 }
开发者ID:n0rthface,项目名称:Runalyze,代码行数:12,代码来源:class.PluginFactory.php

示例14: __construct

 /**
  * Construct importer
  * @param string $fileName relative to FRONTEND_PATH
  * @param int $accountID optional, session account id is used otherwise
  */
 public function __construct($fileName, $accountID = false)
 {
     $this->Reader = new GZipReader(FRONTEND_PATH . $fileName);
     $this->DB = DB::getInstance();
     $this->AccountID = SessionAccountHandler::getId();
     $this->Results = new RunalyzeJsonImporterResults();
     if ($accountID !== false) {
         $this->AccountID = $accountID;
     }
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:15,代码来源:class.RunalyzeJsonImporter.php

示例15: loadAccountID

 /**
  * Load account ID
  * @return int
  */
 private static function loadAccountID()
 {
     if (defined('RUNALYZE_TEST')) {
         return null;
     }
     if (\AccountHandler::$IS_ON_REGISTER_PROCESS) {
         return \AccountHandler::$NEW_REGISTERED_ID;
     }
     return \SessionAccountHandler::getId();
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:14,代码来源:Configuration.php


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