— http://admin.aviaport.ru/directory/aviafirms/6/groups/
552345
static function target_ids($where)
	{
		$xref_class_name = popval($where, 'xref_class_name');
		if(!$xref_class_name)
			$xref_class_name = get_called_class();

		$target_field_name = popval($where, 'target_field_name');
		if(!$target_field_name)
			$target_field_name = bors_foo($xref_class_name)->target_field_name();

		$xrefs = bors_find_all($xref_class_name, $where);

		return bors_field_array_extract($xrefs, $target_field_name);
	}
717353
protected function setup_groups() {
        // find out current groups mode
        if ($this->groupmode = groups_get_course_groupmode($this->course)) {
            if (empty($this->gpr->groupid)) {
                $this->currentgroup = groups_get_course_group($this->course, true);
            } else {
                $this->currentgroup = $this->gpr->groupid;
            }
            $this->group_selector = groups_print_course_menu($this->course, $this->pbarurl, true);

            if ($this->groupmode == SEPARATEGROUPS and !$this->currentgroup and !has_capability('moodle/site:accessallgroups', $this->context)) {
                $this->currentgroup = -2; // means can not access any groups at all
            }
            if ($this->currentgroup) {
                $group = groups_get_group($this->currentgroup);
                $this->currentgroupname     = $group->name;
                $this->groupsql             = " JOIN {groups_members} gm ON gm.userid = u.id ";
                $this->groupwheresql        = " AND gm.groupid = :gr_grpid ";
                $this->groupwheresql_params = array('gr_grpid'=>$this->currentgroup);
            }
        }
    }
308483
def access_group_params(mode = :all)
      list = []
      list += [ :name ] if mode == :before_create || mode == :all
      list += [ { group_ids: [], user_ids: [] } ] if mode == :after_create || mode == :all

      params.require(:access_group).permit(list)
    end
203268
public function &GetArticleGroups()
    {
        $oArticleGroups = &$this->GetFromInternalCache('oArticleGroups');
        if (is_null($oArticleGroups)) {
            $oArticleGroups = &TdbShopArticleGroupList::GetArticleGroups($this->id);
            $this->SetInternalCache('oArticleGroups', $oArticleGroups);
        }

        return $oArticleGroups;
    }
1056604
protected function addgroup_database(){
		$this->registerGroup(BLang::_('ADMIN_CONFIG_GENERAL_MYSQL'),'database',array(
			new BConfigFieldString(
				'MYSQL_DB_HOST',
				BLang::_('ADMIN_CONFIG_GENERAL_MYSQL_DBHOST'),
				'127.0.0.1'),
			new BConfigFieldString(
				'MYSQL_DB_USERNAME',
				BLang::_('ADMIN_CONFIG_GENERAL_MYSQL_DBUSERNAME'),
				'root'),
			new BConfigFieldPassword(
				'MYSQL_DB_PASSWORD',
				BLang::_('ADMIN_CONFIG_GENERAL_MYSQL_DBPASSWORD'),
				''),
			new BConfigFieldString(
				'MYSQL_DB_NAME',
				BLang::_('ADMIN_CONFIG_GENERAL_MYSQL_DBNAME'),
				'vidido')
			));
		}
1222571
private function get_groups_available_in_forum() : array {
        $course = $this->forum->get_course_record();
        $coursemodule = $this->forum->get_course_module_record();

        return groups_get_all_groups($course->id, 0, $coursemodule->groupingid);
    }
47146
protected function getGroupInfo()
    {
        $rtn = array();
        $groups = $this->groupStore->getWhere(array(), 100, 0, array(), array('title' => 'ASC'));

        foreach ($groups['items'] as $group) {
            $thisGroup = array('title' => $group->getTitle());
            $projects = $this->projectStore->getByGroupId($group->getId());
            $thisGroup['projects'] = $projects['items'];
            $thisGroup['summary'] = $this->getSummaryHtml($thisGroup['projects']);
            $rtn[] = $thisGroup;
        }

        return $rtn;
    }
