本文整理汇总了PHP中Categorie::getCategories方法的典型用法代码示例。如果您正苦于以下问题:PHP Categorie::getCategories方法的具体用法?PHP Categorie::getCategories怎么用?PHP Categorie::getCategories使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Categorie
的用法示例。
在下文中一共展示了Categorie::getCategories方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setQuestions
private function setQuestions()
{
$categories = new Categorie();
$questions = new Question();
$questions->readQuestions($categories->getCategories());
$tabUn = $questions->getUn();
$tabAutre = $questions->getAutre();
$this->_questions = array('lun1' => $tabUn[0], 'lautre1' => $tabAutre[0], 'lun2' => $tabUn[1], 'lautre2' => $tabAutre[1]);
}
示例2: Categorie
/*-------------------------CONTROLEUR PRINCIPAL DU SITE------------------------------*/
/*----------------------------Tout passe par l'index---------------------------------*/
/*INCLUSION DU HEAD ET DU MENU COMMUNS A TOUTES LES PAGES*/
require 'pages/vues/header.php';
if (!empty($_SESSION['utilisateur'])) {
$sectionMenu2 = '<a href="index.php?page=compte"><span>Compte</span><i class="icon-user-1"></i></a>';
$sectionMenu4 = '<a href="index.php?page=compte&action=deconnexion"><span>Déconnexion</span></a>';
$state = 'connecte';
} else {
$sectionMenu2 = '<a href="index.php?page=inscription"><span>Inscription</span><i class="icon-plus"></i></a>';
$sectionMenu4 = '<a href="index.php?page=connexion"><span>Connexion</span></a>';
$state = 'deconnecte';
}
require 'pages/vues/menu.php';
$categories = new Categorie();
$jeu = count($categories->getCategories()) < 3 ? 'off' : 'on';
// On active ou non le jeu
/*INCLUSION DE LA PAGE DEMANDEE*/
if (empty($_GET['page'])) {
if (!empty($_SESSION['partie'])) {
unset($_SESSION['partie']);
}
if (!empty($_SESSION['adversaire'])) {
unset($_SESSION['adversaire']);
}
require 'pages/vues/accueil.php';
} else {
if (!strcmp($_GET['page'], 'partie')) {
require 'pages/controleurs/controleurPartie.php';
} else {
if (!strcmp($_GET['page'], 'salon')) {
示例3: createView
/**
* Créer la page
*/
private function createView()
{
//Affichage des passkeys
$this->oView->addData('pk_titre', 'Mes passkeys');
//Construction du tableau
$oTable = new TableGenerator();
$oTable->setId(md5('Mes passkeys'));
$oTable->addColumn('Tracker');
$oTable->addColumn('Passkey');
$oTable->addColumn('');
$aPasskeys = Passkey::getUserPasskeys($this->oCurrentUser->getId());
$aTrackers = Tracker::getTrackersSelect();
foreach ($aPasskeys as $oPasskey) {
$oTable->addLine(array($oPasskey->getTrackerName(), $oPasskey->getPasskey(), $this->createPkEditPopup($oPasskey)));
}
$oTable->setBottom($this->createPkAddPopup($aTrackers));
$oTable->create();
$this->oView->addData('pk_content', $oTable->getCode());
//Affichage RSS
$oPurgeButton = new View('minibutton');
$oPurgeButton->addData('link', 'index.php?p=profil&a=purge');
$oPurgeButton->addData('icon', 'fa-trash-o');
$oPurgeButton->addData('style', 'danger');
$oPurgeButton->create();
$this->oView->addData('rss_titre', 'Mes flux RSS');
$this->oView->addData('rss_link', Config::get('installdir') . 'rss.php?cat=autoget&pk=' . $this->oCurrentUser->getPasskey());
$this->oView->addData('rss_purge', $oPurgeButton->getCode());
$aFlux = array();
$aFlux[] = array("name" => "Général", "link" => Config::get('installdir') . 'rss.php?pk=' . $this->oCurrentUser->getPasskey());
$aCategories = Categorie::getCategories();
foreach ($aCategories as $oCategorie) {
$aFlux[] = array("name" => $oCategorie->getName(), "link" => Config::get('installdir') . 'rss.php?cat=' . $oCategorie->getId() . '&pk=' . $this->oCurrentUser->getPasskey());
}
$this->oView->addData('rss_flux', $aFlux);
$this->oView->addData('rss_passkey', $this->oCurrentUser->getPasskey());
$this->oView->Create();
}
示例4: procede
public function procede()
{
//Récupère la catégorie
if ($this->oRequest->existParam('type')) {
$this->iType = $this->oRequest->getParam('type', 'int');
} else {
$this->iType = 0;
}
//Récupère le contenu de la recherche
if ($this->oRequest->existParam('research')) {
$sSearch = $this->oRequest->getParam('research', 'string');
$sSearch = strtr($sSearch, ".", "%");
$sSearch = strtr($sSearch, " ", "%");
} else {
$sSearch = "";
}
//Récupère le nombre d'éléments par page
if ($this->oRequest->existParam('length')) {
$iLenght = $this->oRequest->getParam('length', 'int');
} else {
$iLenght = 10;
}
//Récupère la page affichée
if ($this->oRequest->existParam('draw')) {
$iDraw = $this->oRequest->getParam('draw', 'int');
} else {
$iDraw = 1;
}
//Récupère l'OffSet
if ($this->oRequest->existParam('start')) {
$iStart = $this->oRequest->getParam('start', 'int');
} else {
$iStart = 0;
}
//Récupération du nombre de réponses
$oMysqli = Database::getInstance();
if ($this->iType != 0) {
$sWhere = "AND id_categorie = '{$this->iType}' ";
} else {
$sWhere = '';
}
$oResult = $oMysqli->query("SELECT COUNT(*) as total FROM tks_releases \r\n WHERE name LIKE '%" . $sSearch . "%' {$sWhere} ");
$iNbResponses = $oResult->fetch_assoc()['total'];
$oSearch = new Search($this->oCurrentUser);
$oSearch->searchWithWords($sSearch, $this->iType, $iStart, $iLenght);
$aResults = $oSearch->getReleaseTable();
//Création du Tableau JSON
$aJson = array();
$aJson["draw"] = $iDraw;
$aJson["recordsTotal"] = $iNbResponses;
$aJson["recordsFiltered"] = $iNbResponses;
$aJson["data"] = array();
$aTrackers = Tracker::getTrackers();
$aCategories = Categorie::getCategories();
foreach ($aResults as $aRelease) {
//Affichage de la catégorie
$oCatView = new View('label');
$oCatView->addData('type', 'primary');
if ($aRelease['categorie'] != 0) {
$oCatView->addData('text', $aCategories[$aRelease['categorie']]->getName());
} else {
$oCatView->addData('text', 'Non scrappé');
}
$oCatView->create();
$sTags = $oCatView->getCode() . ' ';
//Affichage des TAGS :
foreach ($aRelease['tags'] as $iTagId => $sTagName) {
if ($iTagId != NULL) {
$oTagView = new View('label');
$oTagView->addData('type', 'info');
$oTagView->addData('text', $sTagName);
$oTagView->create();
$sTags .= $oTagView->getCode() . ' ';
}
}
//Affichage de la source :
$oOriginView = new View('label');
$oOriginView->addData('text', $aRelease['origin']);
if ($aRelease['origin'] == 'Scene') {
$oOriginView->addData('type', 'success');
} else {
$oOriginView->addData('type', 'danger');
}
$oOriginView->create();
$sTags .= $oOriginView->getCode();
//Création de la popup Tracker
$oPopup = new View('releasepopup');
$oPopup->addData('id', md5($aRelease['release']));
$oPopup->addData('tracker', $aTrackers[$aRelease["first_tracker"]]->getName());
$oPopup->addData('nbtracker', count($aRelease['torrents']));
$oPopup->addData('title', $aRelease['release']);
//Affichage des liens
$aTableLinks = array();
foreach ($aRelease['torrents'] as $aTorrent) {
$sButtons = '';
if (isset($aTorrent['fichelink'])) {
$oFicheButton = new View('minibutton');
$oFicheButton->addData('link', $aTorrent['fichelink']);
$oFicheButton->addData('icon', 'fa-search-plus');
$oFicheButton->addData('style', 'primary');
//.........这里部分代码省略.........
示例5: createMenu
/**
* Create menu
* @return array Array with menu elements
*/
private function createMenu()
{
$aMenuItems = array();
//Page : Search
if ($this->oController->getCurrentUser()->checkAccess('search')) {
$aMenuItems['search']['dest'] = 'index.php?p=search';
$aMenuItems['search']['icon'] = 'fa-search';
$aMenuItems['search']['text'] = 'FRAMEWORK_MENU_SEARCH_SEARCH';
$aMenuItems['search']['active'] = $this->sPage == 'search';
$aMenuItems['search']['subs'][0] = array();
$aMenuItems['search']['subs'][0]['dest'] = 'index.php?p=search';
$aMenuItems['search']['subs'][0]['text'] = 'FRAMEWORK_MENU_SEARCH_ALL';
foreach (Categorie::getCategories() as $iCategorieId => $oCategorie) {
$aMenuItems['search']['subs'][$iCategorieId] = array();
$aMenuItems['search']['subs'][$iCategorieId]['dest'] = 'index.php?p=search&type=' . $iCategorieId;
$aMenuItems['search']['subs'][$iCategorieId]['text'] = $oCategorie->getName();
}
}
//Page : Fiches
if ($this->oController->getCurrentUser()->checkAccess('fiches')) {
$aMenuItems['fiches']['dest'] = 'index.php?p=fiches';
$aMenuItems['fiches']['icon'] = 'fa-tags';
$aMenuItems['fiches']['text'] = 'FRAMEWORK_MENU_FICHES_FICHES';
$aMenuItems['fiches']['active'] = $this->sPage == 'fiches';
//Films
$aMenuItems['fiches']['subs']['film'] = array();
$aMenuItems['fiches']['subs']['film']['dest'] = 'index.php?p=fiches&type=film';
$aMenuItems['fiches']['subs']['film']['text'] = 'FRAMEWORK_MENU_FICHES_FILMS';
//Séries
$aMenuItems['fiches']['subs']['serie'] = array();
$aMenuItems['fiches']['subs']['serie']['dest'] = 'index.php?p=fiches&type=serie';
$aMenuItems['fiches']['subs']['serie']['text'] = 'FRAMEWORK_MENU_FICHES_SERIES';
//Musique
$aMenuItems['fiches']['subs']['music'] = array();
$aMenuItems['fiches']['subs']['music']['dest'] = 'index.php?p=fiches&type=music';
$aMenuItems['fiches']['subs']['music']['text'] = 'FRAMEWORK_MENU_FICHES_MUSIQUE';
}
//Page : Statistiques
if ($this->oController->getCurrentUser()->checkAccess('stats')) {
$aMenuItems['stats']['dest'] = 'index.php?p=stats';
$aMenuItems['stats']['icon'] = 'fa-bar-chart-o';
$aMenuItems['stats']['text'] = 'FRAMEWORK_MENU_STATS_STATS';
$aMenuItems['stats']['active'] = $this->sPage == 'stats';
}
//Page : Invitations
if ($this->oController->getCurrentUser()->checkAccess('invites')) {
$aMenuItems['invites']['dest'] = 'index.php?p=invites';
$aMenuItems['invites']['icon'] = 'fa-envelope';
$aMenuItems['invites']['text'] = 'FRAMEWORK_MENU_INVITES_INVITES';
$aMenuItems['invites']['active'] = $this->sPage == 'invites';
}
//Page : Modération
//Sous menu : Signalements
if ($this->oController->getCurrentUser()->checkAccess('modwarnings')) {
$aMenuItems['moderation']['subs']['warnings'] = array();
$aMenuItems['moderation']['subs']['warnings']['dest'] = 'index.php?p=modwarnings';
$aMenuItems['moderation']['subs']['warnings']['text'] = 'FRAMEWORK_MENU_MOD_WARNINGS';
}
if (isset($aMenuItems['moderation']['subs'])) {
$aMenuItems['moderation']['dest'] = '#';
$aMenuItems['moderation']['icon'] = 'fa-exclamation-triangle';
$aMenuItems['moderation']['text'] = 'FRAMEWORK_MENU_MOD_MOD';
$aMenuItems['moderation']['active'] = $this->sPage == 'modwarnings';
}
//Catégorie : Utilisateurs
//Sous menu : Utilisateurs
if ($this->oController->getCurrentUser()->checkAccess('adminusers')) {
$aMenuItems['adminusers']['subs']['users'] = array();
$aMenuItems['adminusers']['subs']['users']['dest'] = 'index.php?p=adminusers';
$aMenuItems['adminusers']['subs']['users']['text'] = 'FRAMEWORK_MENU_USERS_ADMIN';
}
//Sous menu : Ranks
if ($this->oController->getCurrentUser()->checkAccess('adminranks')) {
$aMenuItems['adminusers']['subs']['ranks'] = array();
$aMenuItems['adminusers']['subs']['ranks']['dest'] = 'index.php?p=adminranks';
$aMenuItems['adminusers']['subs']['ranks']['text'] = 'FRAMEWORK_MENU_USERS_RANKS';
}
//Sous menu : Permissions
if ($this->oController->getCurrentUser()->checkAccess('adminpermissions')) {
$aMenuItems['adminusers']['subs']['permissions'] = array();
$aMenuItems['adminusers']['subs']['permissions']['dest'] = 'index.php?p=adminpermissions';
$aMenuItems['adminusers']['subs']['permissions']['text'] = 'FRAMEWORK_MENU_USERS_ACCESS';
}
if (isset($aMenuItems['adminusers']['subs'])) {
$aMenuItems['adminusers']['dest'] = '#';
$aMenuItems['adminusers']['icon'] = 'fa-users';
$aMenuItems['adminusers']['text'] = 'FRAMEWORK_MENU_USERS_USERS';
$aMenuItems['adminusers']['active'] = $this->sPage == 'adminusers' || $this->sPage == 'adminranks' || $this->sPage == 'adminpermissions';
}
//Categorie : Parser
//Sous catégorie : Parser
if ($this->oController->getCurrentUser()->checkAccess('adminparser')) {
$aMenuItems['adminparser']['subs']['parser'] = array();
$aMenuItems['adminparser']['subs']['parser']['dest'] = 'index.php?p=adminparser';
$aMenuItems['adminparser']['subs']['parser']['text'] = 'FRAMEWORK_MENU_PARSER_TAGS';
}
//.........这里部分代码省略.........
示例6: createReleasesTable
private function createReleasesTable($sType)
{
$oSearch = new Search($this->oCurrentUser);
$oSearch->searchWithIdFiche($this->oFiche->getId(), $sType);
$aReleases = $oSearch->getReleaseTable();
if (count($aReleases) != 0) {
$oFinalTable = new TableGenerator();
$oFinalTable->setId('releases');
$oFinalTable->addColumn('Tags');
$oFinalTable->addColumn('Release');
$oFinalTable->addColumn('Lien');
$aTrackers = Tracker::getTrackers();
$aCategories = Categorie::getCategories();
foreach ($aReleases as $iIdRelease => $aRelease) {
//Affichage de la catégorie
$oCatView = new View('label');
$oCatView->addData('type', 'primary');
if ($aRelease['categorie'] != 0) {
$oCatView->addData('text', $aCategories[$aRelease['categorie']]->getName());
} else {
$oCatView->addData('text', 'Non scrappé');
}
$oCatView->create();
$sTags = $oCatView->getCode() . ' ';
//Affichage des TAGS :
foreach ($aRelease['tags'] as $iTagId => $sTagName) {
if ($iTagId != NULL) {
$oTagView = new View('label');
$oTagView->addData('type', 'info');
$oTagView->addData('text', $sTagName);
$oTagView->create();
$sTags .= $oTagView->getCode() . ' ';
}
}
//Affichage de la source :
$oOriginView = new View('label');
$oOriginView->addData('text', $aRelease['origin']);
if ($aRelease['origin'] == 'Scene') {
$oOriginView->addData('type', 'success');
} else {
$oOriginView->addData('type', 'danger');
}
$oOriginView->create();
$sTags .= $oOriginView->getCode();
//Création de la popup Tracker
$oPopup = new View('releasepopup');
$oPopup->addData('id', $iIdRelease);
$oPopup->addData('tracker', $aTrackers[$aRelease["first_tracker"]]->getName());
$oPopup->addData('nbtracker', count($aRelease['torrents']));
$oPopup->addData('title', $aRelease['release']);
//Affichage des liens
$aTableLinks = array();
foreach ($aRelease['torrents'] as $aTorrent) {
$sButtons = '';
if (isset($aTorrent['fichelink'])) {
$oFicheButton = new View('minibutton');
$oFicheButton->addData('link', $aTorrent['fichelink']);
$oFicheButton->addData('icon', 'fa-search-plus');
$oFicheButton->addData('style', 'primary');
$oFicheButton->create();
$sButtons .= $oFicheButton->getCode() . ' ';
}
if (isset($aTorrent['directlink'])) {
$oDirectButton = new View('minibutton');
$oDirectButton->addData('link', $aTorrent['directlink']);
$oDirectButton->addData('icon', 'fa-download');
$oDirectButton->addData('style', 'success');
$oDirectButton->create();
$sButtons .= $oDirectButton->getCode() . ' ';
$oRssButton = new View('miniajaxbutton');
$oRssButton->addData('tid', $aTorrent['torrentid']);
$oRssButton->addData('icon', 'fa-rss-square');
$oRssButton->addData('style', 'warning');
$oRssButton->create();
$sButtons .= $oRssButton->getCode() . ' ';
}
$aTableLinks[] = array($aTrackers[$aTorrent['tracker']]->getName(), $aTorrent['delay'], $sButtons);
}
$oTable = new View('torrentlist');
$oTable->addData('titre', $aRelease['release']);
$oTable->addData('tabledatas', $aTableLinks);
$oTable->addData('bottom', $aRelease['first']);
$oTable->create();
$oPopup->addData('content', $oTable->getCode());
$oPopup->create();
//Affichage du lien de modération
if ($this->oCurrentUser->checkAccess('modrelease')) {
$sFicheLink = '<a href="index.php?p=modrelease&id=' . $aRelease['release_id'] . '" style="color: black;">' . $aRelease['release'] . '</a>';
} else {
$sFicheLink = $aRelease['release'];
}
$oFinalTable->addLine(array($sTags, $sFicheLink, $oPopup->getCode()));
}
$oFinalTable->create();
$this->oView->addData('releases', $oFinalTable->getCode());
} else {
$this->oView->addData('releases', 'Aucune release trouvée :(');
}
}