本文整理汇总了PHP中CopixConfig类的典型用法代码示例。如果您正苦于以下问题:PHP CopixConfig类的具体用法?PHP CopixConfig怎么用?PHP CopixConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CopixConfig类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _createContent
public function _createContent(&$toReturn)
{
//Getting the user.
//Create Services, and DAO
$tpl = new CopixTpl();
$tpl->assign('blog', $this->getParam('blog', null));
$tpl->assign('kind', $this->getParam('kind', null));
$tpl->assign('id_blog', $this->getParam('id_blog', ''));
$tpl->assign('errors', $this->getParam('errors', ''));
$tpl->assign('showErrors', $this->getParam('showErrors', ''));
$tpl->assign('logoPath', $this->getParam('logoPath', null));
$tpl->assign('tabBlogFunctions', $this->getParam('tabBlogFunctions', null));
$tpl->assign('can_format_articles', CopixConfig::get('blog|blog.default.can_format_articles'));
$tpl->assign('is_public', array('values' => array(1, 0), 'output' => array(CopixI18N::get('blog|blog.oui'), CopixI18N::get('blog|blog.non'))));
$tpl->assign('has_comments_activated', array('values' => array(1, 0), 'output' => array(CopixI18N::get('blog|blog.oui'), CopixI18N::get('blog|blog.non'))));
$tpl->assign('type_moderation_comments', array('values' => array('POST', 'PRE'), 'output' => array(CopixI18N::get('blog|blog.type_moderation_comments.post'), CopixI18N::get('blog|blog.type_moderation_comments.pre'))));
if (CopixConfig::get('blog|blog.default.can_format_articles')) {
$formats = CopixConfig::get('blog|blog.formats_articles');
$tabFormats = explode(',', $formats);
$values = $output = array();
foreach ($tabFormats as $k) {
$values[] = $k;
$output[] = CopixI18N::get('blog|blog.default_format_articles.' . $k);
}
$tpl->assign('default_format_articles', array('values' => $values, 'output' => $output));
} else {
$tpl->assign('default_format_articles', CopixConfig::get('blog|blog.default.default_format_articles'));
}
$tpl->assign('logo_max_width', CopixConfig::get('blog|blog.default.logo_max_width'));
// retour de la fonction :
$toReturn = $tpl->fetch('blog.edit.tpl');
return true;
}
示例2: _createContent
/**
* Création du contenu de la page
*/
public function _createContent(&$toReturn)
{
$tpl = new CopixTpl();
$tpl->assign('arModulesPath', CopixConfig::instance()->arModulesPath);
$tpl->assign('arModules', $this->_getModuleOrderByDescription());
$toReturn = $tpl->fetch('modules.list.tpl');
}
示例3: 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;
}
示例4: _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');
}
示例5: 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);
}
示例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: _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;
}
示例8: _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');
}
示例9: start
/**
* Demarrage de la session
* @param string $pId l'identifiant de la session,
* utile si vous avez plusieurs copix sur un même serveur
* et que vous ne souhaitez pas partager les sessions
*/
public static function start($pId = null)
{
if ($pId === null) {
$pId = CopixConfig::instance()->sessionName;
}
session_start($pId);
}
示例10: _createContent
public function _createContent(&$toReturn)
{
//load PPO
$ppo = new CopixPPO();
$ppo->user = _currentUser();
//if user is connected : load personal informations
if ($ppo->user->isConnected()) {
$ppo->animateur = _sessionGet('user_animateur') ? 1 : 0;
$ppo->ien = _sessionGet('prisedecontrole_ien') ? 1 : 0;
$type = $ppo->user->getExtra('type');
$sexe = $ppo->user->getExtra('sexe') == 2 ? 2 : '';
$ppo->usertype = strtolower($type) . $sexe;
}
// Get vocabulary catalog to use
if ($myNode = CopixSession::get('myNode')) {
$nodeVocabularyCatalogDAO = _ioDAO('kernel|kernel_i18n_node_vocabularycatalog');
$vocabularyCatalog = $nodeVocabularyCatalogDAO->getCatalogForNode($myNode['type'], $myNode['id']);
}
$ppo->vocabularyCatalogId = isset($vocabularyCatalog) ? $vocabularyCatalog->id_vc : CopixConfig::get('kernel|defaultVocabularyCatalog');
$this->addJs('js/iconito/module_auth.js');
$this->addCss('styles/module_auth.css');
$ppo->conf_Cas_actif = CopixConfig::exists('default|conf_Cas_actif') ? CopixConfig::get('default|conf_Cas_actif') : 0;
$ppo->conf_Saml_actif = CopixConfig::exists('default|conf_Saml_actif') ? CopixConfig::get('default|conf_Saml_actif') : 0;
//load tpl
$toReturn = $this->_usePPO($ppo, 'userlogged.tpl');
}
示例11: processDefault
public function processDefault()
{
$tpl = new CopixTpl();
$tplModule = new CopixTpl();
//if user is not connected :
if (1) {
// S'il y a un blog prevu a l'accueil
$dispBlog = false;
$getKernelLimitsIdBlog = Kernel::getKernelLimits('id_blog');
if ($getKernelLimitsIdBlog) {
_classInclude('blog|kernelblog');
if ($blog = _ioDao('blog|blog')->getBlogById($getKernelLimitsIdBlog)) {
// On v�rifie qu'il y a au moins un article
$stats = KernelBlog::getStats($blog->id_blog);
if ($stats['nbArticles']['value'] > 0) {
$dispBlog = true;
}
}
}
if ($dispBlog) {
//return CopixActionGroup::process ('blog|frontblog::getListArticle', array ('blog'=>$blog->url_blog));
return new CopixActionReturn(COPIX_AR_REDIRECT, CopixUrl::get('blog||', array('blog' => $blog->url_blog)));
}
if (!CopixConfig::exists('|can_public_rssfeed') || CopixConfig::get('|can_public_rssfeed')) {
CopixHtmlHeader::addOthers('<link rel="alternate" href="' . CopixUrl::get('public||rss', array()) . '" type="application/rss+xml" title="' . htmlentities(CopixI18N::get('public|public.rss.flux.title')) . '" />');
}
CopixHTMLHeader::addCSSLink(_resource("styles/module_fichesecoles.css"));
$tplModule->assign('user', _currentUser());
$result = $tplModule->fetch('welcome|welcome_' . CopixI18N::getLang() . '.tpl');
$tpl->assign('TITLE_PAGE', '' . CopixI18N::get('public|public.welcome.title'));
$tpl->assign('MAIN', $result);
return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl);
}
}
示例12: _createContent
public function _createContent(&$toReturn)
{
$tpl = new CopixTpl();
$tpl->assign('homepageUrl', CopixConfig::get('|homePage'));
$toReturn = $tpl->fetch('selecthomepage.form.tpl');
return true;
}
示例13: _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;
}
示例14: home
/**
* Accueil des stats
*
* @author Christophe Beyer <cbeyer@cap-tic.fr>
* @since 2007/03/19
*/
public function home()
{
if (!Admin::canAdmin()) {
return CopixActionGroup::process('genericTools|Messages::getError', array('message' => CopixI18N::get('kernel|kernel.error.noRights'), 'back' => CopixUrl::get()));
}
$tpl = new CopixTpl();
$tpl->assign('TITLE_PAGE', CopixI18N::get('sysutils|admin.menu.stats'));
$tpl->assign('MENU', Admin::getMenu('stats'));
$tplStats = new CopixTpl();
$modules = Kernel::getAllModules();
$tab = array();
foreach ($modules as $mod_val) {
$arModulesPath = CopixConfig::instance()->arModulesPath;
foreach ($arModulesPath as $modulePath) {
$class_file = $modulePath . $mod_val . '/' . COPIX_CLASSES_DIR . 'kernel' . $mod_val . '.class.php';
if (!file_exists($class_file)) {
continue;
}
$module_class =& CopixClassesFactory::Create($mod_val . '|Kernel' . $mod_val);
//print_r($module_class);
if (!is_callable(array($module_class, 'getStatsRoot'))) {
continue;
}
//$classeModule = CopixClassesFactory::create("$label|Kernel$label");
$tab[$mod_val]['module_nom'] = Kernel::Code2Name('mod_' . $mod_val);
$tab[$mod_val]['stats'] = $module_class->getStatsRoot();
}
}
//print_r($tab);
$tplStats->assign('tab', $tab);
$tpl->assign('MAIN', $tplStats->fetch('sysutils|stats.modules.tpl'));
return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl);
}
示例15: _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;
}