859250
protected function addgroup_general(){
		$fields=array();
		$fld_cachetype=new BConfigFieldList(
			'CACHE_TYPE',
			BLang::_('ADMIN_CONFIG_GENERAL_CACHETYPE'),
			array(
				'nocache'=>BLang::_('ADMIN_CONFIG_GENERAL_CACHETYPE_NOCACHE'),
				'files'=>BLang::_('ADMIN_CONFIG_GENERAL_CACHETYPE_FILES'),
				'memcache'=>BLang::_('ADMIN_CONFIG_GENERAL_CACHETYPE_MEMCACHE'),
				'memcached'=>BLang::_('ADMIN_CONFIG_GENERAL_CACHETYPE_MEMCACHED')
				),
			'memcached');
		$fields[]=$fld_cachetype;
		$fld_cachetype=new BConfigFieldList(
			'DBCACHE_ENABLED',
			'Кеширование URLов к базе',
			array(
				'1'=>'Включено',
				'0'=>'Отключено',
				),
			'0');
		$fields[]=$fld_cachetype;

		switch ($fld_cachetype->getVal()){
			case 'files':
				//Files cache settings...
				$fields[]=new BConfigFieldPath(
					'PATH_CACHE',
					BLang::_('ADMIN_CONFIG_GENERAL_CACHEPATH'),
					BROOTPATH.'filecache'.DIRECTORY_SEPARATOR
					);
				break;
			case 'memcache':
				break;
			case 'memcached':
				break;
			}
		$fields[]=new BConfigFieldList(
			'DEBUG_MODE',
			BLang::_('ADMIN_CONFIG_GENERAL_DEBUGMODE'),
			array(
				0=>BLang::_('ADMIN_CONFIG_GENERAL_DEBUGMODE_OFF'),
				1=>BLang::_('ADMIN_CONFIG_GENERAL_DEBUGMODE_ON')
				),
			0);
		$fields[]=new BConfigFieldList(
			'DEBUG_SITENOINDEX',
			BLang::_('ADMIN_CONFIG_GENERAL_SITENOINDEX'),
			array(
				0=>BLang::_('ADMIN_CONFIG_GENERAL_SITENOINDEX_OFF'),
				1=>BLang::_('ADMIN_CONFIG_GENERAL_SITENOINDEX_ON')
				),
			0);
		$fields[]=new BConfigFieldList(
			'DEBUG_PAGES_CACHE',
			BLang::_('ADMIN_CONFIG_GENERAL_DEBUG_PAGES_CACHE'),
			array(
				0=>BLang::_('ADMIN_CONFIG_GENERAL_DEBUG_PAGES_CACHE_OFF'),
				1=>BLang::_('ADMIN_CONFIG_GENERAL_DEBUG_PAGES_CACHE_ON')
				),
			0);
		//
		$fields[]=new BConfigFieldString(
			'STATIC_PATH',
			BLang::_('ADMIN_CONFIG_GENERAL_STATIC_PATH'),
			'');
		$fields[]=new BConfigFieldString(
			'FILES_PATH',
			BLang::_('ADMIN_CONFIG_GENERAL_FILES_PATH'),
			'');
		//Maximum password chars
		$fields[]=new BConfigFieldInt(
			'USERS_PASSWORD_CHARSMIN', //old - PASSWORD_CHARSMIN
			BLang::_('ADMIN_CONFIG_GENERAL_PASSWORD_CHARSMIN'),
			5);
		//
		$fields[]=new BConfigFieldInt(
			'FIRMS_MAX_EMPLOYEES',
			BLang::_('ADMIN_CONFIG_GENERAL_FIRMS_MAXEMPLOYEES'),
			10);
		//
		$fields[]=new BConfigFieldInt(
			'USERS_PHONES_MAX',
			BLang::_('ADMIN_CONFIG_GENERAL_USERS_PHONES_MAX'),
			3);

		$fields[]=new BConfigFieldString(
			'GOOGLE_ANALYTICS_ID',
			BLang::_('ADMIN_CONFIG_GOOGLE_ANALYTICS_ID'),
			'');		
		//
		$this->registerGroup(BLang::_('ADMIN_CONFIG_GENERAL_GENERAL'),'general',$fields);
		}
1283695
public function listGroupsAction()
    {
        $helper = Mage::helper('aoe_scheduler'); /* @var $helper Aoe_Scheduler_Helper_Data */
        echo sprintf(
            "%-30s %s\n",
            'Group',
            'Jobs'
        );
        foreach ($helper->getGroupsToJobsMap() as $group => $jobs) {
            echo sprintf(
                "%-30s %s\n",
                $group,
                implode(', ', $jobs)
            );
        }
    }
129791
private function SaveMemberGroups()
    {
        $selectedIDs = Request::PostArray('MemberGroup');
        if ($this->page->GetGuestsOnly())
        {
            $selectedIDs = array();
        }
        $exIDs = Membergroup::GetKeyList(MembergroupUtil::PageMembergroups($this->page));
        $this->DeleteOldMemberGroups($selectedIDs);
        $this->SaveNewMemberGroups($selectedIDs, $exIDs);
    }
