Пример #1
0
 /**
  * getClientModules
  *
  * @param mixed[] &$list
  *
  * @return	void
  */
 public function getClientModules(&$list)
 {
     $dirnames = Legacy_Utils::getDirnameListByTrustDirname(basename(dirname(dirname(__FILE__))));
     foreach ($dirnames as $dirname) {
         $list[] = array('dirname' => $dirname, 'dataname' => 'rpg');
     }
     foreach ($dirnames as $dirname) {
         $list[] = array('dirname' => $dirname, 'dataname' => 'book');
     }
 }
Пример #2
0
 /**
  * getClientList
  *
  * @param mixed[]    &$list
  *  @list[]['dirname']
  *  @list[]['dataname']
  * @param string    $dirname
  *
  * @return    void
  */
 public static function getClientList(&$list, $dirname)
 {
     $dirnames = Legacy_Utils::getDirnameListByTrustDirname('legroup');
     //don't call this method multiple times when site owner duplicate.
     static $isCalled = false;
     if ($isCalled === true) {
         return;
     }
     foreach ($dirnames as $dir) {
         $list[] = array('dirname' => $dir, 'dataname' => 'group');
     }
     $isCalled = true;
 }
Пример #3
0
 /**
  * getClientList
  *
  * @param mixed[]   &$list
  *  @list[]['dirname']
  *  @list[]['dataname']
  *
  * @return  void
  */
 public static function getClientList(&$list)
 {
     $dirnames = Legacy_Utils::getDirnameListByTrustDirname(basename(dirname(dirname(dirname(__FILE__)))));
     //don't call this method multiple times when site owner duplicate this module.
     static $isCalled = false;
     if ($isCalled === true) {
         return;
     }
     $list[] = array('dirname' => $dir, 'dataname' => 'forums');
     $list[] = array('dirname' => $dir, 'dataname' => 'topics');
     $list[] = array('dirname' => $dir, 'dataname' => 'posts');
     $isCalled = true;
 }
Пример #4
0
 /**
  * getClientList
  *
  * @param mixed[]   &$list
  *  @list[]['dirname']
  *  @list[]['dataname']
  * @param string    $tDirname   Legacy_Tag module's dirname
  *
  * @return  void
  */
 public static function getClientList(&$list, $tDirname)
 {
     //don't call this method multiple times when site owner duplicate.
     static $isCalled = false;
     if ($isCalled === true) {
         return;
     }
     //get dirname list of xupdatemaster
     $dirnames = Legacy_Utils::getDirnameListByTrustDirname(basename(dirname(dirname(dirname(__FILE__)))));
     foreach ($dirnames as $dir) {
         //setup client module info
         if (Xupdatemaster_Utils::getModuleConfig($dir, 'tag_dirname') == $tDirname) {
             $list[] = array('dirname' => $dir, 'dataname' => 'item');
         }
     }
     $isCalled = true;
 }
Пример #5
0
 /**
  * getClientList
  *
  * @param mixed[]   &$list
  *  string  $list[]['dirname']
  *  string  $list[]['dataname']
  *  string  $list[]['access_controller']
  *
  * @return  void
  */
 public static function getClientList(&$list)
 {
     //don't call this method multiple times when site owner duplicate.
     static $isCalled = false;
     if ($isCalled === true) {
         return;
     }
     //get dirname list of this module
     $dirnames = Legacy_Utils::getDirnameListByTrustDirname(basename(dirname(dirname(dirname(__FILE__)))));
     foreach ($dirnames as $dir) {
         //setup client module info
         $list[] = array('dirname' => $dir, 'dataname' => 'forums', 'access_controller' => Xcforum_Utils::getModuleConfig($dir, 'access_controller'));
         $list[] = array('dirname' => $dir, 'dataname' => 'topics', 'access_controller' => Xcforum_Utils::getModuleConfig($dir, 'access_controller'));
         $list[] = array('dirname' => $dir, 'dataname' => 'posts', 'access_controller' => Xcforum_Utils::getModuleConfig($dir, 'access_controller'));
         $list[] = array('dirname' => $dir, 'dataname' => 'users2topics', 'access_controller' => Xcforum_Utils::getModuleConfig($dir, 'access_controller'));
     }
     $isCalled = true;
 }
