本文整理汇总了PHP中CopixI18N类的典型用法代码示例。如果您正苦于以下问题:PHP CopixI18N类的具体用法?PHP CopixI18N怎么用?PHP CopixI18N使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CopixI18N类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _createContent
public function _createContent(&$toReturn)
{
$tpl = new CopixTpl();
$pAlbumId = $this->getParam('album_id');
$pDossierId = $this->getParam('dossier_id');
// $album_dao = _dao("album");
$dossier_dao = _dao("dossier");
$photo_dao = _dao("photo");
if ($pDossierId > 0) {
$dossier = $dossier_dao->get($pDossierId);
} else {
$dossier->dossier_id = 0;
$dossier->dossier_album = $this->getParam('album_id');
$dossier->dossier_parent = -1;
$dossier->dossier_nom = CopixI18N::get('album|album.message.topfolder');
$dossier->dossier_comment = "";
$dossier->album_id = $pAlbumId;
}
if ($dossier->dossier_album != $pAlbumId) {
return false;
}
$pictures = $photo_dao->findAllByAlbumAndFolder($pAlbumId, $pDossierId);
$tpl->assign('album_id', $pAlbumId);
$tpl->assign('dossier_id', $pDossierId);
$tpl->assign('dossier', $dossier);
$tpl->assign('pictures', $pictures);
$tpl->assign('picture_thumbsize', '_s64');
$dossiers_tree = Album::getFoldersTree($pAlbumId);
$dossiers_commands = Album::tree2commands($dossiers_tree);
$tpl->assign('commands_move', $dossiers_commands);
$toReturn = $tpl->fetch('editphotos.tpl');
return true;
}
示例2: checkPrefs
public function checkPrefs($module, $data)
{
define('AVATAR_MAX_BYTES', 100000);
define('AVATAR_MAX_PIXELS', 100);
$error = array();
if ($data['passwd1'] != '' || $data['passwd2'] != '') {
if ($data['passwd1'] != $data['passwd2']) {
$error['passwd2'] = CopixI18N::get('prefs.config.passwd.error.notsame');
$error['passwd1'] = " ";
}
if (strlen($data['passwd1']) < 5) {
$error['passwd1'] = CopixI18N::get('prefs.config.passwd.error.tooshort');
}
}
if (isset($_FILES) && $_FILES['prefs_avatar_upload']['name']) {
if (!in_array($_FILES['prefs_avatar_upload']['type'], array('image/jpeg', 'image/gif', 'image/png'))) {
$error['avatar_upload'] = CopixI18N::get('prefs.config.avatar.error_format');
} elseif ($_FILES['prefs_avatar_upload']['size'] > AVATAR_MAX_BYTES) {
$error['avatar_upload'] = CopixI18N::get('prefs.config.avatar.error_bytes');
} elseif ((list($width, $height, $type, $attr) = getimagesize($_FILES['prefs_avatar_upload']['tmp_name'])) && max($width, $height) > AVATAR_MAX_PIXELS) {
$error['avatar_upload'] = CopixI18N::get('prefs.config.avatar.error_pixels');
} elseif ($_FILES['prefs_avatar_upload']['error'] != 0) {
$error['avatar_upload'] = CopixI18N::get('prefs.config.avatar.error_inconnue');
}
}
$data['alerte_mail_email'] = trim($data['alerte_mail_email']);
if (isset($data['alerte_mail_email']) && $data['alerte_mail_email'] != '') {
// if( !ereg( "@", $data['alerte_mail_email'] ) )
if (!validateEMail($data['alerte_mail_email'])) {
$error['alerte_mail_email'] = CopixI18N::get('prefs.config.mail.bad_email');
}
}
return $error;
}
示例3: go
/**
* go
*
* Appel automatique, avec détection du noeud à afficher.
* @author Frédéric Mossmann
* @since 10.03.2009
*
*/
public function go()
{
if (!Kernel::is_connected()) {
return CopixActionGroup::process('genericTools|Messages::getError', array('message' => CopixI18N::get('kernel|kernel.error.nologin'), 'back' => CopixUrl::get('auth|default|login')));
}
CopixHtmlHeader::addJSLink(CopixUrl::get() . 'js/iconito/module_concerto.js');
if (!_request("id") || !ereg('^[0-9]+$', _request("id"))) {
return new CopixActionReturn(COPIX_AR_REDIRECT, CopixUrl::get('kernel||getNodes'));
}
$sql = 'SELECT login,password FROM kernel_bu_auth WHERE node_type=\'responsable\' AND node_id=' . _currentUser()->getExtra('id') . ' AND id=\'' . addslashes(_request("id")) . '\' AND service=\'concerto\'';
$concerto = _doQuery($sql);
if (!$concerto) {
return new CopixActionReturn(COPIX_AR_REDIRECT, CopixUrl::get('kernel||getNodes'));
}
$tpl = new CopixTpl();
$tpl->assign('TITLE_PAGE', CopixI18N::get('concerto|concerto.title'));
// $tpl->assign ('MENU', '<a href="'.CopixUrl::get ('groupe||getListPublic').'">'.CopixI18N::get ('groupe|groupe.annuaire').'</a> :: <a href="'.CopixUrl::get ('groupe||getListMy').'">'.CopixI18N::get ('groupe|groupe.my').'</a>');
$tplListe = new CopixTpl();
$tplListe->assign('login', $concerto[0]->login);
$tplListe->assign('password', $concerto[0]->password);
$result = $tplListe->fetch("concerto-form.tpl");
$tpl->assign("MAIN", $result);
$tpl->assign('BODY_ON_LOAD', 'concerto_redirect();');
return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl);
}
示例4: beforeAction
public function beforeAction()
{
_currentUser()->assertCredential('module:*||access|@gestionautonome');
$this->menu = array();
switch (_request('action')) {
case 'createGrade':
case 'validateGradeCreation':
case 'manageGrades':
$current = 'manageGrades';
break;
default:
$current = 'showTree';
}
if (Kernel::isAdmin() || _currentUser()->hasAssistance('can_comptes')) {
if (CopixConfig::exists('kernel|gestionAutonomeEnabled') && CopixConfig::get('kernel|gestionAutonomeEnabled')) {
$this->menu[] = array('txt' => CopixI18N::get('comptes|comptes.menu.getUsers'), 'url' => CopixUrl::get('gestionautonome||showTree'), 'type' => 'users', 'current' => $current == 'showTree' ? 'current' : '');
} else {
$this->menu[] = array('txt' => CopixI18N::get('comptes|comptes.menu.getUsers'), 'url' => CopixUrl::get('comptes||'), 'type' => 'users');
}
$this->menu[] = array('txt' => CopixI18N::get('comptes|comptes.menu.getExt'), 'url' => CopixUrl::get('comptes||getUserExt'), 'type' => 'acl', 'current' => $current == 'getUsersExt' ? 'current' : '');
}
if (Kernel::isAdmin()) {
$this->menu[] = array('txt' => CopixI18N::get('comptes|comptes.menu.getRoles'), 'url' => CopixUrl::get('comptes||getRoles'), 'type' => 'acl', 'current' => $current == 'list' ? 'current' : '');
$this->menu[] = array('txt' => CopixI18N::get('comptes|comptes.menu.manageGrades'), 'url' => CopixUrl::get('gestionautonome||manageGrades'), 'type' => 'agendalist', 'current' => $current == 'manageGrades' ? 'current' : '');
}
$session = _sessionGet('modules|comptes|doLoginCreate|success');
if ($session && is_array($session) && sizeof($session)) {
$this->menu[] = array('txt' => CopixI18N::get('comptes|comptes.strings.showloginresult', sizeof($session)), 'url' => CopixUrl::get('comptes||getLoginResult'), 'size' => 145);
}
$this->addJs('js/iconito/module_gestionautonome.js');
}
示例5: getMagicMail
/**
* Configuration de MagicMail
*
* @author Frederic Mossmann <fmossmann@cap-tic.fr>
* @since 2006/08/09
*/
public function getMagicMail()
{
$id = _request("id");
if (Kernel::getLevel("MOD_MAGICMAIL", $id) < PROFILE_CCV_ADMIN) {
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('magicmail.message.title'));
$dao = CopixDAOFactory::create("magicmail|magicmail");
$magic_result = $dao->get($id);
$tplForm = new CopixTpl();
$tplForm->assign('id', $id);
$tplForm->assign('infos', $magic_result);
// $tplForm->assign ('magicmail_mail', CopixConfig::get ('magicmail|magicmail_mail'));
if (_request("return")) {
$tplForm->assign('return', _request("return"));
}
CopixHTMLHeader::addCSSLink(_resource("styles/module_prefs.css"));
$tplForm->assign('msg', array('type' => 'ok', 'image_url' => _resource('img/prefs/smiley_black.png'), 'image_alt' => 'Ok !', 'value' => CopixI18N::get('prefs|prefs.msg.prefsrecorded')));
$result = $tplForm->fetch("login_form.tpl");
$tpl->assign("MAIN", $result);
$menu = array();
$tpl->assign('MENU', $menu);
return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl);
}
示例6: _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;
}
示例7: getModules
public function getModules()
{
$my_modules = array();
$nodes = Kernel::getMyNodes();
if (sizeof($nodes)) {
foreach ($nodes as $node_key => $node) {
$modules = Kernel::getModEnabled($node->type, $node->id, _currentUser()->getExtra('type'), _currentUser()->getExtra('id'));
foreach ($modules as $modules_key => $module) {
if ($module->module_type != "MOD_PREFS" && preg_match('#^MOD_(.+)$#', $module->module_type, $regs)) {
$mod_tmp = new CopixPPO();
$mod_tmp->type = $module->module_type;
$mod_tmp->nom = $module->module_nom;
$mod_tmp->rep = strtolower($regs[1]);
$my_modules[$module->module_type] = $mod_tmp;
unset($mod_tmp);
}
}
}
}
ksort($my_modules);
$pref_module['MOD_PREFS'] = new CopixPPO();
$pref_module['MOD_PREFS']->type = 'MOD_PREFS';
$pref_module['MOD_PREFS']->nom = CopixI18N::get('prefs|prefs.string.generalprefs');
$pref_module['MOD_PREFS']->rep = 'prefs';
$all_modules = array_merge($pref_module, $my_modules);
return $all_modules;
}
示例8: CopixModuleFileSelector
/**
* instanciation d'un objet plugin.
* instancie également l'objet de configuration associé
* @param string $name nom du plugin
* @param string $conf nom d'un fichier de configuration alternatif. si chaine vide = celui par défaut
* @return CopixPlugin le plugin instancié
*/
function &create($name, $conf = null)
{
require_once COPIX_CORE_PATH . 'CopixPlugin.class.php';
$fic =& new CopixModuleFileSelector($name);
$nom = strtolower($fic->fileName);
$path = $fic->getPath(COPIX_PLUGINS_DIR) . $nom . '/';
$path_plugin = $path . $nom . '.plugin.php';
if (is_null($conf)) {
$path_config = $path . $nom . '.plugin.conf.php';
} else {
$path_config = $path . $conf;
}
if (is_file($path_plugin) && is_file($path_config)) {
require_once $path_config;
require_once $path_plugin;
$classname = 'PluginConfig' . $fic->fileName;
//nom de la classe de configuration.
$config =& new $classname();
//en deux étapes, impossible de mettre la ligne dans les paramètres du constructeur.
$name = 'Plugin' . $fic->fileName;
$toReturn =& new $name($config);
//nouvel objet plugin, on lui passe en paramètre son objet de configuration.
} else {
trigger_error(CopixI18N::get('copix:copix.error.unfounded.plugin', $name), E_USER_ERROR);
$toReturn = null;
}
return $toReturn;
}
示例9: _createContent
public function _createContent(&$toReturn)
{
$tpl = new CopixTpl();
$module_type = $this->getParam('module_type');
$module_id = $this->getParam('module_id');
$action = $this->getParam('action');
$date_debut = $this->getParam('date_debut', null);
$date_fin = $this->getParam('date_fin', null);
$dao = _dao('stats|logs');
$stats = $dao->getStatsModuleAction(array('module_type' => $module_type, 'module_id' => $module_id, 'action' => $action, 'date_debut' => $date_debut, 'date_fin' => $date_fin));
//print_r($stats);
foreach ($stats as $k => $s) {
// Détection du nom Copix du module
list(, $module) = explode("_", strtolower($module_type));
$class = CopixClassesFactory::create("{$module}|Stats{$module}");
$obj = $class->getObjet($action, $s->objet_a);
//print_r($obj);
$stats[$k]->objet_name = isset($obj->name) ? $obj->name : '';
}
$tpl->assign('name', CopixI18N::get('stats.action.' . $module_type . '-' . $action));
$tpl->assign('stats', $stats);
//$tpl->assign ('canWriteOnline' , BlogAuth::canMakeInBlog('ADMIN_ARTICLE_MAKE_ONLINE',create_blog_object($id_blog)));
// retour de la fonction :
$toReturn = $tpl->fetch('module.action.tpl');
return true;
}
示例10: CopixTpl
/**
* Display an error message
*/
function &getConfirm()
{
$tpl =& new CopixTpl();
$tpl->assign('TITLE_PAGE', isset($this->vars['TITLE_PAGE']) ? $this->vars['TITLE_PAGE'] : CopixI18N::get('messages.titlePage.confirm'));
$tpl->assign('MAIN', CopixZone::process('PassThrough', array('title' => $this->vars['title'], 'message' => $this->vars['message'], 'confirm' => $this->vars['confirm'], 'cancel' => $this->vars['cancel'], 'template' => 'confirm.tpl')));
return $return =& new CopixActionReturn(COPIX_AR_DISPLAY, $tpl);
}
示例11: getPrefs
/**
* Renvoie les préférences du module
*
* @author Christophe Beyer <cbeyer@cap-tic.fr>
* @since 2006/05/05
* @param array $data (option) Tableau avec les données (venues de la base)
* @return array Tableau de tableaux avec toutes les préférences
*/
public function getPrefs($data = null)
{
$toReturn = array();
$toReturn['name'] = 'Minimail';
$toReturn['form'] = array(array('type' => 'titre', 'text' => CopixI18N::get('minimail|minimail.config.alerte.title'), 'expl' => CopixI18N::get('minimail|minimail.config.alerte.expl')), array('code' => 'alerte_minimail', 'type' => 'checkbox', 'text' => CopixI18N::get('minimail|minimail.config.alerte.active'), 'value' => $data['alerte_minimail'] ? true : false));
return $toReturn;
}
示例12: processDefault
public function processDefault()
{
_classInclude('sysutils|admin');
if (!Admin::canAdmin()) {
return CopixActionGroup::process('genericTools|Messages::getError', array('message' => CopixI18N::get('kernel|kernel.error.noRights'), 'back' => CopixUrl::get()));
}
echo "Récupération des classeurs de classe sans casier\n";
echo "----------------------------------------------------------------------\n\n";
// Récupération des classeurs de classe sans casier
$sql = 'SELECT DISTINCT module_classeur.id' . ' FROM kernel_mod_enabled, module_classeur' . ' LEFT JOIN module_classeur_dossier ON (module_classeur_dossier.module_classeur_id = module_classeur.id)' . ' WHERE module_classeur.id = kernel_mod_enabled.module_id' . ' AND kernel_mod_enabled.module_type = "MOD_CLASSEUR"' . ' AND kernel_mod_enabled.node_type = "BU_CLASSE"' . ' AND (module_classeur_dossier.id IS NULL' . ' OR module_classeur_dossier.id NOT IN (SELECT id FROM module_classeur_dossier WHERE casier = 1 AND module_classeur_id = module_classeur.id))';
$results = _doQuery($sql);
$dossierDAO = _ioDAO('classeur|classeurdossier');
_classInclude('classeur|classeurService');
echo count($results) . " casiers à créer.\n";
foreach ($results as $result) {
$casier = _record('classeur|classeurdossier');
$casier->classeur_id = $result->id;
$casier->parent_id = 0;
$casier->nom = CopixI18N::get('classeur|classeur.casierNom');
$casier->nb_dossiers = 0;
$casier->nb_fichiers = 0;
$casier->taille = 0;
$casier->cle = classeurService::createKey();
$casier->casier = 1;
$casier->date_creation = date('Y-m-d H:i:s');
$dossierDAO->insert($casier);
echo "Casier du classeur {$result->id} créé avec succès !\n";
}
echo "\n\nFin de la tâche";
return _arNone();
}
示例13: 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);
}
}
示例14: _createContent
public function _createContent(&$toReturn)
{
$tpl = new CopixTpl();
$motcle = $this->getParam('motcle');
$clos = $this->getParam('clos');
$type = $this->getParam('type');
$ecole = $this->getParam('ecole');
$rTelep = $this->getParam('rTelep');
$admin = $this->getParam('admin');
$mondroit = $this->getParam('mondroit');
$daoType =& _dao('teleprocedures|type');
$tpl->assign('arTypes', $daoType->findForTeleprocedure($rTelep->id));
//print_r($rTelep);
$canViewComboEcoles = TeleproceduresService::canMakeInTelep('VIEW_COMBO_ECOLES', $mondroit);
if ($canViewComboEcoles) {
$tpl->assign('comboEcolesLinesSup', array(0 => array('value' => '', 'libelle' => '---'), 1 => array('value' => '', 'libelle' => CopixI18N::get('annuaire|annuaire.comboAllEcoles'))));
}
$tpl->assign('rTelep', $rTelep);
$tpl->assign('admin', $admin);
$tpl->assign('motcle', $motcle);
$tpl->assign('clos', $clos);
$tpl->assign('type', $type);
$tpl->assign('ecole', $ecole);
$tpl->assign('canViewComboEcoles', $canViewComboEcoles);
$toReturn = $tpl->fetch('filtre-zone.tpl');
return true;
}
示例15: _copix_utf8_decode
/**
* Décode uniquement si nous sommes en mode différent de UTF8
*
* @param string $pString Chaine à décoder
* @return string
*/
function _copix_utf8_decode($pString)
{
if (CopixI18N::getCharset() != 'UTF-8') {
return utf8_decode($pString);
}
return $pString;
}