public function process($pParams) { extract($pParams); if (!isset($tips) && !isset($warning)) { return ''; } $toReturn = ''; if (isset($warning)) { foreach ($warning as $warn) { $toReturn .= '<li style="color: #FF2222;font-weight:bold;">' . $warn . '</li>'; } } if (isset($tips)) { foreach ($tips as $tip) { $toReturn .= '<li>' . $tip . '</li>'; } } if (strlen($toReturn)) { $toReturn = '<ul>' . $toReturn . '</ul>'; if (isset($title)) { $toReturn = '<h2><img src="' . _resource('img/icons/help.gif') . '" /> ' . $title . '</h2>' . $toReturn; } elseif (isset($titlei18n)) { $toReturn = '<h2><img src="' . _resource('img/icons/help.gif') . '" /> ' . _i18n($titlei18n) . '</h2>' . $toReturn; } } return $toReturn; }
public function _createContent(&$toReturn) { $arModuleToInstall = CopixSession::get('arModuleToInstall', 'copix'); $arInstalledModule = CopixSession::get('arInstalledModule', 'copix'); $moduleName = array_pop($arModuleToInstall); $url = $this->getParam('url'); if (($message = CopixModule::installModule($moduleName)) === true) { $toReturn = _i18n('install.module.install') . ' ' . $moduleName . ' <img src="' . _resource('img/tools/valid.png') . '" />'; if (count($arModuleToInstall) > 0) { $toReturn .= _tag('copixzone', array('id' => uniqid(), 'process' => 'admin|installmodule', 'url' => $url, 'auto' => true, 'ajax' => true)); } elseif ($url) { $toReturn .= sprintf('<form action="%s" method="post"><input type="submit" value="%s"/></form>', htmlspecialchars($url), _i18n('copix:common.buttons.next')); } else { $toReturn .= "<script>\$('back').setStyle('display','');</script>"; } array_push($arInstalledModule, $moduleName); } else { array_push($arInstalledModule, $moduleName); $toReturn = _i18n('install.module.install') . ' ' . $moduleName . ' ' . _tag('popupinformation', array('img' => _resource('img/tools/delete.png')), $message); $toReturn .= '<div class="errorMessage">' . $message . '</div>'; if (count($arInstalledModule) > 0) { CopixSession::set('arModuleToDelete', $arInstalledModule, 'copix'); CopixSession::set('arInstalledModule', null, 'copix'); CopixSession::set('arModuleToInstall', null, 'copix'); $toReturn .= _tag('copixzone', array('id' => uniqid(), 'process' => 'admin|deletemodule', 'auto' => true, 'ajax' => true)); } } CopixSession::set('arModuleToInstall', $arModuleToInstall, 'copix'); CopixSession::set('arInstalledModule', $arInstalledModule, 'copix'); return true; }
protected function _validate($pValue) { if (!is_array($pValue)) { return _i18n('copix:copixvalidator.array.array', $pValue); } $toReturn = array(); if ($search = $this->getParam('contains', null)) { if (!in_array($search, $pValue)) { $toReturn[] = _i18n('copix:copixvalidator.array.mustContains', $search); } } if ($maxSize = $this->getparam('maxSize', null)) { if (count($pValue) > $maxSize) { $toReturn[] = _i18n('copix:copixvalidator.array.maxSize', array($maxSize, count($pValue))); } } if ($minSize = $this->getparam('minSize', null)) { if (count($pValue) < $minSize) { $toReturn[] = _i18n('copix:copixvalidator.array.minSize', array($minSize, count($pValue))); } } if ($size = $this->getparam('size', null)) { if (count($pValue) != $size) { $toReturn[] = _i18n('copix:copixvalidator.array.size', array($size, count($pValue))); } } return empty($toReturn) ? true : $toReturn; }
/** * On s'assure que pour ces tâche ce soit bien un administrateur */ public function beforeAction() { CopixAuth::getCurrentUser()->assertCredential('basic:admin'); if (!CopixConfig::instance()->copixauth_isRegisteredCredentialHandler('auth|dbdynamiccredentialhandler')) { throw new CopixException(_i18n('auth.dynamicHandlerNotRegister')); } }
public function process($pParams) { // paramètres requis $requestedParameters = array('form', 'submit', 'divErrors', 'urlVerif', 'urlSubmit'); foreach ($requestedParameters as $param) { if (!isset($pParams[$param])) { throw new CopixTemplateTagException(_i18n('copix:copix.smarty.badTagParamValue', array('null', $param, 'ajax_submitform'))); } } // on a besoin de mootools _tag('mootools'); // code javascript $jsCode = ' window.addEvent(\'domready\', function(){ $(\'' . $pParams['submit'] . '\').addEvent(\'click\', function(e) { $(\'' . $pParams['submit'] . '\').disabled = true; $(\'' . $pParams['form'] . '\').action = \'' . _url($pParams['urlVerif']) . '\'; new Event (e).stop (); $(\'' . $pParams['form'] . '\').send ({ update: $(\'formErrors\'), onComplete: function (response) { if (response == \'true\') { $(\'' . $pParams['form'] . '\').action = \'' . _url($pParams['urlSubmit']) . '\'; $(\'' . $pParams['form'] . '\').submit (); } else { $(\'' . $pParams['submit'] . '\').disabled = false; } }, }); }); });'; CopixHTMLHeader::addJSCode($jsCode, 'ajax_submitform_' . $pParams['form']); }
public function process($pParams, $content) { extract($pParams); if (!isset($name)) { throw new CopixTemplateTagException("Manque nom"); } $toReturn = "<div id=\"wiki_toolbar\" style=\"clear:both\">\n"; $toReturn .= "<a class=\"wiki_toolbar\" onclick=\"javascript:fontStyle('**','**','" . _i18n("wiki|wiki.bold") . "');\" title=\"" . _i18n("wiki|wiki.bold") . "\"><img src=\"" . CopixUrl::getResource('/img/modules/wiki/bold.png') . "\" /></a>\n"; $toReturn .= "<a class=\"wiki_toolbar\" onclick=\"javascript:fontStyle('//','//','" . _i18n("wiki|wiki.italic") . "');\" title=\"" . _i18n("wiki|wiki.italic") . "\"><img src=\"" . CopixUrl::getResource('/img/modules/wiki/italic.png') . "\" /></a>\n"; $toReturn .= "<a class=\"wiki_toolbar\" onclick=\"javascript:fontStyle('__','__','" . _i18n("wiki|wiki.underline") . "');\" title=\"" . _i18n("wiki|wiki.underline") . "\"><img src=\"" . CopixUrl::getResource('/img/modules/wiki/underline.png') . "\" /></a>\n"; $toReturn .= "<a class=\"wiki_toolbar\" onclick=\"javascript:fontStyle(' *','','" . _i18n("wiki|wiki.listitem") . "');\" title=\"" . _i18n("wiki|wiki.listitem") . "\"><img src=\"" . CopixUrl::getResource('/img/modules/wiki/list.png') . "\" /></a>\n"; $toReturn .= "<a class=\"wiki_toolbar\" onclick=\"javascript:fontStyle('<del>','</del>','" . _i18n("wiki|wiki.strike") . "');\" title=\"" . _i18n("wiki|wiki.strike") . "\"><img src=\"" . CopixUrl::getResource('/img/modules/wiki/strike.png') . "\" /></a>\n"; $toReturn .= "<a class=\"wiki_toolbar\" onclick=\"javascript:fontStyle('\n----\n','','');\" title=\"" . _i18n("wiki|wiki.hr") . "\"><img src=\"" . CopixUrl::getResource('/img/modules/wiki/hr.png') . "\" /></a>\n"; $toReturn .= "<a class=\"wiki_toolbar\" onclick=\"javascript:fontStyle('\\'\\'','\\'\\'','" . _i18n("wiki|wiki.code") . "');\" title=\"" . _i18n("wiki|wiki.code") . "\"><img src=\"" . CopixUrl::getResource('/img/modules/wiki/code.png') . "\" /></a>\n"; $toReturn .= "<a class=\"wiki_toolbar\" onclick=\"javascript:addHeader(1);\" title=\"" . _i18n("wiki|wiki.header", 1) . "\"><img src=\"" . CopixUrl::getResource('/img/modules/wiki/h1.png') . "\" /></a>\n"; $toReturn .= "<a class=\"wiki_toolbar\" onclick=\"javascript:addHeader(2);\" title=\"" . _i18n("wiki|wiki.header", 2) . "\"><img src=\"" . CopixUrl::getResource('/img/modules/wiki/h2.png') . "\" /></a>\n"; $toReturn .= "<a class=\"wiki_toolbar\" onclick=\"javascript:addHeader(3);\" title=\"" . _i18n("wiki|wiki.header", 3) . "\"><img src=\"" . CopixUrl::getResource('/img/modules/wiki/h3.png') . "\" /></a>\n"; $toReturn .= "<a class=\"wiki_toolbar\" onclick=\"javascript:addHeader(4);\" title=\"" . _i18n("wiki|wiki.header", 4) . "\"><img src=\"" . CopixUrl::getResource('/img/modules/wiki/h4.png') . "\" /></a>\n"; $toReturn .= "<a class=\"wiki_toolbar\" onclick=\"javascript:addHeader(5);\" title=\"" . _i18n("wiki|wiki.header", 5) . "\"><img src=\"" . CopixUrl::getResource('/img/modules/wiki/h5.png') . "\" /></a>\n"; $toReturn .= "<a class=\"wiki_toolbar\" onclick=\"javascript:sendForPreview();\" title=\"" . _i18n("wiki|wiki.show.preview") . "\"><img src=\"" . CopixUrl::getResource('/img/modules/wiki/preview.png') . "\" /></a>\n"; $toReturn .= "</div>"; $toReturn .= "\n<textarea class=\"noresizable\" id=\"wiki_area_content\" name=\"{$name}\"\n cols=\"100\" rows=\"30\">{$content}\n</textarea>\n<div id=\"aj_wiki_prev\" style=\"display: none\">\n</div>\n\n "; $urlofrenderer = _url('generictools|ajax|getwikipreview'); CopixHTMLHeader::addJsCode("\nvar onPreviewMode = false;\nfunction sendForPreview()\n{\n if(!onPreviewMode){\n var borders=\$('wiki_area_content').getStyle('border');\n var width=\$('wiki_area_content').getStyle('width');\n \$('aj_wiki_prev').setStyles({\n 'border': borders,\n 'width' : width\n });\n var aj = new Ajax('" . $urlofrenderer . "',{\n method : 'post',\n update :'aj_wiki_prev',\n data : 'torender='+\$('wiki_area_content').value\n }).request();\n onPreviewMode = true;\n \$('wiki_area_content').setStyle('display','none')\n \$('aj_wiki_prev').setStyle('display','block')\n }else{\n \$('wiki_area_content').setStyle('display','block');\n \$('aj_wiki_prev').setStyle('display','none');\n onPreviewMode = false;\n }\n}\n\nfunction addHeader(n)\n{\n var h=\"\";\n if(n==1) h=\"======\";\n if(n==2) h=\"=====\";\n if(n==3) h=\"====\";\n if(n==4) h=\"===\";\n if(n==5) h=\"==\";\n\n var editor = document.getElementById('wiki_area_content');\n fontStyle(h+\" \",\" \"+h,\"Header\"+n);\n}\n\n/**\n * apply tagOpen/tagClose to selection in textarea, use sampleText instead\n * of selection if there is none copied and adapted from phpBB\n *\n * @author phpBB development team\n * @author MediaWiki development team\n * @author Andreas Gohr <*****@*****.**>\n * @author Jim Raynor <*****@*****.**>\n */\nfunction fontStyle(tagOpen, tagClose, sampleText)\n{\n var txtarea = document.getElementById('wiki_area_content');\n // IE\n if(document.selection && !is_gecko) {\n var theSelection = document.selection.createRange().text;\n var replaced = true;\n if(!theSelection){\n replaced = false;\n theSelection=sampleText;\n }\n txtarea.focus();\n\n // This has change\n text = theSelection;\n if(theSelection.charAt(theSelection.length - 1) == \" \"){// exclude ending space char, if any\n theSelection = theSelection.substring(0, theSelection.length - 1);\n r = document.selection.createRange();\n r.text = tagOpen + theSelection + tagClose + \" \";\n } else {\n r = document.selection.createRange();\n r.text = tagOpen + theSelection + tagClose;\n }\n if(!replaced){\n r.moveStart('character',-text.length-tagClose.length);\n r.moveEnd('character',-tagClose.length);\n }\n r.select();\n // Mozilla\n } else if(txtarea.selectionStart || txtarea.selectionStart == '0') {\n var replaced = false;\n var startPos = txtarea.selectionStart;\n var endPos = txtarea.selectionEnd;\n if(endPos - startPos) replaced = true;\n var scrollTop=txtarea.scrollTop;\n var myText = (txtarea.value).substring(startPos, endPos);\n if(!myText) { myText=sampleText;}\n if(myText.charAt(myText.length - 1) == \" \"){ // exclude ending space char, if any\n subst = tagOpen + myText.substring(0, (myText.length - 1)) + tagClose + \" \";\n } else {\n subst = tagOpen + myText + tagClose;\n }\n txtarea.value = txtarea.value.substring(0, startPos) + subst +\n txtarea.value.substring(endPos, txtarea.value.length);\n txtarea.focus();\n\n //set new selection\n //modified by Patrice Ferlet\n // - selection wasn't good for selected text replaced\n txtarea.selectionStart=startPos+tagOpen.length;\n txtarea.selectionEnd=startPos+tagOpen.length+myText.length;\n\n txtarea.scrollTop=scrollTop;\n // All others\n } else {\n var copy_alertText=alertText;\n var re1=new RegExp(\"\\\$1\",\"g\");\n var re2=new RegExp(\"\\\$2\",\"g\");\n copy_alertText=copy_alertText.replace(re1,sampleText);\n copy_alertText=copy_alertText.replace(re2,tagOpen+sampleText+tagClose);\n var text;\n if (sampleText) {\n text=prompt(copy_alertText);\n } else {\n text=\"\";\n }\n if(!text) { text=sampleText;}\n text=tagOpen+text+tagClose;\n //append to the end\n txtarea.value += text;\n\n // in Safari this causes scrolling\n if(!is_safari) {\n txtarea.focus();\n }\n\n }\n // reposition cursor if possible\n if (txtarea.createTextRange) txtarea.caretPos = document.selection.createRange().duplicate();\n}\n "); return $toReturn; }
public function getIdContCliVend() { $cmdOnFilter = "function(){\n var objWhere = new TWhere('AND');\n \n var idCliente = \$('#frm_cv_pedido #id_cliente'); \n if (idCliente.val() == ''){\n jQuery.DialogT.alert('" . _i18n('Necessário informar o Cliente!') . "');\n return false;\n }\n\n filter = {\n field: 'ca_pessoa.id_pessoa_resp',\n value: idCliente.val(),\n operation: '='\n };\n objWhere.addFilter(filter);\n\n filter = {\n field: 'ca_pessoa.papel_contato',\n value: 1,\n operation: '='\n };\n objWhere.addFilter(filter);\n \n filter = {\n field: 'cargo.sigla',\n value: 'VEND',\n operation: '='\n };\n objWhere.addFilter(filter);\n\n return objWhere.toJson();\n }"; $_element = parent::getIdContCliVend(); $_element->setOnFilter($cmdOnFilter); return $_element; }
/** * Renderiza o objeto para uma string html */ public function render(&$profileName = '') { $name = ''; $itens = ''; foreach ($this->_options as $value => $config) { $class = ''; if ($value == $this->_value) { $name = $config['nome']; $class = 'focus'; } $itens .= '<li onclick="setProfile(this.value,\'' . $this->_object . '\');" value = "' . $value . '" class="link ' . $class . '">' . $config['nome'] . '</li>'; } if (ZendT_Acl::getInstance()->isAllowed('object-view', 'profile')) { $urlAdmin = ZendT_Url::getBaseUrl() . '/profile/object-view/list-config/objeto/' . $this->_object . '/tipo/' . $this->_type . '/id/' . $this->_value; $itens .= '<li role = "separator" class = "divider"></li>'; $itens .= '<li>'; $itens .= ' <a href="' . $urlAdmin . '" target="_new" class="ui-helper-clearfix">'; $itens .= ' ' . _i18n('Administrar'); $itens .= ' </a>'; $itens .= '</li>'; } if ($name) { $profileName = $name; } $xhtml = '<div style="height: 30px; float:left;" class="default ui-button ui-no-radius-bottom " id="title-profile-' . $this->_name . '">'; $xhtml .= ' <span class="ui-icon ui-icon-transfer-e-w" />'; $xhtml .= ' <ul role="title-profile-' . $this->_name . '" align="left" class="dropdown-menu position ui-helper-clearfix ui-no-radius-tr">'; $xhtml .= $itens; $xhtml .= ' </ul>'; $xhtml .= '</div>'; return $xhtml; }
/** * Affichage d'un message d'information */ public function processGetInformation() { $tpl = new CopixTpl(); $tpl->assign('TITLE_PAGE', _request('TITLE_PAGE', _i18n('messages.titlePage.information'))); $tpl->assignZone('MAIN', 'PassThrough', array('message' => _request('message'), 'back' => _request('continue'), 'template' => 'messages.information.tpl')); return new CopixActionReturn(CopixActionReturn::DISPLAY, $tpl); }
/** * 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; }
/** * Traitement par défaut */ public function processDefault() { // On charge la classe exportée Copix::RequireOnce($this->_exportClassFilename); // Définition du serveur Soap if (isset($this->_wsname)) { $server = new SoapServer(_url('wsserver|default|wsdl', array('wsname' => $this->_wsname))); } else { $server = new SoapServer(_url('wsserver|default|wsdl')); } // Assignation de la classe exportée au serveur $server->setclass($this->_exportClass); // Traitement des appels if ($_SERVER['REQUEST_METHOD'] == 'POST') { $server->handle(); return _arNone(); } else { $res = '<strong>' . _i18n('wsserver.handle.title') . '</strong>'; $res .= '<ul>'; foreach ($server->getFunctions() as $func) { $res .= '<li>' . $func . '</li>'; } $res .= '</ul>'; $res; } $tpl = new CopixTpl(); $tpl->assign('MAIN', $res); return new CopixActionReturn(CopixActionReturn::DISPLAY, $tpl); }
/** * Validation de la valeur * * @param mixed $pValue la valeur qui ne doit pas être nulle * @return boolean / array */ protected function _validate($pValue) { $pValue = is_string($pValue) && $this->getParam('trim', true) ? trim($pValue) : $pValue; if (empty($pValue)) { return _i18n('copix:copixvalidator.notempty'); } return true; }
/** * récupèration d'un profil de connection à une base de données. * @access private * @param string $named nom du profil de connection * @return CopixLdapProfil profil de connection */ private function _getProfil($named) { $pluginLdap = CopixPluginRegistry::get('CopixLdap'); if (isset($pluginLdap->config->profils[$named])) { return $pluginLdap->config->profils[$named]; } throw new CopixException(_i18n('copix:ldap.error.unknowProfil', $named)); }
public function process($pParams, $pContent = null) { $toReturn = ' ' . $pContent . '<br /><br />'; $toReturn .= ' <a href="' . CopixUrl::get($pParams['yes']) . '">' . _i18n('copix:common.buttons.yes') . '</a>'; $toReturn .= ' <a href="' . CopixUrl::get($pParams['no']) . '">' . _i18n('copix:common.buttons.no') . '</a>'; _tag('mootools'); CopixHTMLHeader::addJsCode("\n window.addEvent('domready', function () {\n var elem = new Element('div');\n elem.setStyles({'z-index':99999,'background-color':'white','border':'1px solid black','width':'200px','height':'100px','top': window.getScrollTop().toInt()+window.getHeight ().toInt()/2-100+'px','left':window.getScrollLeft().toInt()+window.getWidth ().toInt()/2-100+'px','position':'absolute','text-align':'center'});\n elem.setHTML ('{$toReturn}');\n elem.injectInside(document.body);\n\n });\n\n "); return null; }
/** * Génération du code HTML * @return string */ public function process($pParams) { //Test si le parametre correspondant au type existe if (isset($pParams['type'])) { $type = $pParams['type']; } else { //Sinon on génère une exception précisant que le type est manquant throw new CopixTemplateTagException('CopixImage: missing type parameter'); } //Si une propriété correspond au type saisi if (CopixI18N::exists('copix:common.buttons.' . $type)) { //On récupère le libellé de ce type $alt = _i18n('copix:common.buttons.' . $type); } else { //Sinon on génère une erreur throw new CopixException('You must enter an existing type'); } //identifiant sur le href $idimg = ''; $idhref = ''; if (isset($pParams['id'])) { $idimg = 'id="' . $pParams['id'] . '_img"'; $idhref = 'id="' . $pParams['id'] . '_href"'; } //Initialisation du type if (isset($pParams['title'])) { $title = $pParams['title']; } else { $title = $alt; } if (isset($pParams['class'])) { $class = 'class="' . $pParams['class'] . '"'; } else { $class = ''; } //Création du chemin ou se trouve l'image $fileName = str_replace(CopixUrl::getRequestedBaseUrl(), './', _resource("img/tools/" . $type . ".png")); //Test si le fichier existe if (file_exists($fileName)) { $src = _resource("img/tools/" . $type . ".png"); } else { throw new CopixException('No icon does not correspond to your application'); } if (isset($pParams['text'])) { $text = $pParams['text']; } else { $text = ''; } //si une url a été renseignée if (isset($pParams['href'])) { $href = $pParams['href']; return '<a href="' . $href . '" ' . $idhref . ' title="' . $title . '" ' . $class . '><img src="' . $src . '" ' . $idimg . ' alt="' . $alt . '"/>' . $text . '</a>'; } else { return '<img src="' . $src . '" ' . $idimg . ' alt="' . $alt . '" title="' . $title . '" ' . $class . ' />' . $text; } }
public function _createContent(&$toReturn) { $ppo = new CopixPPO(); $toReturn = ""; $ppo->legals = _i18n('public|public.nav.copyright'); // $ppo->legals .= " | <a href=".CopixUrl::get ('aide||')." title="._i18n('public|public.aide')."><b>"._i18n('public|public.aide')."</b></a>"; $ppo->legals .= " - <a href=\"" . CopixUrl::get('public||aPropos') . "\" title=\"" . _i18n('public|public.apropos') . "\">" . _i18n('public|public.apropos') . "</a>"; $toReturn = $this->_usePPO($ppo, 'legals.tpl'); return true; }
/** * Fonction qui est appellée pour afficher l'aide */ public function processDefault() { if (_request('id_sh', null) === null) { return CopixActionGroup::process('generictools|Messages::getError', array('message' => _i18n('simplehelp.error.missingParameters'), 'back' => _url('simplehelp|admin|listAide'))); } $aide = _ioDAO('simplehelp')->get(_request('id_sh', null)); $ppo = new CopixPPO(array('TITLE_PAGE' => $aide->title_sh)); $ppo->MAIN = CopixZone::process('ShowAide', array('id_sh' => CopixRequest::get('id_sh', null))); return _arDirectPPO($ppo, 'popup.tpl'); }
public function __construct($pParams = array(), $pMessage = null) { if ($pParams == null) { throw new CopixException(_i18n('copix:copixvalidator.validator.nopreg')); } if (!is_array($pParams) || !array_key_exists('pattern', $pParams)) { $pParams = array('pattern' => $pParams); } parent::__construct($pParams, $pMessage); }
public function __construct($pParams = array(), $pMessage = null) { if ($pParams == null) { throw new CopixException(_i18n('copix:copixvalidator.validator.nocallback')); } if (!is_array($pParams)) { $pParams = array('callback' => $pParams); } parent::__construct($pParams, $pMessage); }
protected function _validate($pValue) { $min = $this->requireParam('min'); $max = $this->requireParam('max'); $this->validateParams(); if ($pValue > $max || $pValue < $min) { return _i18n('copix:copixvalidator.beetween', array($pValue, $min, $max)); } return true; }
/** * Sauvegarde le profil par défaut et le remplace par TEST_PROFILE_NAME. * */ public function setUp() { parent::setUp(); $config = CopixConfig::instance(); $profiles = $config->copixdb_getProfiles(); if (!in_array(self::TEST_PROFILE_NAME, $profiles)) { throw new PHPUnit_Framework_SkippedTestError(_i18n("copix:copix.error.test.missingDBTestProfile", self::TEST_PROFILE_NAME)); } $this->_savedProfile = $config->copixdb_getDefaultProfileName(); $config->copixdb_defineDefaultProfileName(self::TEST_PROFILE_NAME); }
public function _createContent(&$toReturn) { $moduleName = CopixZone::getParam('moduleName'); if (($message = CopixModule::updateModule($moduleName)) === true) { $toReturn = _i18n('install.module.update') . ' ' . $moduleName . ' <img src="' . _resource('img/tools/valid.png') . '" />'; } else { $toReturn = _i18n('install.module.update') . ' ' . $moduleName . ' ' . _tag('popupinformation', array('img' => _resource('img/tools/delete.png')), $message); $toReturn .= '<div class="errorMessage">' . $message . '</div>'; } return true; }
/** * Création d'un handler * * @param string $pHandlerId Identifiant du handler à créer * @return ICopixCredentialsHandler * @throws CopixUserException */ public static function create($pHandlerId) { if (!isset(self::$_handlers[$pHandlerId])) { try { self::$_handlers[$pHandlerId] = _ioClass($pHandlerId); } catch (Exception $e) { throw new CopixUserException(_i18n('copix:copixuser.error.undefinedCredentialHandler', $pHandlerId)); } } return self::$_handlers[$pHandlerId]; }
/** * Affichage du PHPInfo dans la charte courante. */ public function processDefault() { $ppo = new CopixPPO(); $ppo->TITLE_PAGE = _i18n('webserver.titlepage'); ob_start(); phpinfo(); $info = ob_get_contents(); ob_end_clean(); $ppo->phpinfo = preg_replace('%^.*<body>(.*)</body>.*$%ms', '$1', $info); return _arPpo($ppo, 'webserver.tpl'); }
/** * Affichage de la liste des plugins disponibles */ public function processDefault() { $ppo = new CopixPPO(); $arPlugins = array(); $ppo->TITLE_PAGE = _i18n('install.plugins.title'); foreach (CopixPluginRegistry::getAvailable() as $pluginName) { $arPlugins[] = array('name' => $pluginName, 'enabled' => CopixPluginRegistry::isRegistered($pluginName)); } $ppo->arPlugins = $arPlugins; return _arPpo($ppo, 'plugins.list.tpl'); }
/** * Page de choix de thème */ public function processDefault() { $ppo = new CopixPPO(); $ppo->TITLE_PAGE = _i18n('admin|themes.titlePage.selectTheme'); $arThemes = CopixPluginRegistry::getConfig('themechooser|themechooser', true)->getThemeList(); $ppo->arThemes = array(); foreach ($arThemes as $theme) { $ppo->arThemes[] = CopixTpl::getThemeInformations($theme); } $ppo->selectedTheme = CopixSession::get('themechooser|theme'); return _arPpo($ppo, 'theme.list.tpl'); }
/** * Page d'accueil du framework */ public function processWelcome() { $ppo = new CopixPPO(); $ppo->TITLE_PAGE = _i18n('default.welcome2Copix3'); try { CopixDB::getConnection(); $ppo->dbOK = true; } catch (Exception $e) { $ppo->dbOK = false; } return _arPPO($ppo, 'welcome.php'); }
public function _createContent(&$toReturn) { $ppo = new CopixPPO(); $user = _currentUser(); if ($user->isConnected()) { $ppo->breadcrumb = _i18n('kernel|kernel.breadcrumb.fake'); } else { $ppo->breadcrumb = _i18n('kernel|kernel.breadcrumb.home'); } $toReturn = $this->_usePPO($ppo, 'breadcrumb.tpl'); return true; }
public function testLangAndCountries() { CopixI18N::setLang('fr'); CopixI18N::setCountry('FR'); $this->assertEquals(_i18n('i18n.default'), 'default'); $this->assertEquals(_i18n('i18n.key'), 'fr_FR'); $this->assertEquals(_i18n('i18n.lang'), 'fr'); $this->assertEquals(_i18n('i18n.lang', null, 'en_NOTEXISTS'), 'en'); $this->assertEquals(_i18n('i18n.lang', null, 'en_US'), 'en'); $this->assertEquals(_i18n('i18n.key', null, 'en_US'), 'en_US'); $this->assertEquals(_i18n('i18n.key', null, 'en_EN'), 'en_EN'); }
/** * Affiche la liste des thèmes disponibles */ public function processDefault() { $ppo = new CopixPPO(); $ppo->TITLE_PAGE = _i18n('themes.titlePage.selectTheme'); $arThemes = CopixTpl::getThemesList(); $arThemesInfos = array(); $ppo->arThemes = array(); foreach ($arThemes as $theme) { $ppo->arThemes[] = CopixTpl::getThemeInformations($theme); } $ppo->selectedTheme = CopixConfig::get('defaultThemeId'); return _arPPO($ppo, 'theme.list.tpl'); }