Пример #6
0
 /**
  * _getXcckList
  * 
  * @param	void
  * 
  * @return	mixed[]
  **/
 protected function _getXcckList()
 {
     $list = array('');
     $handler = xoops_gethandler('config');
     $dirnames = Legacy_Utils::getDirnameListByTrustDirname('xcck');
     foreach ($dirnames as $dirname) {
         //check self ?
         if ($dirname == $this->mAsset->mDirname) {
             continue;
         }
         //check maintable ?
         $conf = $handler->getConfigsByDirname($dirname);
         if ($conf['maintable']) {
             continue;
         }
         $list[] = $dirname;
     }
     return $list;
 }
Пример #7
0
 /**
  * getActionList
  * Get client module's actions(view, edit, etc) to set their permission
  * by member's group rank.
  *
  * @param mixed[]   &$list
  *  $list['action'][]   string
  *  $list['rank'][]     Lenum_GroupRank
  *  $list['title'][]    string
  *  $list['desctiption'][]  string
  * @param string    $dirname
  * @param string    $dataname
  *
  * @return  void
  */
 public static function getActionList(&$list, $dirname, $dataname)
 {
     $dirnames = Legacy_Utils::getDirnameListByTrustDirname(basename(dirname(dirname(dirname(__FILE__)))));
     if (!in_array($dirname, $dirnames)) {
         return;
     }
     //don't call this method multiple times when site owner duplicate.
     static $isCalled = false;
     if ($isCalled === true) {
         return;
     }
     XCube_Root::getSingleton()->mLanguageManager->loadModuleMessageCatalog($dirname);
     //view
     $list['action'][] = 'view';
     $list['rank'][] = Lenum_GroupRank::GUEST;
     $list['title'][] = _MD_XCFORUM_TITLE_ACTION_VIEW;
     $list['description'][] = _MD_XCFORUM_DESC_ACTION_VIEW;
     //post
     $list['action'][] = 'post';
     $list['rank'][] = Lenum_GroupRank::REGULAR;
     $list['title'][] = _MD_XCFORUM_TITLE_ACTION_POST;
     $list['description'][] = _MD_XCFORUM_DESC_ACTION_POST;
     //review
     $list['action'][] = 'review';
     $list['rank'][] = Lenum_GroupRank::STAFF;
     $list['title'][] = _MD_XCFORUM_TITLE_ACTION_REVIEW;
     $list['description'][] = _MD_XCFORUM_DESC_ACTION_REVIEW;
     //manage
     $list['action'][] = 'manage';
     $list['rank'][] = Lenum_GroupRank::STAFF;
     $list['title'][] = _MD_XCFORUM_TITLE_ACTION_MANAGE;
     $list['description'][] = _MD_XCFORUM_DESC_ACTION_MANAGE;
     $isCalled = true;
 }
 public function getGroupClientList(&$list)
 {
     $dirnames = Legacy_Utils::getDirnameListByTrustDirname('log');
     foreach ($dirnames as $dirname) {
         $list[] = array('dirname' => $dirname, 'dataname' => 'log');
     }
 }
Пример #9
0
 public static function deleteUserData($user)
 {
     //don't call this method multiple times when site owner duplicate.
     static $isCalled = false;
     if ($isCalled === true) {
         return;
     }
     $uid = $user->get('uid');
     $dirnames = Legacy_Utils::getDirnameListByTrustDirname(basename(dirname(dirname(__DIR__))));
     foreach ($dirnames as $dirname) {
         $handler = Legacy_Utils::getModuleHandler('page', $dirname);
         $handler->deleteAll(new Criteria('uid', $uid));
     }
     $isCalled = true;
 }
