コード例 #1
0
ファイル: Modules.php プロジェクト: kevindragon221/Webdesktop
 /**
  * Get all the launchers for the user that is registered in the ACL
  *
  * The launchers will be stored in the returning array with fixed configured
  * indexes. Can move the indexes to constants (constants through the whole
  * application). But this class seems to much overhead and should be merged
  * with the webdesktop model.
  *
  * @return array
  */
 public function getUserLaunchers()
 {
     $return = array('autorun' => array(), 'contextmenu' => array(), 'quickstart' => array(), 'shortcut' => array());
     foreach ($this->dbLaunchers->findByUserId($this->acl->getUser()->getId()) as $row) {
         switch ($row['l_type']) {
             case Webdesktop_Model_DbTable_Launchers::LAUNCHER_AUTORUN:
                 $return['autorun'][] = $row['m_moduleId'];
                 break;
             case Webdesktop_Model_DbTable_Launchers::LAUNCHER_CONTEXT:
                 $return['contextmenu'][] = $row['m_moduleId'];
                 break;
             case Webdesktop_Model_DbTable_Launchers::LAUNCHER_QUICKSTART:
                 $return['quickstart'][] = $row['m_moduleId'];
                 break;
             case Webdesktop_Model_DbTable_Launchers::LAUNCHER_SHORTCUT:
                 $return['shortcut'][] = $row['m_moduleId'];
                 break;
         }
     }
     return $return;
 }