514534
public function saveGroup($code, $fields = array()) {
        $fields['STRING_ID'] = $code;
        $this->checkRequiredKeys(__METHOD__, $fields, array('STRING_ID', 'NAME'));

        $exists = $this->getGroup($fields['STRING_ID']);
        $exportExists = $this->prepareExportGroup($exists);
        $fields = $this->prepareExportGroup($fields);

        if (empty($exists)) {
            $ok = $this->getMode('test') ? true : $this->addGroup($fields['STRING_ID'], $fields);
            $this->outNoticeIf($ok, 'Группа %s: добавлена', $fields['NAME']);
            return $ok;
        }

        if ($this->hasDiff($exportExists, $fields)) {
            $ok = $this->getMode('test') ? true : $this->updateGroup($exists['ID'], $fields);
            $this->outNoticeIf($ok, 'Группа %s: обновлена', $fields['NAME']);
            $this->outDiffIf($ok, $exportExists, $fields);
            return $ok;
        }


        $ok = $this->getMode('test') ? true : $exists['ID'];
        if ($this->getMode('out_equal')) {
            $this->outIf($ok, 'Группа %s: совпадает', $fields['NAME']);
        }
        return $ok;
    }
90991
function updateIssuesGroups() {
		// Get all groups.
		var groupHeaderElements = document.querySelectorAll('[data-groupName]');

		for (var i = 0; i < groupHeaderElements.length; i++) {
			var groupHeader = groupHeaderElements[i];
			var issuesGroupId = groupHeader.getAttribute('data-expandableElement');
			var groupName = groupHeader.getAttribute('data-groupName');
			var groupNumber = groupHeader.getAttribute('data-groupNumber');
			// Get all rules for the current group.
			var rules = document.querySelectorAll('#' + issuesGroupId + ' > tr');
			var numberOfUnfilteredIssues = 0;
			var numberOfUnfilteredRules = 0;

			// Hide the rule section if no issues. Otherwise update count.
			for (var k = 0; k < rules.length; k++) {
				var rule = rules[k];
				var unfilteredIssuesForRule = rule.querySelectorAll('tr.filterable:not(.filtered)');
				var numberOfUnfilteredIssuesForRule = unfilteredIssuesForRule.length;
				if (numberOfUnfilteredIssuesForRule === 0) {
					rule.classList.add('filtered');
				} else {
					numberOfUnfilteredRules++;
					numberOfUnfilteredIssues += numberOfUnfilteredIssuesForRule;
					rule.querySelector('span.rule-issue-number').innerText = '(' + numberOfUnfilteredIssuesForRule + ' issues)';
				}
			}

			// Hide the group section if no issues. Otherwise update count.
			if (numberOfUnfilteredRules === 0) {
				groupHeader.classList.add('filtered');
			} else {
				groupHeader.classList.remove('filtered');
				groupHeader.querySelector('span').innerText = ' ' + groupNumber + '. ' + groupName + ' (' + numberOfUnfilteredRules + ' rules, ' + numberOfUnfilteredIssues + ' issues)';
			}
		}
	}