Пример #10
0
 /**
  * executeViewSuccess
  * 
  * @param   XCube_RenderTarget  &$render
  * 
  * @return  void
  **/
 public function executeViewSuccess(&$render)
 {
     $render->setTemplateName($this->mAsset->mDirname . '_page_view.html');
     $render->setAttribute('dirname', $this->mAsset->mDirname);
     $render->setAttribute('dataname', 'page');
     $render->setAttribute('catTitle', $this->mCategoryManager->getTitle($this->mObject->get('category_id')));
     $render->setAttribute('object', $this->mObject);
     $render->setAttribute('definitions', Legacy_Utils::getModuleHandler('definition', $this->mAsset->mDirname)->getFields());
     $render->setAttribute('accessController', $this->mCategoryManager);
     $render->setAttribute('useMap', $this->mRoot->mContext->mModuleConfig['use_map']);
     $render->setAttribute('commentDirname', $this->mRoot->mContext->mModuleConfig['comment_dirname']);
     //setup images
     $this->mObject->setupImages($isPost = false);
     $render->setAttribute('imageObjs', $this->mObject->mImage);
     $render->setAttribute('imageNameList', Xcck_Utils::getImageNameList($this->mAsset->mDirname));
     //setup contents tree
     $isHierarchical = $this->mRoot->mContext->mModuleConfig['hierarchical'];
     $render->setAttribute('isHierarchical', $isHierarchical);
     if ($isHierarchical == 1) {
         $render->setAttribute('pageTree', $this->mObjectHandler->getTree($this->mObject->getTopId()));
     }
     //setup subtable objects
     $render->setAttribute('isSubtable', $this->_isSubtable());
     $chandler = xoops_gethandler('config');
     $mhandler = xoops_gethandler('module');
     $subtableDirnameArr = Legacy_Utils::getDirnameListByTrustDirname('xcck');
     //page criteria
     $subtableArr = array();
     $cri = new CriteriaCompo();
     $cri->add(new Criteria('status', Lenum_Status::PUBLISHED));
     $cri->add(new Criteria('maintable_id', $this->mObject->get('page_id')));
     XCube_DelegateUtils::call('Module.xcck.Event.GetSubtableCriteria', new XCube_Ref($cri), $this->mAsset->mDirname);
     //deprecated
     //definition criteria
     foreach ($subtableDirnameArr as $dirname) {
         $configArr = $chandler->getConfigsByDirname($dirname);
         if ($configArr['maintable'] == $this->mAsset->mDirname) {
             $subtableCri = clone $cri;
             XCube_DelegateUtils::call('Module.' . $dirname . '.SetupSubtableCriteria', new XCube_Ref($subtableCri), $this->mAsset->mDirname);
             $module = $mhandler->getByDirname($dirname);
             $subtableArr[] = array('dirname' => $dirname, 'name' => $module->get('name'));
             $definitionArr[$dirname] = Legacy_Utils::getModuleHandler('definition', $dirname)->getFields(true);
             $pageArr[$dirname] = Legacy_Utils::getModuleHandler('page', $dirname)->getObjects($subtableCri);
         }
     }
     if (count($subtableArr) > 0) {
         $render->setAttribute('subtableArr', $subtableArr);
         $render->setAttribute('definitionArr', $definitionArr);
         $render->setAttribute('pageArr', $pageArr);
     }
     $render->setAttribute('xoops_breadcrumbs', $this->_getBreadcrumb($this->mObject));
 }
