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


PHP Kernel::filterNodeList方法代码示例

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


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

示例1: getLoginForm

 /**
  * getLoginForm
  *
  * Affiche la liste des comptes à créer, avec proposition de login/passwd.
  * @author	Frédéric Mossmann
  * @since	14.02.2006
  *
  */
 public function getLoginForm()
 {
     $comptes_service =& CopixClassesFactory::Create('comptes|ComptesService');
     $bu_dao =& CopixDAOFactory::create("kernel|kernel_bu2user");
     $tpl = new CopixTpl();
     $tpl->assign('TITLE_PAGE', CopixI18N::get('comptes.moduleDescription') . " » " . CopixI18N::get('comptes.title.getloginform'));
     $menu[] = array('txt' => CopixI18N::get('comptes.menu.return_listes'), 'url' => CopixUrl::get('comptes||getNode', array('type' => _request('type'), 'id' => _request('id'))));
     $tpl->assign('MENU', $menu);
     if ($pUsers = _request('users')) {
         $users = array();
         // $pUsers = _request('users');
         //var_dump($pUsers);
         foreach ($pUsers as $user) {
             if (ereg('(.+)-(.+)', $user, $user_infos)) {
                 $user_type = $user_infos[1];
                 $user_id = $user_infos[2];
                 $user_infos = Kernel::getUserInfo($user_type, $user_id);
                 // Vérification de l'existance d'un login.
                 // -> Si c'est le cas, il ne faut pas proposer un nouveau login.
                 $bu_user = $bu_dao->getByBUID($user_type, $user_id);
                 if (!count($bu_user)) {
                     $user_infos['login'] = $comptes_service->createLogin($user_infos);
                     $user_infos['passwd'] = $comptes_service->createPasswd();
                     $users[] = $user_infos;
                 }
             }
         }
     } elseif ($pReset = _request('reset')) {
         $users = array();
         $pNodeType = _request('type');
         $pNodeId = _request('id');
         $childs = Kernel::getNodeChilds($pNodeType, $pNodeId);
         $users_dump = Kernel::filterNodeList($childs, $pReset);
         if ($pReset == 'USER_RES') {
             $users_dump = array();
             $eleves = Kernel::filterNodeList($childs, 'USER_ELE');
             foreach ($eleves as $eleve) {
                 $parents = Kernel::getNodeChilds($eleve['type'], $eleve['id']);
                 $parents = Kernel::filterNodeList($parents, 'USER_RES');
                 foreach ($parents as $parent) {
                     $users_dump[] = $parent;
                 }
             }
         }
         foreach ($users_dump as $user) {
             $user_infos = Kernel::getUserInfo($user['type'], $user['id']);
             $bu_user = $bu_dao->getByBUID($user['type'], $user['id']);
             // _dump($user_infos);
             // _dump($bu_user);
             if (count($bu_user)) {
                 $user_infos['login'] = $bu_user[0]->user_login;
                 $user_infos['passwd'] = $comptes_service->createPasswd();
                 $users[] = $user_infos;
             }
         }
     } else {
         $urlReturn = CopixUrl::get('comptes||getNode', array('type' => _request('type'), 'id' => _request('id')));
         return new CopixActionReturn(COPIX_AR_REDIRECT, $urlReturn);
     }
     // Ajoute le type d'utilisateur en toute lettres.
     foreach ($users as $user_key => $user_val) {
         $users[$user_key]['type_nom'] = Kernel::Code2Name($user_val['type']);
     }
     $tpl->assign('MAIN', CopixZone::process('comptes|loginform', array('users' => $users, 'type' => _request('type'), 'id' => _request('id'), 'reset' => _request('reset'))));
     $tpl->assign('MENU', $this->menu);
     return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl);
 }
开发者ID:JVS-IS,项目名称:ICONITO-EcoleNumerique,代码行数:75,代码来源:comptes.actiongroup.php

示例2: whereAmI

 public function whereAmI($node_type = false, $node_id = false)
 {
     // Patch EN2010
     return array();
     $where = array();
     if ($node_type == 'BU_CLASSE') {
         $where['BU_CLASSE']['type'] = $node_type;
         $where['BU_CLASSE']['id'] = $node_id;
         $infos = Kernel::getNodeInfo($node_type, $node_id);
         $where['BU_CLASSE']['nom'] = $infos['nom'];
         $parents = Kernel::getNodeParents($node_type, $node_id);
         $parent = Kernel::filterNodeList($parents, 'BU_ECOLE');
         $node_type = $parent[0]["type"];
         $node_id = $parent[0]["id"];
     }
     if ($node_type == 'BU_ECOLE') {
         $where['BU_ECOLE']['type'] = $node_type;
         $where['BU_ECOLE']['id'] = $node_id;
         $infos = Kernel::getNodeInfo($node_type, $node_id);
         $where['BU_ECOLE']['nom'] = $infos['nom'];
         $parents = Kernel::getNodeParents($node_type, $node_id);
         $parent = Kernel::filterNodeList($parents, 'BU_VILLE');
         $node_type = $parent[0]["type"];
         $node_id = $parent[0]["id"];
     }
     if ($node_type == 'BU_VILLE') {
         $where['BU_VILLE']['type'] = $node_type;
         $where['BU_VILLE']['id'] = $node_id;
         $infos = Kernel::getNodeInfo($node_type, $node_id);
         $where['BU_VILLE']['nom'] = $infos['nom'];
         $parents = Kernel::getNodeParents($node_type, $node_id);
         $parent = Kernel::filterNodeList($parents, 'BU_GRVILLE');
         $node_type = $parent[0]["type"];
         $node_id = $parent[0]["id"];
     }
     if ($node_type == 'BU_GRVILLE') {
         $where['BU_GRVILLE']['type'] = $node_type;
         $where['BU_GRVILLE']['id'] = $node_id;
         $infos = Kernel::getNodeInfo($node_type, $node_id);
         $where['BU_GRVILLE']['nom'] = $infos['nom'];
     }
     return $where;
 }