282135
public function afficheListeRegroupee()
    {
        $html="";
        $t=new Template($this->getCheminPhysique().$this->cheminTemplates);
        $t->set_filenames((array('listeRegroupee'=>'listeRegroupee.tpl')));

        $r = new archiRecherche();


        if (isset($this->variablesGet['modeAffichageListe'])) {
            $modeAffichageListe = $this->variablesGet['modeAffichageListe'];
        } else {
            $modeAffichageListe = 'default';
        }
        $idVilleGeneral = 1;  // strasbourg par defaut
        $s = new objetSession();

        if ($s->isInSession('archiIdVilleGeneral') && $s->getFromSession('archiIdVilleGeneral')!='') {
            $idVilleGeneral = $s->getFromSession('archiIdVilleGeneral');
        } elseif (isset($this->variablesGet['archiIdVilleGeneral'])) {
            $idVilleGeneral = $this->variablesGet['archiIdVilleGeneral'];
            $s->addToSession('archiIdVilleGeneral', $idVilleGeneral);
        }

        $fetchInfosVille = $this->getInfosVille($idVilleGeneral, array('fieldList'=>'v.nom as nomVille'));

        $nomVilleGeneral = $fetchInfosVille['nomVille'];

        $t->assign_vars(array('liens'=>"<a href='".$this->creerUrl('', 'listeDossiers', array('modeAffichageListe'=>'parRues','archiIdVilleGeneral'=>$idVilleGeneral))."'>"._("Par rues de")." ".$nomVilleGeneral."</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href='".$this->creerUrl('', 'listeDossiers', array('modeAffichageListe'=>'parQuartiers','archiIdVilleGeneral'=>$idVilleGeneral))."'>"._("Par quartiers de")." ".$nomVilleGeneral."</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href='".$this->creerUrl('', 'listeDossiers', array('modeAffichageListe'=>'parVilles'))."'>"._("Par villes")."</a>",

        ));

        switch ($modeAffichageListe) {
            case 'parQuartiers':
                $pagination = new paginationObject();

                $arrayQuartiers = $this->getIdQuartiersFrom($idVilleGeneral, 'ville');

                $arrayQuartiersNotEmpty = $r->getIdQuartiersNotEmpty();


                $arrayListeQuartiersNotEmpty = array();
                $arrayListeAlphabetique = array();
                foreach ($arrayQuartiers as $indice => $idQuartier) {
                    if (in_array($idQuartier, $arrayQuartiersNotEmpty['arrayListeQuartiersNonVides'])) {
                        $arrayListeQuartiersNotEmpty[] = $idQuartier;
                    }
                }


                // pagination
                $nbEnregistrementTotaux = count($arrayListeQuartiersNotEmpty);

                // nombre d'images affichées sur une page
                $nbEnregistrementsParPage = 12;
                $arrayPagination=$pagination->pagination(array(
                        'nomParamPageCourante'=>'archiPageCouranteVille',
                        'nbEnregistrementsParPage'=>$nbEnregistrementsParPage,
                        'nbEnregistrementsTotaux'=>$nbEnregistrementTotaux,
                        'typeLiens'=>'noformulaire'
                ));

                $t->assign_vars(array('pagination'=>$arrayPagination['html']));

                $req = "SELECT idQuartier, nom
						FROM quartier
						WHERE idQuartier in ('".implode("','", $arrayListeQuartiersNotEmpty)."')
								and nom<>'autre'
								ORDER BY nom ASC
								LIMIT ".$arrayPagination['limitSqlDebut'].",".$nbEnregistrementsParPage."
										";

                $tableau = new tableau();

                $res = $this->connexionBdd->requete($req);
                while ($fetch = mysql_fetch_assoc($res)) {
                // pour chaque ville on va regarder s'il y a des adresses qui correspondent et on les compte
                    /*$reqCount = "
					 SELECT distinct ha.idAdresse
					FROM historiqueAdresse ha2, historiqueAdresse ha
					LEFT JOIN sousQuartier sq ON sq.idQuartier = '".$fetch['idQuartier']."'
					LEFT JOIN rue r ON r.idSousQuartier = sq.idSousQuartier
					WHERE
					(ha.idRue = IFNULL(r.idRue , 0)
							OR  ha.idQuartier = '".$fetch['idQuartier']."'
							OR  ha.idSousQuartier = IFNULL(sq.idSousQuartier,0))
					AND ha2.idHistoriqueAdresse = ha.idHistoriqueAdresse
					GROUP BY ha.idAdresse, ha.idHistoriqueAdresse
					HAVING ha.idHistoriqueAdresse = max(ha2.idHistoriqueAdresse)
					";*/



                    $reqRuesQuartier = "SELECT idRue FROM rue WHERE idSousQuartier IN (SELECT idSousQuartier FROM sousQuartier WHERE idQuartier=".$fetch['idQuartier'].")";
                    $reqSousQuartier = "SELECT idSousQuartier FROM sousQuartier WHERE idQuartier = ".$fetch['idQuartier'];

                    $nbAdressesTotales=0;
                    $nbAdressesRues =0;
                    $nbAdressesSousQuartiers=0;
                    $nbAdressesQuartiers=0;

                    $resRuesQuartier = $this->connexionBdd->requete($reqRuesQuartier);
                    while ($fetchRuesQuartier = mysql_fetch_assoc($resRuesQuartier)) {
                        $reqCountRuesQuartier = "SELECT count(distinct idAdresse) as nbAdressesRues from historiqueAdresse WHERE idRue='".$fetchRuesQuartier['idRue']."'";
                        $resCountRuesQuartier = $this->connexionBdd->requete($reqCountRuesQuartier);
                        $fetchAdressesRues = mysql_fetch_assoc($resCountRuesQuartier);
                        $nbAdressesRues += $fetchAdressesRues['nbAdressesRues'];
                    }

                    $resSousQuartier = $this->connexionBdd->requete($reqSousQuartier);
                    while ($fetchSousQuartier = mysql_fetch_assoc($resSousQuartier)) {
                        $reqCountSousQuartierQuartier = "SELECT count(distinct idAdresse) as nbAdressesSousQuartiers FROM historiqueAdresse WHERE idSousQuartier='".$fetchSousQuartier['idSousQuartier']."'";
                        $resCountSousQuartierQuartier = $this->connexionBdd->requete($reqCountSousQuartierQuartier);
                        $fetchAdressesSousQuartiers = mysql_fetch_assoc($resCountSousQuartierQuartier);
                        $nbAdressesSousQuartiers += $fetchAdressesSousQuartiers['nbAdressesSousQuartiers'];
                    }

                    $reqCountQuartiers = "SELECT count(distinct idAdresse) as nbAdressesQuartier FROM historiqueAdresse WHERE idQuartier = '".$fetch['idQuartier']."'";
                    $resCountQuartiers = $this->connexionBdd->requete($reqCountQuartiers);
                    $fetchCountQuartiers = mysql_fetch_assoc($resCountQuartiers);
                    $nbAdressesQuartiers += $fetchCountQuartiers['nbAdressesQuartier'];


                    $nbAdressesTotales = $nbAdressesRues + $nbAdressesSousQuartiers + $nbAdressesQuartiers;

                    $nbResultats = "(".$nbAdressesTotales.")";


                    $htmlPhoto='';
                    $urlPhoto = $this->getUrlImageFromQuartier($fetch['idQuartier'], 'moyen');
                    if (!pia_ereg("transparent.gif", $urlPhoto)) {  // la fonction renvoi le lien vers une photo transparente si elle ne trouve pas de photo de du quartier
                        $htmlPhoto = "<a href='".$this->creerUrl('', 'adresseListe', array('recherche_quartier'=>$fetch['idQuartier']))."'><img src='".$urlPhoto."' border=0></a>";
                    } else {
                        // pas de photo
                        $htmlPhoto = "<span style='float:right;margin:0px;padding:0px;'><a href='".$this->creerUrl('', 'adresseListe', array('recherche_quartier'=>$fetch['idQuartier']))."'><table border='' style='margin:0px;padding:0px;border:1px solid #000000;font-size:11px;background-image:url(".$this->getUrlImage()."imageDefautArchiv2.jpg);' width=200 height=150><tr><td align=center valign=center style='padding-top:100px;'>Pas de photo</td></tr></table></a></span>";
                    }


                    $lien = "<a href='".$this->creerUrl('', 'adresseListe', array('recherche_quartier'=>$fetch['idQuartier']))."'>".stripslashes($fetch['nom'])."</a>".$nbResultats;
                    if ($nbAdressesTotales>0) {
                        $tableau->addValue($htmlPhoto."<br>".$lien);
                    }
                }

                $t->assign_vars(array('elements'=>$tableau->createHtmlTableFromArray(3)));
                break;

            case "parVilles":
                $arrayVillesNotEmpty = $r->getIdVillesNotEmpty();
                $arrayListeVillesAvecAdresses = $arrayVillesNotEmpty["arrayIdVilles"];
                $listeVilleAvecAdresses = implode(",", $arrayListeVillesAvecAdresses);
                //pagination
                $reqNbVilles = "
						SELECT 0
						FROM ville
						where (idPays = '1' or idPays='2')
						AND idVille in (".$listeVilleAvecAdresses.")
								and nom <>'autre'
								";
                $resNbVilles = $this->connexionBdd->requete($reqNbVilles);
                $nbEnregistrementTotaux = mysql_num_rows($resNbVilles);
                // nombre d'images affichées sur une page
                $nbEnregistrementsParPage = 12;
                $arrayPagination=$this->pagination(array(
                        'nomParamPageCourante'=>'archiPageCouranteVille',
                        'nbEnregistrementsParPage'=>$nbEnregistrementsParPage,
                        'nbEnregistrementsTotaux'=>$nbEnregistrementTotaux,
                        'typeLiens'=>'noformulaire'
                ));



                $t->assign_vars(array('pagination'=>$arrayPagination['html']));

                $req = "
						SELECT v.nom,v.idVille, lower(substr(v.nom,1,1)) as lettre
						FROM ville v

						WHERE (v.idPays = '1' or v.idPays='2')
						AND v.nom<>'autre'
						AND idVille in (".$listeVilleAvecAdresses.")
								ORDER BY v.nom
								LIMIT ".$arrayPagination['limitSqlDebut'].",".$nbEnregistrementsParPage;

                $tableau = new tableau();

                $res = $this->connexionBdd->requete($req);

                while ($fetch = mysql_fetch_assoc($res)) {
                    $listeRuesVille = "SELECT idRue FROM rue WHERE idSousQuartier IN (SELECT idSousQuartier FROM sousQuartier WHERE idQuartier IN (SELECT idQuartier FROM quartier WHERE idVille='".$fetch['idVille']."'))";
                    $listeSousQuartiersVille = "SELECT idSousQuartier FROM sousQuartier WHERE idQuartier IN (SELECT idQuartier FROM quartier WHERE idVille='".$fetch['idVille']."')";
                    $listeQuartiersVille = "SELECT idQuartier FROM quartier WHERE idVille='".$fetch['idVille']."'";


                    // comptage du nombre d'adresse liés a ces elements d'adresses
                    $resRuesVille = $this->connexionBdd->requete($listeRuesVille);
                    $nbRues = 0;
                    while ($fetchRuesVilles = mysql_fetch_assoc($resRuesVille)) {
                        $reqNbAdressesRue = "SELECT count(distinct idAdresse) as nbAdressesRue FROM historiqueAdresse WHERE idRue='".$fetchRuesVilles['idRue']."'";
                        $resNbAdressesRue = $this->connexionBdd->requete($reqNbAdressesRue);
                        $fetchNbAdressesRue = mysql_fetch_assoc($resNbAdressesRue);
                        $nbRues += $fetchNbAdressesRue['nbAdressesRue'];
                    }

                    $resSousQuartiersVille = $this->connexionBdd->requete($listeSousQuartiersVille);
                    $nbSousQuartiers = 0;
                    while ($fetchSousQuartiersVille = mysql_fetch_assoc($resSousQuartiersVille)) {
                        $reqNbAdressesSousQuartier = "SELECT count(distinct idAdresse) as nbAdressesSousQuartiers FROM historiqueAdresse WHERE idSousQuartier='".$fetchSousQuartiersVille['idSousQuartier']."'";
                        $resNbAdressesSousQuartier = $this->connexionBdd->requete($reqNbAdressesSousQuartier);
                        $fetchNbAdressesSousQuartier = mysql_fetch_assoc($resNbAdressesSousQuartier);
                        $nbSousQuartiers += $fetchNbAdressesSousQuartier['nbAdressesSousQuartiers'];
                    }

                    $resQuartiersVille = $this->connexionBdd->requete($listeQuartiersVille);
                    $nbQuartiers = 0;
                    while ($fetchQuartiersVille = mysql_fetch_assoc($resQuartiersVille)) {
                        $reqNbAdressesQuartier = "SELECT count(distinct idAdresse) as nbAdressesQuartiers FROM historiqueAdresse WHERE idQuartier='".$fetchQuartiersVille['idQuartier']."'";
                        $resNbAdressesQuartier = $this->connexionBdd->requete($reqNbAdressesQuartier);
                        $fetchNbAdressesQuartier = mysql_fetch_assoc($resNbAdressesQuartier);
                        $nbQuartiers += $fetchNbAdressesQuartier['nbAdressesQuartiers'];
                    }

                    $nbVilles = 0;
                    $reqNbAdressesVilles = "SELECT count(distinct idAdresse) as nbAdressesVilles FROM historiqueAdresse WHERE idVille='".$fetch['idVille']."'";
                    $resNbAdressesVilles = $this->connexionBdd->requete($reqNbAdressesVilles);
                    $fetchNbAdressesVilles = mysql_fetch_assoc($resNbAdressesVilles);
                    $nbVilles = $fetchNbAdressesVilles['nbAdressesVilles'];


                    $totalAdresses = $nbRues + $nbQuartiers + $nbVilles;

                    $recherche = new archiRecherche();

                    $nbResult = $recherche->getNumberOfAdresse(array('ville' => $fetch['idVille']));

                    $nbResultats = " (".$nbResult.")";

                    $htmlPhoto="";
                    $urlPhoto = $this->getUrlImageFromVille($fetch['idVille'], 'moyen');
                    if ($urlPhoto!='') {
                        $htmlPhoto = "<a href='".$this->creerUrl('', 'adresseListe', array('recherche_ville'=>$fetch['idVille']))."'><img src='".$urlPhoto."' border=0></a>";
                    }

                    $lien = "<a href='".$this->creerUrl('', 'adresseListe', array('recherche_ville'=>$fetch['idVille']))."'>".stripslashes($fetch['nom'])."</a>".$nbResultats."<br>";
                    if ($totalAdresses>0) {
                        $tableau->addValue($htmlPhoto."<br>".$lien);
                    }
                }

                $t->assign_vars(array('elements'=>$tableau->createHtmlTableFromArray(3)));

                break;
            case "parRuesDeQuartier":
            default:
                // DEFAULT : affichage parRues
                // s'il n'y a pas de criteres on affiche les dossiers des rues de strasbourg
                $r = new archiRecherche();
                $s = new stringObject();

                if (isset($this->variablesGet['archiIdQuartier']) && $this->variablesGet['archiIdQuartier']!='') {
                    $arrayRues = $this->getIdRuesFrom($this->variablesGet['archiIdQuartier'], 'quartier');
                } else {
                    $arrayRues = $this->getIdRuesFrom($idVilleGeneral, 'ville');
                }

                $arrayRuesNotEmpty = $r->getIdRuesNotEmpty();
                $arrayIdRuesNotEmpty=array();
                $arrayListeAlphabetique = array();

                foreach ($arrayRues as $indice => $idRue) {
                    if (in_array($idRue, $arrayRuesNotEmpty['arrayIdRues'])) {
                        $arrayIdRuesNotEmpty[] = $idRue;
                        $reqInitiales = "SELECT lower(substring(nom,1,1)) as initiale FROM rue WHERE idRue='".$idRue."'";
                        $resInitiales = $this->connexionBdd->requete($reqInitiales);
                        $fetchInitiales = mysql_fetch_assoc($resInitiales);
                        $initiale = $fetchInitiales['initiale'];
                        $arrayListeAlphabetique[] = $s->sansAccents($initiale);// enleve les accents

                        if (!isset($this->variablesGet['lettreCourante']) || isset($this->variablesGet['lettreCourante']) && $s->sansAccents($initiale)==$this->variablesGet['lettreCourante']) {
                            $arrayIdRuesNotEmptyWithSelection[] = $idRue; // prend en compte le nombre de rue selectionnée ou non par leur initiales
                        }
                    }
                }

                $sqlCritere = "";
                if (isset($this->variablesGet['lettreCourante']) && $this->variablesGet['lettreCourante']!='') {
                    $sqlCritere = " AND lower(SUBSTRING(nom,1,1))=lower('".$this->variablesGet['lettreCourante']."') ";
                }

                $nbEnregistrementTotaux = count($arrayIdRuesNotEmptyWithSelection);

                // nombre d'images affichées sur une page
                $nbEnregistrementsParPage = 40;
                $pagination = new paginationObject();

                if (isset($this->variablesGet['archiIdQuartier'])) {
                    $arrayPagination=$pagination->pagination(array(
                            'nomParamPageCourante'=>'archiPageRuesQuartier',
                            'nbEnregistrementsParPage'=>$nbEnregistrementsParPage,
                            'nbEnregistrementsTotaux'=>$nbEnregistrementTotaux,
                            'typeLiens'=>'freeLink',
                            'urlFreeLink'=>$this->creerUrl('', 'listeDossiers', array('archiIdQuartier'=>$this->variablesGet['archiIdQuartier'],'modeAffichageListe'=>'parRuesDeQuartier','archiPageRuesQuartier'=>'##numPage##'))

                    ));
                } else {
                    $arrayPagination=$pagination->pagination(array(
                            'nomParamPageCourante'=>'archiPageCouranteVille',
                            'nbEnregistrementsParPage'=>$nbEnregistrementsParPage,
                            'nbEnregistrementsTotaux'=>$nbEnregistrementTotaux,
                            'typeLiens'=>'noformulaire',
                            'arrayListeAlphabetique'=>$arrayListeAlphabetique
                    ));
                }


                $t->assign_vars(array('pagination'=>$arrayPagination['html']));

                $req = "
						SELECT nom,idRue,prefixe, lower(substr(nom,1,1)) as lettre
						FROM rue
						WHERE
						idRue in ('".implode("','", $arrayIdRuesNotEmpty)."')
						$sqlCritere
						ORDER BY lettre
						LIMIT ".$arrayPagination['limitSqlDebut'].",".$nbEnregistrementsParPage;


                $res = $this->connexionBdd->requete($req);

                $tableau = new tableau();

                while ($fetch = mysql_fetch_assoc($res)) {
                // pour chaque rue on va regarder s'il y a des adresses qui correspondent et on les compte (affichage du nombre de resultats)
                    $reqCount = "SELECT count(distinct idAdresse) as nbAdresses FROM historiqueAdresse WHERE idRue='".$fetch['idRue']."'";

                    $resCount = $this->connexionBdd->requete($reqCount);
                    $fetchCount = mysql_fetch_assoc($resCount);
                    $valCount = $fetchCount['nbAdresses'];
                    $nbResultats = " (".$valCount.")";


                    $htmlPhoto='';
                    //$urlPhoto = $this->getUrlImageFromRue($fetch['idRue'],'moyen');
                    $urlPhoto="resizeImage.php?id=".$this->getIdImageFromRue($fetch['idRue']);
                    if (!pia_ereg("transparent.gif", $urlPhoto)) {  // la fonction renvoi le lien vers une photo transparente si elle ne trouve pas de photo de la rue
                        $htmlPhoto = "<a href='".$this->creerUrl('', 'adresseListe', array('recherche_rue'=>$fetch['idRue']))."'><img src='".$urlPhoto."' border=0></a><br>";
                    } else {
                        // pas de photo
                        $htmlPhoto = "<a style='margin:0px;padding:0px;' href='".$this->creerUrl('', 'adresseListe', array('recherche_rue'=>$fetch['idRue']))."'><table border='' style='margin:0px;padding:0px;border:1px solid #000000;font-size:11px;background-image:url(".$this->getUrlImage()."imageDefautArchiv2.jpg);' width=200 height=150><tr><td align=center valign=center style='padding-top:100px;'>Pas de photo</td></tr></table></a>";
                    }

                    $lien = "<a href='".$this->creerUrl('', 'adresseListe', array('recherche_rue'=>$fetch['idRue']))."'>".stripslashes($fetch['prefixe']." ".$fetch['nom'])."</a>".$nbResultats;
                    if ($valCount>0) {
                        $tableau->addValue($htmlPhoto.$lien);
                    }
                }

                $t->assign_vars(array('elements'=>$tableau->createHtmlTableFromArray(5)));

                break;
        }


        ob_start();
        $t->pparse('listeRegroupee');
        $html=ob_get_contents();
        ob_end_clean();

        return $html;
    }