Пример #11
0
 private function _setDataTrustModule($sid, $item)
 {
     //$sid = (int)$sid;
     $item['version'] = isset($item['version']) ? round(floatval($item['version']) * 100) : 0;
     $item['replicatable'] = isset($item['replicatable']) ? intval($item['replicatable']) : 0;
     $item['target_key'] = isset($item['target_key']) ? $item['target_key'] : $item['dirname'];
     $item['trust_dirname'] = isset($item['trust_dirname']) ? $item['trust_dirname'] : $item['dirname'];
     $item['description'] = isset($item['description']) ? $item['description'] : '';
     if (function_exists('mb_convert_encoding')) {
         if ('UTF-8' != _CHARSET) {
             $item['description'] = mb_convert_encoding($item['description'], _CHARSET, 'UTF-8');
         }
     }
     $item['unzipdirlevel'] = isset($item['unzipdirlevel']) ? intval($item['unzipdirlevel']) : 0;
     $item['addon_url'] = isset($item['addon_url']) ? $item['addon_url'] : '';
     $item = $this->_createItemOptions($item);
     //インストール済みの同じtrustモージュールのリストを取得
     $list = Legacy_Utils::getDirnameListByTrustDirname($item['trust_dirname']);
     if (empty($list)) {
         //インストール済みの同じtrustモージュール無し、注意 is_activeはリストされない
         $mobj = new $this->modHand->mClass();
         $mobj->assignVars($item);
         $mobj->assignVar('sid', $sid);
         $mobj->setmModule();
         if (isset($this->mSiteModuleObjects[$sid][$item['target_key']][$item['dirname']])) {
             $mobj->assignVar('id', $this->mSiteModuleObjects[$sid][$item['target_key']][$item['dirname']]->getVar('id'));
             $this->_ModuleStoreUpdate($mobj, $this->mSiteModuleObjects[$sid][$item['target_key']][$item['dirname']]);
         } else {
             $mobj->setNew();
             $this->modHand->insert($mobj, true);
             $this->mSiteModuleObjects[$sid][$item['target_key']][$item['dirname']] = $mobj;
         }
         unset($mobj);
     } else {
         $_isrootdirmodule = false;
         foreach ($list as $dirname) {
             $mobj = new $this->modHand->mClass();
             $mobj->assignVars($item);
             $mobj->assignVar('sid', $sid);
             //same trust_path module
             $mobj->assignVar('dirname', $dirname);
             $mobj->setmModule();
             if ($dirname == $item['dirname']) {
                 $_isrootdirmodule = true;
             }
             if (isset($this->mSiteModuleObjects[$sid][$item['target_key']][$item['dirname']])) {
                 $mobj->assignVar('id', $this->mSiteModuleObjects[$sid][$item['target_key']][$dirname]->getVar('id'));
                 $this->_ModuleStoreUpdate($mobj, $this->mSiteModuleObjects[$sid][$item['target_key']][$item['dirname']]);
             } else {
                 $mobj->setNew();
                 $this->modHand->insert($mobj, true);
                 $this->mSiteModuleObjects[$sid][$item['target_key']][$dirname] = $mobj;
             }
             unset($mobj);
         }
         //そのままインストールしていない場合、そのまま追加可能なので
         if ($_isrootdirmodule == false) {
             $mobj = new $this->modHand->mClass();
             $mobj->assignVars($item);
             $mobj->assignVar('sid', $sid);
             $mobj->setmModule();
             if (isset($this->mSiteModuleObjects[$sid][$item['target_key']][$item['dirname']])) {
                 $mobj->assignVar('id', $this->mSiteModuleObjects[$sid][$item['target_key']][$item['dirname']]->getVar('id'));
                 $this->_ModuleStoreUpdate($mobj, $this->mSiteModuleObjects[$sid][$item['target_key']][$item['dirname']]);
             } else {
                 $mobj->setNew();
                 $this->modHand->insert($mobj, true);
                 $this->mSiteModuleObjects[$sid][$item['target_key']][$item['dirname']] = $mobj;
             }
             unset($mobj);
         }
     }
 }
Пример #12
0
 /**
  * @return  bool
  */
 protected function _deleteSubtable(Xcck_PageObject $obj)
 {
     //delete subtable
     $dirnames = Legacy_Utils::getDirnameListByTrustDirname('xcck');
     foreach ($dirnames as $dirname) {
         if (Xcck_Utils::getModuleConfig($dirname, 'maintable') == $obj->getDirname()) {
             return Legacy_Utils::getModuleHandler('page', $dirname)->deleteAll(new Criteria('maintable_id', $obj->get('page_id')));
         }
     }
 }
Пример #13
0
 /**
  * _getXcckList
  * 
  * @param	void
  * 
  * @return	mixed[]
  **/
 protected function _getXcckList()
 {
     return Legacy_Utils::getDirnameListByTrustDirname('xcck');
 }