本文整理汇总了PHP中_root::getParam方法的典型用法代码示例。如果您正苦于以下问题:PHP _root::getParam方法的具体用法?PHP _root::getParam怎么用?PHP _root::getParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类_root
的用法示例。
在下文中一共展示了_root::getParam方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _index
public function _index()
{
$msg = '';
$detail = '';
if ($this->isPost()) {
$sModule = _root::getParam('module');
$sActions = _root::getParam('actions');
$tAction = explode("\n", $sActions);
if ($this->projectMkdir('module/' . $sModule) == true) {
$detail = trR('creationRepertoire', array('#REPERTOIRE#' => 'module/' . $sModule));
} else {
$detail = trR('repertoireDejaExistant', array('#REPERTOIRE#' => 'module/' . $sModule));
}
if ($this->projectMkdir('module/' . $sModule . '/view') == true) {
$detail .= '<br />' . trR('creationRepertoire', array('#REPERTOIRE#' => 'module/' . $sModule . '/view'));
} else {
$detail .= '<br />' . trR('repertoireDejaExistant', array('#REPERTOIRE#' => 'module/' . $sModule . '/view'));
}
$this->genModuleMain($sModule, $tAction);
$msg = trR('moduleGenereAvecSucces', array('#MODULE#' => $sModule, '#listACTION#' => implode(',', $tAction)));
$detail .= '<br />' . trR('CreationDuFichierVAR', array('#FICHIER#' => 'module/' . $sModule . '/main.php'));
foreach ($tAction as $sAction) {
$detail .= '<br />' . trR('CreationDuFichierVAR', array('#FICHIER#' => 'module/' . $sModule . '/view/' . $sAction . '.php'));
}
$detail .= '<br />' . tr('accessibleVia');
foreach ($tAction as $sAction) {
$detail .= '<br />- <a href="data/genere/' . _root::getParam('id') . '/public/index.php?:nav=' . $sModule . '::' . $sAction . '">index.php?:nav=' . $sModule . '::' . $sAction . '</a>';
}
}
$oTpl = $this->getView('index');
$oTpl->msg = $msg;
$oTpl->detail = $detail;
return $oTpl;
}
示例2: generate
private function generate($sTable, $tField)
{
$tNewField = array('id');
foreach ($tField as $sField) {
if (trim($sField) == '') {
continue;
}
$tNewField[] = trim($sField);
}
$sStructure = implode(';', $tNewField);
$oDir = new _dir(_root::getConfigVar('path.generation') . _root::getParam('id') . '/data/json');
if (!$oDir->exist()) {
$oDir->save();
}
$oDir = new _dir(_root::getConfigVar('path.generation') . _root::getParam('id') . '/data/json/base');
if (!$oDir->exist()) {
$oDir->save();
}
$oDir = new _dir(_root::getConfigVar('path.generation') . _root::getParam('id') . '/data/json/base/' . $sTable . '');
if (!$oDir->exist()) {
$oDir->save();
}
$sPath = _root::getConfigVar('path.generation') . _root::getParam('id') . '/data/json/base/' . $sTable . '/';
$oFile = new _file($sPath . 'structure.csv');
$oFile->setContent($sStructure);
$oFile->save();
$sPath = _root::getConfigVar('path.generation') . _root::getParam('id') . '/data/json/base/' . $sTable . '/';
$oFile = new _file($sPath . 'max.txt');
$oFile->setContent(1);
$oFile->save();
}
示例3: _showXml
public function _showXml()
{
$oAuteur = model_auteur::getInstance()->findById(_root::getParam('id'));
$oXml = new plugin_xmlObject($oAuteur);
$oXml->setListColumn(array('id', 'nom', 'prenom'));
$oXml->show();
}
示例4: processInscription
private function processInscription()
{
if (!_root::getRequest()->isPost()) {
return null;
}
$tAccount = model_example::getInstance()->getListAccount();
$sLogin = _root::getParam('login');
$sPassword = _root::getParam('password');
if ($sPassword != _root::getParam('password2')) {
return 'Les deux mots de passe doivent etre identiques';
} elseif (_root::getParam('login') == '') {
return 'Vous devez remplir le nom d utilisateur';
} elseif ($sPassword == '') {
return 'Vous devez remplir le mot de passe';
} elseif (strlen($sPassword) > $this->maxPasswordLength) {
return 'Mot de passe trop long';
} elseif (isset($tAccount[$sLogin])) {
return 'Utilisateur déjà existant';
}
$oExample = new row_example();
$oExample->loginField = $sLogin;
$oExample->passField = model_example::getInstance()->hashPassword($sPassword);
$oExample->save();
return 'Votre compte a bien été créé';
}
示例5: save
private function save()
{
if (!_root::getRequest()->isPost()) {
return false;
}
$oPluginXsrf = new plugin_xsrf();
if (!$oPluginXsrf->checkToken(_root::getParam('token'))) {
//on verifie que le token est valide
return array('token' => $oPluginXsrf->getMessage());
}
$oArticleModel = new model_article();
$iId = _root::getParam('id', null);
if ($iId == null) {
$oArticle = new row_article();
} else {
$oArticle = $oArticleModel->findById(_root::getParam('id', null));
}
foreach ($oArticleModel->getListColumn() as $sColumn) {
if (_root::getParam($sColumn, null) == null) {
continue;
}
if (in_array($sColumn, $oArticleModel->getIdTab())) {
continue;
}
$oArticle->{$sColumn} = _root::getParam($sColumn, null);
}
if ($oArticle->save()) {
//une fois enregistre on redirige (vers la page de liste)
_root::redirect('prive::list');
} else {
return $oArticle->getListError();
}
}
示例6: _login
public function _login()
{
$oView = new _view('auth::login');
$this->oLayout->add('main', $oView);
if (_root::getRequest()->isPost()) {
$sLogin = _root::getParam('login');
$sPass = sha1(_root::getParam('password'));
$oModelAccount = new model_account();
$tAccount = $oModelAccount->getListAccount();
if (_root::getAuth()->checkLoginPass($tAccount, $sLogin, $sPass)) {
$oAccount = _root::getAuth()->getAccount();
$tPermission = model_permission::getInstance()->findByGroup($oAccount->groupe);
//on purge les permissions en session
_root::getACL()->purge();
//boucle sur les permissions
if ($tPermission) {
foreach ($tPermission as $oPermission) {
if ($oPermission->allowdeny == 'ALLOW') {
_root::getACL()->allow($oPermission->action, $oPermission->element);
} else {
_root::getACL()->deny($oPermission->action, $oPermission->element);
}
}
}
_root::redirect('prive::list');
}
}
}
示例7: regenerateIndexXml
public function regenerateIndexXml($sConfig, $sTable, $sIndex)
{
//$sConfig='xml';
if (_root::getConfigVar('db.' . $sConfig . '.sgbd') == 'xml') {
if (!file_exists(_root::getConfigVar('db.' . $sConfig . '.database'))) {
$sBuilderDbPath = _root::getConfigVar('path.data') . 'genere/' . _root::getParam('id') . '/public/' . _root::getConfigVar('db.' . $sConfig . '.database');
if (file_exists($sBuilderDbPath)) {
_root::setConfigVar('db.' . $sConfig . '.database', $sBuilderDbPath);
} else {
throw new Exception('Base inexistante ' . _root::getConfigVar('db.' . $sConfig . '.database') . ' ni ' . $sBuilderDbPath);
}
}
} else {
if (_root::getConfigVar('db.' . $sConfig . '.sgbd') == 'csv') {
if (!file_exists(_root::getConfigVar('db.' . $sConfig . '.database'))) {
$sBuilderDbPath = _root::getConfigVar('path.data') . 'genere/' . _root::getParam('id') . '/public/' . _root::getConfigVar('db.' . $sConfig . '.database');
if (file_exists($sBuilderDbPath)) {
_root::setConfigVar('db.' . $sConfig . '.database', $sBuilderDbPath);
} else {
throw new Exception('Base inexistante ' . _root::getConfigVar('db.' . $sConfig . '.database') . ' ni ' . $sBuilderDbPath);
}
}
}
}
$oModelFactory = new model_mkfbuilderfactory();
$oModelFactory->setConfig($sConfig);
return $oModelFactory->getSgbd()->generateIndexForTable($sTable, $sIndex);
}
示例8: _show
public function _show()
{
$oExamplemodel = model_examplemodel::getInstance()->findById(_root::getParam('id'));
$oView = new _view('examplemodule::show');
$oView->oExamplemodel = $oExamplemodel;
//icishow
$this->oLayout->add('main', $oView);
}
示例9: _projetEmbedded
public function _projetEmbedded()
{
if (_root::getParam('action') == 'model') {
$tLink = array();
} else {
//if(_root::getParam('action')=='module'){
$tLink = array('Modules' => 'title', 'Créer un module' => 'module', 'Créer un module CRUD' => 'crud', 'Créer un module Lecture seule' => 'crudreadonly', 'Créer un module d\'authentification' => 'authmodule', 'Créer un module d\'authentification avec inscription' => 'authwithinscriptionmodule', 'Modules intégrable' => 'title', 'Créer un module menu ' => 'addmodulemenu', 'Créer un module intégrable' => 'moduleembedded', 'Créer un module CRUD intégrable' => 'crudembedded', 'Créer un module Lecture seule intégrable' => 'crudembeddedreadonly');
}
$oTpl = new _tpl('menu::projetEmbedded');
$oTpl->tLink = $tLink;
return $oTpl;
}
示例10: _category
public function _category()
{
$oView = new _view('default::index');
$this->oLayout->add('main', $oView);
//posts (main)
$oModuleExamplemodule = new module_posts();
$oModuleExamplemodule->setCategory(_root::getParam('id'));
//si vous souhaitez indiquer au module integrable des informations sur le module parent
$oModuleExamplemodule->setRootLink('default::categoryDetail', array('id' => _root::getParam('id')));
//recupere la vue du module
$oViewModule = $oModuleExamplemodule->_index();
//assigner la vue retournee a votre layout
$this->oLayout->add('main', $oViewModule);
}
示例11: _index
public function _index()
{
module_builder::getTools()->rootAddConf('conf/connexion.ini.php');
$tConnexion = _root::getConfigVar('db');
$tSqlite = array();
foreach ($tConnexion as $sConfig => $val) {
if (substr($val, 0, 6) == 'sqlite') {
$tSqlite[substr($sConfig, 0, -4)] = $val;
}
}
$msg = '';
$detail = '';
if ($this->isPost()) {
$sDbFilename = _root::getParam('sDbFilename');
$sTable = _root::getParam('sTable');
$tField = _root::getParam('tField');
$tType = _root::getParam('tType');
$tSize = _root::getParam('tSize');
try {
$oDb = new PDO($sDbFilename);
} catch (PDOException $exception) {
die($exception->getMessage());
}
$oDb->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sSql = 'CREATE TABLE IF NOT EXISTS ' . $sTable . '(';
$sSql .= 'id INTEGER PRIMARY KEY AUTOINCREMENT';
foreach ($tField as $i => $sField) {
$sSql .= ',';
$sSql .= $sField . ' ' . $tType[$i];
if ($tType[$i] == 'VARCHAR') {
$sSql .= '(' . $tSize[$i] . ')';
}
}
$sSql .= ')';
try {
$oDb->exec($sSql);
} catch (PDOException $exception) {
die($exception->getMessage());
}
$msg = trR('baseTableGenereAvecSucces', array('#maTable#' => $sTable, '#listField#' => implode(',', $tField)));
$detail = trR('creationFichier', array('#FICHIER#' => ' sqlite ' . $sDbFilename));
}
$oTpl = $this->getView('index');
$oTpl->msg = $msg;
$oTpl->detail = $detail;
$oTpl->tSqlite = $tSqlite;
return $oTpl;
}
示例12: _index
public function _index()
{
module_builder::getTools()->rootAddConf('conf/connexion.ini.php');
$tConnexion = _root::getConfigVar('db');
$tSqlite = array();
foreach ($tConnexion as $sConfig => $val) {
if (substr($val, 0, 6) == 'sqlite') {
$tSqlite[substr($sConfig, 0, -4)] = $val;
}
}
$msg = '';
$detail = '';
if (_root::getRequest()->isPost()) {
$sDbFilename = _root::getParam('sDbFilename');
$sTable = _root::getParam('sTable');
$tField = _root::getParam('tField');
$tType = _root::getParam('tType');
$tSize = _root::getParam('tSize');
try {
$oDb = new PDO($sDbFilename);
} catch (PDOException $exception) {
die($exception->getMessage());
}
$oDb->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sSql = 'CREATE TABLE IF NOT EXISTS ' . $sTable . '(';
$sSql .= 'id INTEGER PRIMARY KEY AUTOINCREMENT';
foreach ($tField as $i => $sField) {
$sSql .= ',';
$sSql .= $sField . ' ' . $tType[$i];
if ($tType[$i] == 'VARCHAR') {
$sSql .= '(' . $tSize[$i] . ')';
}
}
$sSql .= ')';
try {
$oDb->exec($sSql);
} catch (PDOException $exception) {
die($exception->getMessage());
}
$msg = 'Table ' . $sTable . ' (champs: ' . implode(',', $tField) . ') généré avec succès';
$detail = 'Création du fichier sqlite ' . $sDbFilename;
}
$oTpl = new _Tpl('moduleSqlite::index');
$oTpl->msg = $msg;
$oTpl->detail = $detail;
$oTpl->tSqlite = $tSqlite;
return $oTpl;
}
示例13: _project
public function _project()
{
$bBootstrap = 0;
if (file_exists('data/genere/' . _root::getParam('id') . '/layout/bootstrap.php')) {
$bBootstrap = 1;
}
if ($bBootstrap) {
$tType = array('all', 'bootstrap');
} else {
$tType = array('all', 'normal');
}
$sLang = _root::getConfigVar('language.default');
$tLinkModule = array();
foreach ($tType as $sType) {
$sPathModule = _root::getConfigVar('path.module') . '/mods/' . $sType;
$tModulesAll = scandir($sPathModule);
foreach ($tModulesAll as $sModule) {
if (file_exists($sPathModule . '/' . $sModule . '/info.ini')) {
$tIni = parse_ini_file($sPathModule . '/' . $sModule . '/info.ini');
$priority = 999;
if (isset($tIni['priority'])) {
$priority = $tIni['priority'];
}
$sPriority = sprintf('%03d', $priority);
$tLinkModule[$tIni['category']][$tIni['title.' . $sLang] . ' <sup>version ' . $tIni['version'] . '</sup>'] = $sPriority . 'mods_' . $sType . '_' . $sModule . '::index';
}
}
}
//$tModules=scandir(_root::getConfigVar('path.module')).'/mods/normal';
$tTitle = array('market', 'coucheModel', 'modules', 'modulesEmbedded', 'views', 'databasesEmbedded', 'unitTest');
$tLink = array();
foreach ($tTitle as $sTitle) {
if (isset($tLinkModule[$sTitle])) {
$tLinkModuleCat = $tLinkModule[$sTitle];
asort($tLinkModuleCat);
$tLink[tr('menu_' . $sTitle)] = 'title';
foreach ($tLinkModuleCat as $sLabel => $sLink) {
$tLink[$sLabel] = substr($sLink, 3);
}
}
}
$oTpl = $this->getView('project');
$oTpl->tLink = $tLink;
return $oTpl;
}
示例14: process
private function process()
{
if (_root::getRequest()->isPost() == false) {
return null;
}
$tError = null;
$msg = null;
$detail = null;
$sModule = _root::getParam('modulename');
$tMethod = _root::getParam('tMethod');
$tLabel = _root::getParam('tLabel');
$ok = 1;
//check formulaire
foreach ($tMethod as $i => $sMethod) {
if ($tLabel[$i] == '') {
$tError[$i] = tr('remplissezLeLibelle');
$ok = 0;
}
}
if ($ok) {
if (module_builder::getTools()->projetmkdir('module/' . $sModule) == true) {
$detail = trR('creationRepertoire', array('#REPERTOIRE#' => 'module/' . $sModule));
if (module_builder::getTools()->projetmkdir('module/' . $sModule . '/view') == true) {
$detail .= '<br />' . trR('creationRepertoire', array('#REPERTOIRE#' => 'module/' . $sModule . '/view'));
$this->genModuleMenuMain($sModule, $tMethod, $tLabel);
$msg = trR('moduleGenereAvecSucces', array('#MODULE#' => $sModule));
$detail .= '<br />' . trR('CreationDuFichierVAR', array('#FICHIER#' => 'module/' . $sModule . '/main.php'));
$detail .= '<br />' . trR('CreationDuFichierVAR', array('#FICHIER#' => 'module/' . $sModule . '/view/index.php'));
$sCode = '<?php ' . "\n";
$sCode .= '//assignez le menu a l\'emplacement menu' . "\n";
$sCode .= '$this->oLayout->addModule(\'menu\',\'' . $sModule . '::index\');' . "\n";
$detail .= '<br/><br/>' . tr('pourLutiliserAjoutez') . '<br />
' . highlight_string($sCode, 1);
} else {
$detail .= '<br />' . trR('repertoireDejaExistant', array('#REPERTOIRE#' => 'module/' . $sModule . '/view'));
}
} else {
$detail = trR('repertoireDejaExistant', array('#REPERTOIRE#' => 'module/' . $sModule . '/view'));
}
}
$this->tError = $tError;
$this->detail = $detail;
$this->msg = $msg;
}
示例15: _save
public function _save()
{
$oAuteurModel = new model_auteur();
$iId = _root::getParam('id', null);
if ($iId == null) {
$oAuteur = new row_auteur();
} else {
$oAuteur = $oAuteurModel->findById(_root::getParam('id', null));
}
foreach ($oAuteurModel->getListColumn() as $sColumn) {
if (_root::getParam($sColumn, null) === null) {
continue;
}
if (in_array($sColumn, $oAuteurModel->getIdTab())) {
continue;
}
$oAuteur->{$sColumn} = _root::getParam($sColumn, null);
}
$oAuteur->save();
_root::redirect('auteur::edit', array('id' => $oAuteur->getId()));
}