开发者ID:JVS-IS,项目名称:ICONITO-EcoleNumerique,代码行数:43,代码来源:kernel.class.php

示例3: processDefault

 public function processDefault()
 {
     $tpl = new CopixTpl();
     $tplModule = new CopixTpl();
     if (!$this->user->connected) {
         return new CopixActionReturn(COPIX_AR_REDIRECT, CopixUrl::get('welcome|default|'));
     }
     $tpl->assign('TITLE_PAGE', CopixI18N::get('kernel.title.accueilsimple'));
     $nodes_all = Kernel::getNodeParents($this->user->type, $this->user->idEn);
     $nodes_all = Kernel::sortNodeList($nodes_all);
     // _dump($nodes_all);
     $nodes = array();
     foreach ($nodes_all as $node) {
         if ($node['type'] == 'CLUB' && CopixConfig::exists('kernel|groupeAssistance') && ($groupeAssistance = CopixConfig::get('kernel|groupeAssistance')) && $node['id'] == $groupeAssistance) {
             continue;
         }
         if ($node['type'] == 'CLUB' && $node['droit'] < 20) {
             continue;
         }
         if (!isset($nodes[$node['type']])) {
             $nodes[$node['type']] = array();
         }
         //module not initialized : loaded into inconito
         if (!isset($nodes[$node['type']][$node['id']])) {
             $nodes[$node['type']][$node['id']] = $node;
             Kernel::createMissingModules($node['type'], $node['id']);
             $nodes[$node['type']][$node['id']]['modules'] = Kernel::getModEnabled($node['type'], $node['id'], $this->user->type, $this->user->idEn, 0, count($nodes_all) > $this->conf_notification_maxnodes ? 0 : 1);
             // Cas des groupes : on ajoute les membres et admin, selon les droits
             if ($node['type'] == 'CLUB') {
                 $addModule = new CopixPPO();
                 $addModule->node_type = $node['type'];
                 $addModule->node_id = $node['id'];
                 $addModule->module_type = 'MOD_ADMIN';
                 $addModule->module_id = 0;
                 $addModule->module_nom = CopixI18N::get('groupe|groupe.group.admin');
                 $nodes[$node['type']][$node['id']]['modules'][] = $addModule;
             }
             /*
              * ===== CONTENT GENERATION =====
              *
              */
             //cas parent élève
             if ($node['type'] == 'USER_ELE') {
                 $contentNode = Kernel::getNodeParents($node['type'], $node['id']);
                 $contentNode = Kernel::filterNodeList($contentNode, 'BU_CLASSE');
                 if (empty($contentNode)) {
                     continue;
                 }
                 $contentNode = $contentNode[0];
             } else {
                 $contentNode = $node;
             }
             //get content from db :
             $content = $this->db->query('SELECT * FROM module_admindash WHERE id_zone = ' . $contentNode['id'] . ' AND type_zone = "' . $contentNode['type'] . '"')->toArray1();
             // Get vocabulary catalog to use
             $nodeVocabularyCatalogDAO = _ioDAO('kernel|kernel_i18n_node_vocabularycatalog');
             $vocabularyCatalog = $nodeVocabularyCatalogDAO->getCatalogForNode($contentNode['type'], $contentNode['id']);
             //if no content : get default content
             if (empty($content['content'])) {
                 switch ($contentNode['type']) {
                     case 'BU_CLASSE':
                     case 'USER_ELE':
                         $content['content'] = CopixZone::process('kernel|dashboardClasse', array('idZone' => $contentNode['id'], 'catalog' => $vocabularyCatalog->id_vc));
                         break;
                     case 'BU_ECOLE':
                         $content['content'] = CopixZone::process('kernel|dashboardEcole', array('idZone' => $contentNode['id'], 'catalog' => $vocabularyCatalog->id_vc));
                         break;
                     case 'BU_VILLE':
                         $content['content'] = CopixZone::process('kernel|dashboardVille', array('idZone' => $contentNode['id'], 'catalog' => $vocabularyCatalog->id_vc));
                         break;
                     case 'CLUB':
                         $content['content'] = CopixZone::process('kernel|dashboardGrTravail', array('idZone' => $contentNode['id'], 'catalog' => $vocabularyCatalog->id_vc));
                         break;
                     case 'ROOT':
                         if ($contentNode['droit'] >= 60) {
                             $contentTpl = new CopixTpl();
                             $content['content'] = $contentTpl->fetch('zone.dashboard.root.tpl');
                         } else {
                             $contentTpl = new CopixTpl();
                             $content['content'] = $contentTpl->fetch('zone.dashboard.userext.tpl');
                         }
                         break;
                     default:
                         $content['content'] = '';
                         break;
                 }
             }
             //twitter integration
             $twitterSrc = '';
             if (!empty($content['social_stream'])) {
                 enic::to_load('social');
                 $twitter = new enicSocialTwitter();
                 $twitterSrc = $content['social_stream'];
             }
             //is admin :
             $is_admin = $contentNode['droit'] >= 60;
             //build html content
             $content_tpl = new CopixTpl();
             $content_tpl->assign('content', $content['content']);
             if (!empty($content['picture'])) {
//.........这里部分代码省略.........
开发者ID:JVS-IS,项目名称:ICONITO-EcoleNumerique,代码行数:101,代码来源:dashboard.actiongroup.php


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