105839
public function indexAction()
    {
        $this->view->roles = (new \Cms\Orm\CmsRoleQuery)->find();
        //jeśli niewybrana rola - przekierowanie na pierwszą istniejącą
        if (!$this->roleId && count($this->view->roles)) {
            $this->getResponse()->redirect('cmsAdmin', 'categoryAcl', 'index', ['roleId' => $this->view->roles[0]->id]);
        }
        //formularz edycji uprawnień
        $form = new Form\CategoryAclForm(null, ['roleId' => $this->roleId]);
        //po zapisie
        if ($form->isSaved()) {
            $this->getMessenger()->addMessage('messenger.categoryAcl.permissions.saved', true);
            //przekierowanie na zapisaną stronę
            $this->getResponse()->redirect('cmsAdmin', 'categoryAcl', 'index', ['roleId' => $this->roleId]);
        }
        $this->view->categoryAclForm = $form;
    }
317091
public function index() {
		
		if (!Auth::check()) return LoginController::getIndex();

		# Trail
		Trail::clear();
		
		$tables = array_where(config('center.tables'), function($key, $value) {
		    return !$value->hidden;
		});
		$groups = $objects = [];
		foreach ($tables as $table) {
			$latest = DB::table($table->name)
				->leftJoin(config('center.db.users') . ' as u2', $table->name . '.updated_by', '=', 'u2.id')
				->select('u2.name as updated_name', $table->name . '.updated_at')
				->orderBy($table->name . '.updated_at', 'desc')
				->first();
			if (!isset($groups[$table->list_grouping])) $groups[$table->list_grouping] = [];
			$groups[$table->list_grouping][] = (object) [
				'title' => $table->title,
				'list_grouping' => $table->list_grouping,
				'link' => action('\LeftRight\Center\Controllers\RowController@index', $table->name),
				'updated_name' => isset($latest->updated_name) ? $latest->updated_name : '',
				'updated_at' => isset($latest->updated_at) ? $latest->updated_at : '',
				'count' => number_format(DB::table($table->name)->count()),
			];
		}
		foreach ($groups as $group) $objects = array_merge($objects, $group);
		
		$table = new Table;
		$table->rows($objects);
		$table->column('title', 'string', trans('center::site.table'));
		$table->column('count', 'integer', trans('center::site.count'));
		$table->column('updated_name', 'updated_name', trans('center::site.updated_name'));
		$table->column('updated_at', 'updated_at', trans('center::site.updated_at'));
		$table->groupBy('list_grouping');
		$table = $table->draw('tables');
		
		
		return view('center::tables.index', compact('table'));
	}
1178359
public function showComponentGroups()
    {
        $this->subMenu['groups']['active'] = true;

        return View::make('dashboard.components.groups.index')
            ->withPageTitle(trans_choice('dashboard.components.groups.groups', 2).' - '.trans('dashboard.dashboard'))
            ->withGroups(ComponentGroup::orderBy('order')->get())
            ->withSubMenu($this->subMenu);
    }
1309476
public function roleGroups() {
    return [
      [
        'label' => 'Пользователи',
        'actions' => [
          self::USER_VIEW,
          self::USER_CREATE,
          self::USER_UPDATE,
          self::USER_CHANGE_SECURITY_INFO,
          self::USER_CHANGE_PROFILE_INFO,
        ],
      ]
    ];
  }