本文整理汇总了PHP中CopixConfig::get方法的典型用法代码示例。如果您正苦于以下问题:PHP CopixConfig::get方法的具体用法?PHP CopixConfig::get怎么用?PHP CopixConfig::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CopixConfig
的用法示例。
在下文中一共展示了CopixConfig::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _createContent
public function _createContent(&$toReturn)
{
$tpl = new CopixTpl();
$blog = $this->getParam('blog', '');
$cat = $this->getParam('cat', null);
$critere = $this->getParam('critere', null);
//on récupère l'ensemble des articles du blog
$dao = _dao('blog|blogarticle');
if ($cat == null) {
$date = $this->getParam('date', null);
$arData = $dao->getAllArticlesFromBlog($blog->id_blog, $date);
} else {
$arData = $dao->getAllArticlesFromBlogByCat($blog->id_blog, $cat->id_bacg);
$tpl->assign('cat', $cat);
}
//on filtre si on a fait une recherche sur les articles
if ($critere != null) {
$arData = $dao->getAllArticlesFromBlogByCritere($blog->id_blog, $critere);
}
//var_dump($arData);
//on construit un tableau associatif entre l'identifiant de l'article et le nombre de commentaires
foreach ($arData as $article) {
//var_dump($article);
$daoArticleComment =& CopixDAOFactory::getInstanceOf('blog|blogarticlecomment');
$record = _record('blog|blogarticlecomment');
$criteres = _daoSp();
$criteres->addCondition('id_bact', '=', $article->id_bact);
$criteres->addCondition('is_online', '=', 1);
$resultat = $daoArticleComment->findBy($criteres);
$arNbCommentByArticle[$article->id_bact] = count($resultat);
}
if (count($arData) > 0) {
//encodage des URL des catégories pour caractères spéciaux
foreach ($arData as $key => $data) {
//Modification suite à apparition d'un warning due à l'absence de catégories , vboniface 06.11.2006
$arData[$key]->key = $key;
if (isset($arData[$key]->categories)) {
foreach ($arData[$key]->categories as $keyCat => $categorie) {
$arData[$key]->categories[$keyCat]->url_bacg = urlencode($categorie->url_bacg);
}
}
}
if (count($arData) <= intval(CopixConfig::get('blog|nbMaxArticles'))) {
$tpl->assign('pager', "");
$tpl->assign('listArticle', $arData);
$tpl->assign('arNbCommentByArticle', $arNbCommentByArticle);
} else {
$params = array('perPage' => intval(CopixConfig::get('blog|nbMaxArticles')), 'delta' => 5, 'recordSet' => $arData, 'template' => '|pager.tpl');
$Pager = CopixPager::Load($params);
$tpl->assign('pager', $Pager->GetMultipage());
$tpl->assign('listArticle', $Pager->data);
$tpl->assign('arNbCommentByArticle', $arNbCommentByArticle);
}
//rajout suite à bug mantis 54 vboniface 06.11.2006
$tpl->assign('blog', $blog);
}
// retour de la fonction :
$toReturn = $tpl->fetch('listarticle.tpl');
return true;
}
示例2: _createContent
public function _createContent(&$toReturn)
{
$ppo = new CopixPPO();
// Récupération des paramètres
$ppo->classeurId = $this->getParam('classeurId');
$ppo->dossierId = $this->getParam('dossierId');
$ppo->current = $this->getParam('current');
// Gestion des droits
$ppo->niveauUtilisateur = Kernel::getLevel('MOD_CLASSEUR', $ppo->classeurId);
$ppo->typeUtilisateur = _currentUser()->getExtra('type');
$ppo->vue = !is_null(_sessionGet('classeur|typeVue')) ? _sessionGet('classeur|typeVue') : 'liste';
$ppo->conf_ModClasseur_options = CopixConfig::exists('default|conf_ModClasseur_options') ? CopixConfig::get('default|conf_ModClasseur_options') : 0;
// L'album public est t-il publié ?
$ppo->estPublic = false;
if (!is_null($ppo->dossierId) && $ppo->dossierId != 0) {
$dossierDAO = _ioDAO('classeur|classeurdossier');
$ppo->dossier = $dossierDAO->get($ppo->dossierId);
if ($ppo->dossier->public) {
$ppo->estPublic = true;
}
} else {
$classeurDAO = _ioDAO('classeur|classeur');
$classeur = $classeurDAO->get($ppo->classeurId);
if ($classeur->public) {
$ppo->estPublic = true;
}
}
$toReturn = $this->_usePPO($ppo, '_affichage_menu.tpl');
}
示例3: _createContent
public function _createContent(&$toReturn)
{
$ppo = new CopixPPO();
$ppo->conf = new CopixPPO();
$ppo->conf->directorGlobalAffectation = CopixConfig::get('gestionautonome|directorGlobalAffectation');
// Récupérations des filtres en session
$ppo->selected = $this->getParam('selected', 0);
$ppo->withLabel = $this->getParam('with_label', true);
$ppo->withEmpty = $this->getParam('with_empty', true);
$ppo->labelEmpty = $this->getParam('label_empty', null);
$ppo->name = $this->getParam('name', null);
$ppo->cityGroupsIds = array();
$ppo->cityGroupsNames = array();
$citiesGroupDAO = _ioDAO('kernel|kernel_bu_groupe_villes');
if (_currentUser()->testCredential('module:*||cities_group|create@gestionautonome') || _currentUser()->isDirector && $ppo->conf->directorGlobalAffectation) {
$criteria = _daoSp();
$criteria->orderBy('nom_groupe');
$cityGroups = $citiesGroupDAO->findBy($criteria);
} else {
$groups = _currentUser()->getGroups();
$cityGroups = $citiesGroupDAO->findByUserGroups($groups['gestionautonome|iconitogrouphandler']);
}
foreach ($cityGroups as $cityGroup) {
$ppo->cityGroupsIds[] = $cityGroup->id_grv;
$ppo->cityGroupsNames[] = $cityGroup->nom_groupe;
}
$toReturn = $this->_usePPO($ppo, '_filter_groupcity.tpl');
}
示例4: _createContent
function _createContent(&$toReturn)
{
//Création du sous template.
$tpl =& new CopixTpl();
//require_once (COPIX_MODULE_PATH.'cms/'.COPIX_CLASSES_DIR.'cmsworkflow.class.php');
require_once COPIX_MODULE_PATH . 'cms/' . COPIX_CLASSES_DIR . 'cmspage.services.class.php';
CopixContext::push('cms');
$sHeadings =& CopixClassesFactory::instanceOf('copixheadings|CopixHeadingsServices');
$headings = $sHeadings->getTree();
$cmsPages =& new ServicesCMSPage();
$pages = $cmsPages->getList();
if (isset($this->params['onlyLastVersion']) && $this->params['onlyLastVersion'] == 1) {
$pages = $this->_filterLastVersion($pages);
}
CopixContext::pop();
//pagination
foreach ($pages as $page) {
$arPages[$page->id_head][] = $page;
}
$tpl->assign('arPublished', $arPages);
$tpl->assign('arHeadings', $headings);
$tpl->assign('select', $this->params['select']);
$tpl->assign('back', $this->params['back']);
$tpl->assign('popup', $this->params['popup']);
$tpl->assign('height', Copixconfig::get('htmleditor|height'));
$tpl->assign('width', Copixconfig::get('htmleditor|width'));
$tpl->assign('editorType', CopixConfig::get('htmleditor|type'));
$tpl->assign('editorName', $this->params['editorName']);
$toReturn = $tpl->fetch('page.select.ptpl');
return true;
}
示例5: _createContent
public function _createContent(&$toReturn)
{
//Getting the user.
//Create Services, and DAO
$tpl = new CopixTpl();
$id_blog = $this->getParam('id_blog', '');
$tpl->assign('blog', $this->getParam('blog', null));
$tpl->assign('id_blog', $id_blog);
$tpl->assign('kind', $this->getParam('kind', ''));
$tpl->assign('tabBlogFunctions', $this->getParam('tabBlogFunctions', null));
$tpl->assign('can_format_articles', CopixConfig::get('blog|blog.default.can_format_articles'));
$tpl->assign('RESULT', $this->getParam('RESULT', ''));
$parent = Kernel::getModParentInfo("MOD_BLOG", $id_blog);
if ($parent) {
$mods = Kernel::getModEnabled($parent['type'], $parent['id'], '', 0, 1);
// _dump($mods);
$mods = Kernel::filterModuleList($mods, 'MOD_MAGICMAIL');
if (count($mods)) {
$magicmail_infos = _dao('module_magicmail')->get($mods[0]->module_id);
$tpl->assign('magicmail_infos', $magicmail_infos);
// _dump($magicmail_infos);
/*
'id' => '32',
'login' => 'cepapeti',
'domain' => 'magicmail.iconito.fr',
*/
}
}
// retour de la fonction :
$toReturn = $tpl->fetch('blog.show.tpl');
return true;
}
示例6: _createContent
function _createContent(&$toReturn)
{
$tpl =& new CopixTpl();
$dao =& CopixDAOFactory::create('Comment');
$sp =& CopixDAOFactory::createSearchConditions();
$sp->addCondition('id_cmt', '=', $this->params['id']);
$sp->addCondition('type_cmt', '=', $this->params['type']);
$sp->addItemOrder('position_cmt', 'desc');
$arData = $dao->findBy($sp);
if (count($arData) > 0) {
$perPage = isset($this->params['perPage']) ? intval($this->params['perPage']) : intval(CopixConfig::get('comment|perPage'));
$params = array('perPage' => $perPage, 'delta' => 5, 'recordSet' => $arData, 'template' => '|pager.tpl');
$Pager = CopixPager::Load($params);
$tpl->assign('pager', $Pager->GetMultipage());
$tpl->assign('comments', $Pager->data);
}
$tpl->assign('back', $this->params['back']);
$tpl->assign('id', $this->params['id']);
$tpl->assign('type', $this->params['type']);
$adminEnabled = CopixUserProfile::valueOf('site', 'siteAdmin') >= PROFILE_CCV_MODERATE;
$tpl->assign('adminEnabled', $adminEnabled);
$plugAuth =& $GLOBALS['COPIX']['COORD']->getPlugin('auth|auth');
$user =& $plugAuth->getUser();
$tpl->assign('login', $user->login);
$toReturn = $tpl->fetch('comment.list.tpl');
return true;
}
示例7: check
/**
* Surcharge de la fonction de vérification de l'enregistrement pour avoir les bons libellés.
* @param DAORecord $pRecord L'enregistrement à vérifier
*/
public function check($pRecord)
{
//vérifications standards.
if (($arErrors = $this->_compiled_check($pRecord)) === true) {
$arErrors = array();
}
//vérification du format du mail
try {
if (isset($pRecord->authoremail_comment)) {
CopixFormatter::getMail($pRecord->authoremail_comment);
}
} catch (Exception $e) {
$arErrors[] = $e->getMessage();
}
// vérification de l'antispam
if (CopixConfig::get('comments|captcha') != 0 && !isset($pRecord->noCaptcha)) {
$results = _ioDAO('commentscaptcha')->findBy(_ioDAOSp()->addCondition("captcha_id", "=", $pRecord->captcha_id));
if (!(isset($results[0]) && $results[0]->captcha_answer == $pRecord->captcha_answer)) {
$arErrors[] = _i18n('comments.admin.captcha.error');
}
}
//on remplace avec les bons libellés
foreach ($arErrors as $key => $error) {
$arErrors[$key] = str_replace(array('"content_comment"', '"authoremail_comment"', '"authorsite_comment"', '"authorlogin_comment"'), array(_i18n('comments.list.content'), _i18n('comments.list.mail'), _i18n('comments.list.site'), _i18n('comments.list.author')), $error);
}
//erreurs s'il en existe, true sinon
return count($arErrors) == 0 ? true : $arErrors;
}
示例8: doPrepareEditPage
/**
* Pr�paration � l'�dition d'une page.
*/
public function doPrepareEditPage()
{
$id_blog = $this->getRequest('id_blog', null);
$blogDAO = CopixDAOFactory::create('blog|blog');
$blog = $blogDAO->get($id_blog);
if ($id_blog == null) {
return CopixActionGroup::process('genericTools|Messages::getError', array('message' => CopixI18N::get('blog.error.param'), 'back' => CopixUrl::get('blog|admin|listBlog')));
}
if (!BlogAuth::canMakeInBlog('ADMIN_PAGES', $blog)) {
return CopixActionGroup::process('genericTools|Messages::getError', array('message' => CopixI18N::get('blog.error.cannotManagePage'), 'back' => CopixUrl::get('blog|admin|listBlog')));
}
$tpl = new CopixTpl();
$id_bpge = $this->getRequest('id_bpge', null);
$page = null;
if ($id_bpge != null) {
// EDITION D'UNE PAGE
$pageDAO = CopixDAOFactory::create('blog|blogpage');
$page = $pageDAO->get($id_bpge);
} else {
$page->is_online = CopixConfig::get('blog|blog.default.default_is_online_page');
$page->format_bpge = $blog->default_format_articles;
}
$tpl->assign('TITLE_PAGE', $blog->name_blog);
// $menu = '<a href="'.CopixUrl::get ('blog|admin|showBlog', array("id_blog"=>$id_blog, "kind"=>5)).'">'.CopixI18N::get('blog|blog.nav.pages').'</a>';
$menu = getBlogAdminMenu($blog, 5);
$tpl->assign('MENU', $menu);
$tpl->assign('MAIN', CopixZone::process('EditPage', array('id_blog' => $id_blog, 'id_bpge' => $id_bpge, 'page' => $page, 'kind' => $this->getRequest('kind', '0'))));
return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl);
}
示例9: _createContent
public function _createContent(&$toReturn)
{
$ppo = new CopixPPO();
$ppo->conf = new CopixPPO();
$ppo->conf->directorGlobalAffectation = CopixConfig::get('gestionautonome|directorGlobalAffectation');
// Récupérations des filtres en session
$ppo->selected = $this->getParam('selected', null);
$ppo->withLabel = $this->getParam('with_label', true);
$ppo->withEmpty = $this->getParam('with_empty', true);
$ppo->name = $this->getParam('name', null);
if (!is_null($cityId = $this->getParam('city_id', null))) {
// Récupération des écoles de la ville sélectionnée pour liste déroulante
$schoolDAO = _dao('kernel|kernel_bu_ecole');
if (_currentUser()->testCredential('module:city|' . $cityId . '|school|create@gestionautonome') || _currentUser()->isDirector && $ppo->conf->directorGlobalAffectation) {
$schools = $schoolDAO->getByCity($cityId);
} else {
$groups = _currentUser()->getGroups();
$schools = $schoolDAO->findByCityIdAndUserGroups($cityId, $groups['gestionautonome|iconitogrouphandler']);
}
$ppo->schoolsIds = array();
$ppo->schoolsNames = array();
foreach ($schools as $school) {
$ppo->schoolsIds[] = $school->numero;
$ppo->schoolsNames[] = $school->nom;
}
}
$toReturn = $this->_usePPO($ppo, '_filter_school.tpl');
}
示例10: getDefaultCatalog
/**
* Retourne le catalogue de vocabulaire par défaut
*
* @return DAORecordKernel_i18n_vocabulary_catalog or false
*/
public function getDefaultCatalog()
{
$criteria = _daoSp();
$criteria->addCondition('id_vc', '=', CopixConfig::get('kernel|defaultVocabularyCatalog'));
$results = $this->findBy($criteria);
return isset($results[0]) ? $results[0] : false;
}
示例11: _createContent
/**
* Commentaires d'une procedure
*
* @author Christophe Beyer <cbeyer@cap-tic.fr>
* @since 2008/01/30
* @param object $rFiche Recordset de la procedure
*/
public function _createContent(&$toReturn)
{
$tpl = new CopixTpl();
$rFiche = $this->getParam('rFiche');
$mondroit = $this->getParam('mondroit');
$daoinfo =& _dao('infosupp');
$sql = 'SELECT * FROM module_teleprocedure_infosupp WHERE idinter=' . $rFiche->idinter . '';
$canCheckVisible = TeleproceduresService::canMakeInTelep('CHECK_VISIBLE', $mondroit);
$canAddComment = TeleproceduresService::canMakeInTelep('ADD_COMMENT', $mondroit);
if (!$canCheckVisible) {
$sql .= " AND info_message!='' AND info_message IS NOT NULL";
}
$sql .= " ORDER BY dateinfo ASC, idinfo ASC";
$results = _doQuery($sql);
// Pour chaque message on cherche les infos de son auteur
$list = array();
foreach ($results as $r) {
$userInfo = Kernel::getUserInfo("ID", $r->iduser);
//var_dump($userInfo);
$avatar = Prefs::get('prefs', 'avatar', $r->iduser);
$userInfo['avatar'] = $avatar ? CopixConfig::get('prefs|avatar_path') . $avatar : '';
$r->user = $userInfo;
$list[] = $r;
}
//print_r($rFiche);
$tpl->assign('info_message_edition', CopixZone::process('kernel|edition', array('field' => 'info_message', 'format' => $rFiche->type_format, 'content' => '', 'width' => 350, 'height' => 135, 'options' => array('toolbarSet' => 'IconitoBasic', 'enterMode' => 'br', 'toolbarStartupExpanded' => 'false'))));
$tpl->assign('info_commentaire_edition', CopixZone::process('kernel|edition', array('field' => 'info_commentaire', 'format' => $rFiche->type_format, 'content' => '', 'width' => 350, 'height' => 135, 'options' => array('toolbarSet' => 'IconitoBasic', 'enterMode' => 'br', 'toolbarStartupExpanded' => 'false'))));
$tpl->assign('canCheckVisible', $canCheckVisible);
$tpl->assign('canAddComment', $canAddComment);
$tpl->assign('list', $list);
$tpl->assign('rFiche', $rFiche);
$toReturn = $tpl->fetch('fiche-comms-zone.tpl');
return true;
}
示例12: _createContent
public function _createContent(&$toReturn)
{
$ppo = new CopixPPO();
$ppo->conf = new CopixPPO();
$ppo->conf->directorGlobalAffectation = CopixConfig::get('gestionautonome|directorGlobalAffectation');
// Récupérations des filtres en session
$ppo->selected = $this->getParam('selected', null);
$ppo->withLabel = $this->getParam('with_label', true);
$ppo->withEmpty = $this->getParam('with_empty', true);
$ppo->labelEmpty = $this->getParam('label_empty', null);
$ppo->name = $this->getParam('name', null);
if (!is_null($cityGroupId = $this->getParam('city_group_id', null))) {
$cityDAO = _dao('kernel|kernel_bu_ville');
if (_currentUser()->testCredential('module:cities_group|' . $cityGroupId . '|city|create@gestionautonome') || _currentUser()->isDirector && $ppo->conf->directorGlobalAffectation) {
$cities = $cityDAO->getByIdGrville($cityGroupId);
} else {
$groups = _currentUser()->getGroups();
$cities = $cityDAO->findByCitiesGroupIdAndUserGroups($cityGroupId, $groups['gestionautonome|iconitogrouphandler']);
}
$ppo->citiesIds = array();
$ppo->citiesNames = array();
foreach ($cities as $city) {
$ppo->citiesIds[] = $city->id_vi;
$ppo->citiesNames[] = $city->nom;
}
}
$toReturn = $this->_usePPO($ppo, '_filter_city.tpl');
}
示例13: getTagsByGroups
public function getTagsByGroups($idGroups = array())
{
$groupsCollection = array();
foreach ($idGroups as $idGroup) {
$groupsCollection[$idGroup]['tags'] = $this->getTagsByGroup($idGroup);
}
//calculate tags weight for group List
$tagCollection = array();
$max = 1;
foreach ($groupsCollection as $group) {
foreach ($group['tags'] as $tag) {
if (!isset($tagCollection[$tag['name']])) {
$tagCollection[$tag['name']] = 1;
} else {
$tagCollection[$tag['name']]++;
if ($tagCollection[$tag['name']] > $max) {
$max = $tagCollection[$tag['name']];
}
}
}
}
//ponderate between 1 and 100
$ponde = 100 / $max;
$ponderation = CopixConfig::get('groupe|ponderation');
foreach ($tagCollection as $tagName => $weight) {
$tagCollection[$tagName] = round($weight * $ponde / $ponderation);
}
return $return = array('tags' => $tagCollection, 'groups' => $groupsCollection);
}
示例14: create
public function create($infos = array())
{
$blogDAO = _dao('blog|blog');
$res = null;
$tabBlogFunctions = returnAllBlogFunctions();
$blog = _record('blog|blog');
if ($infos['title']) {
$blog->name_blog = $infos['title'] . (isset($infos['subtitle']) && strlen($infos['subtitle']) > 0 ? ' (' . $infos['subtitle'] . ')' : '');
} else {
$blog->name_blog = CopixI18N::get('blog|blog.default.titre');
}
$blog->id_ctpt = 1;
$blog->style_blog_file = 0;
$is_public_default = CopixConfig::exists('blog|blog.default.is_public') ? CopixConfig::get('blog|blog.default.is_public') : 1;
$blog->is_public = isset($infos['is_public']) ? $infos['is_public'] : $is_public_default;
$blog->has_comments_activated = 0;
$blog->type_moderation_comments = CopixConfig::get('blog|blog.default.type_moderation_comments');
$blog->default_format_articles = CopixConfig::get('blog|blog.default.default_format_articles');
$blog->privacy = CopixConfig::exists('blog|blog.default.privacy') ? CopixConfig::get('blog|blog.default.privacy') : 0;
$blogDAO->insert($blog);
if ($blog->id_blog !== NULL) {
// On détermine l'URL titre
$blog->url_blog = KernelBlog::calcule_url_blog($blog->id_blog, $blog->name_blog);
$blogDAO->update($blog);
// On ajoute une catégorie
$categoryDAO = _dao('blog|blogarticlecategory');
$category = _record('blog|blogarticlecategory');
$category->id_blog = $blog->id_blog;
$category->name_bacg = CopixI18N::get('blog|blog.default.categorie');
$category->url_bacg = killBadUrlChars($category->name_bacg) . date('YmdHis');
$category->order_bacg = $categoryDAO->getNewPos($blog->id_blog);
$categoryDAO->insert($category);
}
return $blog->id_blog !== NULL ? $blog->id_blog : NULL;
}
示例15: _createContent
function _createContent(&$toReturn)
{
$tpl =& new CopixTpl();
$tpl->assign('login', $this->params['login']);
$tpl->assign('enabledSendLogin', CopixConfig::get('auth|enableSendLostPassword'));
$toReturn = $tpl->fetch('login.failed.tpl');
}