/** * Init * * @return void * @access public */ function init() { // define the custom attributes $this->defineAttribute('label', false, __T('GLZ_PRINT_PDF'), COMPONENT_TYPE_STRING); // call the superclass for validate the attributes parent::init(); }
public function getAvailableTemplates() { $templatePath = __Paths::get('APPLICATION_TO_ADMIN_TEMPLATE'); $templates = array(); if ($dh = @opendir($templatePath)) { // scan the template repository while ($dirName = readdir($dh)) { // check if the item is a folder if ($dirName != "." && $dirName != ".." && is_dir($templatePath . '/' . $dirName)) { // is a folder // check if ther eis the rpeview image // withou the preview the template isn't added if (file_exists($templatePath . '/' . $dirName . '/preview.jpg') && !file_exists($templatePath . '/' . $dirName . '/disabled')) { // check and include the locale file if (file_exists($templatePath . '/' . $dirName . '/locale/' . $this->application->getLanguage() . '.php')) { include $templatePath . '/' . $dirName . '/locale/' . $this->application->getLanguage() . '.php'; $templateName = __T($dirName); } else { $templateName = $dirName; } $templates[] = org_glizy_ObjectFactory::createObject('org.glizycms.template.models.TemplateVO', $templateName, $dirName, $templatePath . '/' . $dirName . '/preview.jpg'); } } } closedir($dh); } else { // TODO // show error } return $templates; }
public function searchDocumentsByTerm($term, $id, $protocol = '', $filterType = '') { $result = array(); if ($protocol && $protocol != $this->protocol) { return $result; } $application = __ObjectValues::get('org.glizy', 'application'); $entityTypeService = $application->retrieveProxy('movio.modules.ontologybuilder.service.EntityTypeService'); if ($term) { $it = org_glizy_objectFactory::createModelIterator('movio.modules.ontologybuilder.models.EntityDocument', 'All'); if ($term != '') { $it->where('title', '%' . $term . '%', 'ILIKE'); } $it->orderBy('title'); foreach ($it as $ar) { $entityTypeId = $entityTypeService->getEntityTypeId($ar->document_type); $result[] = array('id' => $this->protocol . $ar->document_id, 'text' => $ar->title, 'path' => __T('Content') . '/' . $entityTypeService->getEntityTypeName($entityTypeId)); } } elseif ($id) { if (strpos($id, $this->protocol) !== 0) { return $result; } $ar = org_glizy_objectFactory::createModel('movio.modules.ontologybuilder.models.EntityDocument'); $ar->load($this->getIdFromLink($id)); $entityTypeId = $entityTypeService->getEntityTypeId($ar->document_type); $result[] = array('id' => $this->protocol . $ar->document_id, 'text' => $ar->title, 'path' => __T('Content') . '/' . $entityTypeService->getEntityTypeName($entityTypeId)); } return $result; }
protected function renderDeleteButton($key, $row) { $output = ''; if ($this->canView && $this->canDelete) { $output .= __Link::makeLinkWithIcon('actionsMVC', 'icon-trash btn-icon', array('title' => __T('GLZ_RECORD_DELETE'), 'action' => 'deleteDictionary'), __T('GLZ_RECORD_MSG_DELETE'), array('dictionaryId' => $key)); } return $output; }
protected function renderVisibilityButton($key, $row) { $output = ''; if ($this->canView && $this->canEdit) { $output .= __Link::makeLinkWithIcon('actionsMVCToggleVisibility', __Config::get($row->isVisible() ? 'glizy.datagrid.action.showCssClass' : 'glizy.datagrid.action.hideCssClass'), array('title' => $row->isVisible() ? __T('Hide') : __T('Show'), 'id' => $key, 'model' => $row->getClassName(false), 'action' => 'togglevisibility')); } return $output; }
function render() { $minHeight = count($this->buttonListBase) * 29 + 2; $output .= ' <div class="control-group"> <label class="control-label " for="sharingButton">' . __T('Enable sharing buttons') . '</label> <div class="controls"> <input type="checkbox" data-type="checkbox" value ="1"' . $this->enableCheck . 'name="sharingButtonCheck" id="sharingButtonCheck"> </div> </div> <div id"shareButtonDrag" class="control-group" style="margin-left:20px;"> <div class ="span2"> <div style="font-weight:bold; margin-bottom:5px;"> <hX>' . __T('Available buttons') . '</hX> </div> <ul id="shareButtonListOff" class="sortable js-sharingDisabled" style="min-height:' . $minHeight . 'px;">'; foreach ($this->buttonListBase as $button) { if (!in_array($button, $this->enabledButtons)) { $output .= ' <li id="shareButton_' . $button . '" class="ui-state-default">' . $button . '</li>'; } } $output .= ' </ul> </div> <div class ="span2"> <div style="font-weight:bold; margin-bottom:5px;"> <hX>' . __T('Enabled buttons') . '</hX> </div> <ul id="shareButtonListOn" class="sortable js-sharingEnabled " style="min-height:' . $minHeight . 'px;">'; foreach ($this->buttonListBase as $button) { if (in_array($button, $this->enabledButtons)) { $output .= ' <li id="shareButton_' . $button . '" class="ui-state-default">' . $button . '</li>'; } } $output .= ' </ul> </div> <div class ="sortableNote">' . __T('Move and sort the buttons') . '</div> </div> <div class="control-group" > <label class="control-label " for="shareButtonDim">' . __T('Select dimension') . '</label> <div class="controls"> <select name="shareButtonDim" id="shareButtonDim" class="span3">'; foreach ($this->dimList as $key => $dim) { if ($key == trim($this->selectedDim)) { $output .= '<option selected="selected" value="' . $key . '">' . $dim . '</option>'; } else { $output .= '<option value="' . $key . '">' . $dim . '</option>'; } } $output .= ' </select> </div> </div>'; $this->addOutputCode($output); }
function renderCell($key, $value, $row) { $entityId = $key; $entityTypeId = str_replace('entity', '', $row->getType()); $output = __Link::makeLinkWithIcon('actionEntities', 'btn-icon icon-pencil', array('title' => __T('GLZ_RECORD_EDIT'), 'entityTypeId' => $entityTypeId, 'entityId' => $entityId, 'action' => 'edit')); $output .= __Link::makeLinkWithIcon('actionEntities', 'icon-trash btn-icon', array('title' => __T('GLZ_RECORD_DELETE'), 'entityTypeId' => $entityTypeId, 'entityId' => $entityId, 'action' => 'delete'), __T('GLZ_RECORD_MSG_DELETE')); $output .= __Link::makeLinkWithIcon('actionEntities', $row->isVisible() ? 'icon-eye-open btn-icon' : 'icon-eye-close btn-icon', array('title' => $row->isVisible() ? __T('Hide') : __T('Show'), 'entityTypeId' => $entityTypeId, 'entityId' => $entityId, 'action' => 'togglevisibility')); return $output; }
/** * Init * * @return void * @access public */ function init() { $this->defineAttribute('label', false, __T('GLZ_SEARCH_LABEL'), COMPONENT_TYPE_STRING); $this->defineAttribute('buttonLabel', false, __T('GLZ_SEARCH_BUTTON'), COMPONENT_TYPE_STRING); $this->defineAttribute('cssClass', false, '', COMPONENT_TYPE_STRING); $this->defineAttribute('searchPageId', false, '', COMPONENT_TYPE_STRING); $this->defineAttribute('title', false, __T('GLZ_SEARCH_BUTTON'), COMPONENT_TYPE_STRING); parent::init(); }
function execute() { if ($this->id > 0) { $this->logAndMessage(__T('Record cancellato')); $ar = org_glizy_ObjectFactory::createModel($this->modelName); $ar->delete($this->id); $this->changePage('link', array('pageId' => $this->pageId)); } }
public function __construct() { parent::__construct(); $this->type = 'movio.modules.touristoperators'; $this->protocol = 'movioTouristOperators:'; $this->model = 'movio.modules.touristoperators.models.Model'; $this->pageType = 'movio.modules.touristoperators.views.FrontEnd'; $this->modelName = __T('movio.modules.touristoperators.views.FrontEnd'); }
function renderCell($ar) { $localeService = $this->application->retrieveProxy('movio.modules.ontologybuilder.service.LocaleService'); $language = $this->application->getEditingLanguage(); $ar->entity_name = $localeService->getTranslation($language, $ar->entity_name); // TODO controllo acl $ar->__url__ = __Link::makeLinkWithIcon('actionsMVC', 'icon-pencil icon-white', array('action' => 'edit', 'id' => $ar->getId(), 'title' => __T('GLZ_RECORD_EDIT'))); $ar->__urlDelete__ = __Link::makeLinkWithIcon('actionsMVC', 'icon-remove icon-white', array('action' => 'delete', 'id' => $ar->getId(), 'title' => __T('GLZ_RECORD_EDIT')), __T('GLZ_RECORD_MSG_DELETE')); }
public function __construct() { parent::__construct(); $this->type = 'movio.modules.news'; $this->protocol = 'movioNews:'; $this->model = 'movio.modules.news.models.Model'; $this->pageType = 'movio.modules.news.views.FrontEnd'; $this->modelName = __T('movio.modules.news.views.FrontEnd'); }
function renderCell($key, $value, $row) { $output = ''; $output .= '<p>' . __T('GLZ_MEDIA_TITLE') . ': <strong>' . (!empty($row['media_title']) ? $row['media_title'] : '-') . '</strong><br />'; $output .= __T('GLZ_MEDIA_CATEGORY') . ': <strong>' . (!empty($row['media_category']) ? $row['media_category'] : '-') . '</strong><br />'; $output .= __T('GLZ_MEDIA_FILENAME') . ': <strong>' . $row['media_originalFileName'] . '</strong> <small>(' . $row['media_fileName'] . ')</small><br />'; $output .= __T('GLZ_MEDIA_SIZE') . ': <strong>' . number_format($row['media_size'] / 1024) . ' Kb</strong></p>'; return $output; }
public function getGraph($entityTypeId, &$visited, &$edges, $firstNode = false) { if ($visited[$entityTypeId]) { return ''; } else { $entityTypeService = $this->_application->retrieveProxy('movio.modules.ontologybuilder.service.EntityTypeService'); $entityProperties = $entityTypeService->getEntityTypeProperties($entityTypeId); $graph = ''; $color = __Config::get('movio.graph.shapeColor'); $entityTypeName = $entityTypeService->getEntityTypeName($entityTypeId); if ($this->getAttribute('generateLinks')) { $entityResolver = org_glizy_objectFactory::createObject('movio.modules.ontologybuilder.EntityResolver'); $ar = $entityResolver->getMenuVisibleEntity($entityTypeId); if ($ar) { $url = 'URL="' . $this->makeUrl($ar->id, $ar->title) . '"'; } } // se è il nodo da cui inizia la ricerca ricorsiva if ($firstNode or empty($url)) { $s = $url ? $url . ', ' : ''; $graph .= '"' . $this->escape($entityTypeName) . '" [' . $s . 'label="<span>' . $this->escape($entityTypeName . ' ' . __Link::makeLinkWithIcon('actionsMVC', 'icon-pencil icon-white', array('action' => 'edit', 'id' => $entityTypeId, 'title' => __T('GLZ_RECORD_EDIT'))) . '<a href="' . __Link::makeURL('actionsMVC', array('action' => 'delete', 'id' => $entityTypeId)) . '" onclick="if (!confirm('' . __T('GLZ_RECORD_MSG_DELETE') . '')){return false}"><i class="icon-remove icon-white"></i></a>') . ' </span>"];' . PHP_EOL; } else { if ($url) { $graph .= '"' . $this->escape($entityTypeName) . '" [' . $url . '];' . PHP_EOL; } } $visited[$entityTypeId] = true; foreach ((array) $entityProperties as $entityProperty) { if ($entityProperty['entity_properties_target_FK_entity_id']) { $toEntityTypeId = $entityProperty['entity_properties_target_FK_entity_id']; $toEntityTypeName = $entityTypeService->getEntityTypeName($toEntityTypeId); $label = __Tp('rel:' . $entityProperty['entity_properties_type']); if (!$edges[$entityTypeName][$toEntityTypeName]) { $edges[$entityTypeName][$toEntityTypeName] = true; $graph .= '"' . $this->escape($entityTypeName) . '" -> "' . $this->escape($toEntityTypeName) . '" [label="' . $this->escape($label) . '"];' . PHP_EOL; } $graph .= $this->getGraph($toEntityTypeId, $visited, $edges); } } $referenceRelations = $entityTypeService->getEntityTypeReferenceRelations($entityTypeId); foreach ((array) $referenceRelations as $referenceRelation) { if ($referenceRelation['entity_properties_target_FK_entity_id']) { $toEntityTypeId = $referenceRelation['entity_properties_FK_entity_id']; $toEntityTypeName = $entityTypeService->getEntityTypeName($toEntityTypeId); $label = __Tp('rel:' . $referenceRelation['entity_properties_type']); if (!$edges[$toEntityTypeName][$entityTypeName]) { $edges[$toEntityTypeName][$entityTypeName] = true; $graph .= '"' . $this->escape($toEntityTypeName) . '" -> "' . $this->escape($entityTypeName) . '" [label="' . $this->escape($label) . '"];' . PHP_EOL; } $graph .= $this->getGraph($toEntityTypeId, $visited, $edges); } } $visited[$entityTypeId] = true; return $graph; } }
private function loadXml() { $xml = org_glizy_ObjectFactory::createObject('org.glizy.parser.XML'); $xml->loadAndParseNS($this->source); $pageTypes = $xml->getElementsByTagName('pageType'); $this->pageTypesMap = array(); foreach ($pageTypes as $pageType) { $name = $pageType->getAttribute('name'); $this->pageTypesMap[$name] = array('name' => $name, 'label' => $pageType->hasAttribute('label') ? __T($pageType->getAttribute('label')) : $pageType->getAttribute('name'), 'class' => $pageType->getAttribute('class'), 'unique' => $pageType->hasAttribute('unique') ? $pageType->getAttribute('unique') == 'true' : false, 'acceptParent' => $pageType->hasAttribute('acceptParent') ? $pageType->getAttribute('acceptParent') : ''); } }
function renderCell($key, $value, $item, $columnName) { $pageId = $this->application->getPageId(); if ($this->user->acl($pageId, 'all') or $this->user->acl($pageId, 'edit')) { $output = org_glizy_Assets::makeLinkWithIcon('actionsMVC', 'icon-pencil btn-icon', array('title' => __T('GLZ_RECORD_EDIT'), 'id' => $key, 'action' => 'edit')); } if (!$item->language_isDefault) { $output .= org_glizy_Assets::makeLinkWithIcon('actionsMVC', 'icon-trash btn-icon', array('title' => __T('GLZ_RECORD_DELETE'), 'id' => $key, 'action' => 'delete'), __T('conferma cancellazione record')); } return $output; }
/** * Init * * @return void * @access public */ function init() { $this->defineAttribute('accessPageId', false, NULL, COMPONENT_TYPE_STRING); $this->defineAttribute('allowGroups', false, '', COMPONENT_TYPE_STRING); $this->defineAttribute('backend', false, true, COMPONENT_TYPE_BOOLEAN); $this->defineAttribute('errorLabel', false, __T('GLZ_LOGIN_ERROR'), COMPONENT_TYPE_STRING); $this->defineAttribute('userField', false, 'loginuser', COMPONENT_TYPE_STRING); $this->defineAttribute('passwordField', false, 'loginpsw', COMPONENT_TYPE_STRING); $this->defineAttribute('rememberField', false, 'loginremember', COMPONENT_TYPE_STRING); parent::init(); }
static function registerModule() { $moduleVO = org_glizy_Modules::getModuleVO(); $moduleVO->id = 'glizycms.userManager.fe'; $moduleVO->name = __T('User Manager'); $moduleVO->description = ''; $moduleVO->version = '1.0.0'; $moduleVO->classPath = 'org.glizycms.userManager.fe'; $moduleVO->author = 'META srl'; $moduleVO->authorUrl = 'http://www.gruppometa.it'; org_glizy_Modules::addModule($moduleVO); }
/** * Init * * @return void * @access public */ function init() { // define the custom attributes $this->defineAttribute('cssClass', false, '', COMPONENT_TYPE_STRING); $this->defineAttribute('directUrl', false, false, COMPONENT_TYPE_BOOLEAN); $this->defineAttribute('rel', false, '', COMPONENT_TYPE_STRING); $this->defineAttribute('label', false, NULL, COMPONENT_TYPE_STRING); $this->defineAttribute('linkTitle', false, __T('GLZ_DOWNLOAD_FILE_LINK'), COMPONENT_TYPE_STRING); $this->defineAttribute('adm:required', false, false, COMPONENT_TYPE_BOOLEAN); $this->defineAttribute('adm:mediaType', false, 'ALL', COMPONENT_TYPE_STRING); // call the superclass for validate the attributes parent::init(); }
protected function redirect($isNewRecord) { $this->logAndMessage(__T('Informazioni salvate con successo')); if (!$this->refreshPage) { if (!$isNewRecord) { $this->goHere(); } else { $this->changePage('linkChangeAction', array('pageId' => $this->pageId, 'action' => 'add'), array('id' => $this->id)); } } else { $this->changePage('link', array('pageId' => $this->pageId)); } }
public function execute($id, $moduleId) { // TODO tradurre le label if (!$moduleId) { $this->setComponentsAttribute('moduleId', 'value', $id); $moduleVO = $this->getModuleVO($id); $text = '<p>Duplicazione modulo <b>' . __T($moduleVO->name) . '</b> id: ' . $moduleVO->id . '<p>'; $this->setComponentsAttribute('text', 'text', $text); } else { $moduleVO = $this->getModuleVO($moduleId); $duplicateClass = org_glizy_ObjectFactory::createObject($moduleVO->classPath . '.Duplicate', $moduleVO); org_glizy_Modules::deleteCache(); $this->changeAction('index'); } }
static function registerModule() { glz_loadLocale('movio.modules.thesaurus'); $moduleVO = org_glizy_Modules::getModuleVO(); $moduleVO->id = 'movio_thesaurus'; $moduleVO->name = __T('movio_thesaurus'); $moduleVO->description = ''; $moduleVO->version = '1.0.0'; $moduleVO->classPath = 'movio.modules.thesaurus'; $moduleVO->author = 'META srl'; $moduleVO->authorUrl = 'http://www.gruppometa.it'; $moduleVO->pluginUrl = 'http://movio.beniculturali.it/'; $moduleVO->siteMapAdmin = '<glz:Page pageType="movio.modules.thesaurus.views.Admin" id="movio_thesaurus" value="{i18n:' . $moduleVO->name . '}" icon="icon-circle-blank" adm:acl="*" />'; org_glizy_Modules::addModule($moduleVO); }
static function registerModule() { $moduleVO = org_glizy_Modules::getModuleVO(); $moduleVO->id = 'movio_touristoperators'; $moduleVO->name = __T('Tourist Operators'); $moduleVO->description = ''; $moduleVO->version = '1.0.0'; $moduleVO->classPath = 'movio.modules.touristoperators'; $moduleVO->pageType = 'movio.modules.touristoperators.views.FrontEnd'; $moduleVO->author = 'META srl'; $moduleVO->authorUrl = 'http://www.gruppometa.it'; $moduleVO->pluginUrl = 'http://movio.beniculturali.it'; $moduleVO->siteMapAdmin = '<glz:Page pageType="movio.modules.touristoperators.views.Admin" id="movio_touristoperators" value="{i18n:Tourist Operators}" icon="icon-circle-blank" />'; $moduleVO->showInOntologyBuilder = true; org_glizy_Modules::addModule($moduleVO); }
public function execute() { if (method_exists($this->view, 'setData')) { $siteProp = unserialize(org_glizy_Registry::get(__Config::get('REGISTRY_SITE_PROP') . $this->application->getLanguage(), '')); $lastUpdate = org_glizy_Registry::get('movio/modules/publishApp/lastUpdate'); $data = new StdClass(); $data->title = $siteProp['title']; $data->subtitle = $siteProp['subtitle']; if ($lastUpdate) { $data->lastUpdate = '<p>' . __T('Last exportation date') . ': ' . date(__T('GLZ_DATETIME_FORMAT') . '</p>', $lastUpdate); } $data->isExhibitionActive = 1; $it = org_glizy_ObjectFactory::createModelIterator('org.glizycms.core.models.Language')->load('getLanguageDictionary'); $this->setComponentsAttribute('languages', 'rows', $it->count()); $this->view->setData($data); } }
public function execute($data) { // TODO controllo acl // TODO per motifi di sicurezza forse è meglio non passare il nome del model nella request // ma avere un controller specifico che estende quello base al quale viene passato il nome del model, come succede per Scaffold $this->directOutput = true; $data = json_decode($data); $proxy = org_glizy_objectFactory::createObject('org.glizycms.languages.models.proxy.LanguagesProxy'); if ($proxy->findLanguageByCountry($data->language_FK_country_id)) { return array('errors' => array(__T('LANGUAGE_ALREADY_PRESENT'))); } $result = $proxy->save($data); if ($result['__id']) { return array('set' => $result); } else { return array('errors' => $result); } }
function process() { $shareButtons = movio_modules_sharingButtons_views_SharingButton::getSharingButtonList(); if (!$shareButtons['enable'] || empty($shareButtons['buttonList'])) { $this->_content = ''; } else { $dim = $shareButtons['dim']; $buttonList = explode(',', $shareButtons['buttonList']); $shareMsg = __T('Share on') . " "; $shareMailMsg = __T('Send link') . "!"; $buttonArray = array("Twitter" => array("id" => "twitter", "link" => "https://twitter.com/share"), "Facebook" => array("id" => "facebook", "link" => "https://facebook.com/sharer/sharer.php?u=#url#"), "Google-plus" => array("id" => "google-plus", "link" => "https://plus.google.com/share?url=#url#"), "Linkedin" => array("id" => "linkedin", "link" => "http://www.linkedin.com/shareArticle?mini=true&url=#url#&title=#title#"), "Pinterest" => array("id" => "pinterest", "link" => "http://www.pinterest.com/pin/create/button/?url=#url#&media=#media#"), "E-mail" => array("id" => "mail", "link" => "mailto:?body=" . __T('Visit this page') . ": #url#&subject=#title#"), "Facebook-like" => array("id" => "fbLike", "link" => "http://www.facebook.com/plugins/like.php?href=#url#&width&layout=box_count&action=like&show_faces=false&share=false"), "Google+1" => array("id" => "google+1", "link" => " https://apis.google.com/_/+1/fastbutton?usegapi=1&size=large&hl=en&url=#url#")); $buttonHtml = array(); foreach ($buttonList as $i => $button) { $button = ucfirst(strtolower(trim($button))); $dimension = is_array($dim) ? $dim[$i] : $dim; if (!$dimension) { $dimension = $dim[0]; } $span = ""; $id = "btn_" . $buttonArray[$button]['id']; $link = $buttonArray[$button]['link']; $href = $this->setUrl($link); if ($button == "E-mail") { $a_class = "btn btn-adn btn-social-icon btn-" . $dimension; $i_class = "fa fa-envelope-o"; $title = $shareMailMsg; $target = "_blank"; } else { if ($button == "Facebook-like") { $i_class = "fb-like btn btn-facebook btn-" . $dimension; $a_class = ""; $title = ""; } else { $i_class = "fa fa-" . $buttonArray[$button]['id']; $a_class = "btn btn-" . $buttonArray[$button]['id'] . " btn-social-icon btn-" . $dimension; $title = $shareMsg . $button . "!"; } } $buttonHtml[] = array("id" => $id, "name" => $buttonArray[$button]['id'], "a_class" => $a_class, "i_class" => $i_class, "href" => $href, "title" => $title); } $this->_content = $buttonHtml; } }
private function addColorPicker(&$data, $idParent) { $result = array('output' => array(), 'presets' => array(), 'id' => array()); $presets = ''; foreach ($data as $k => $v) { $label = __T($k); $id = $v->id[0]; $result['id'][] = $id; $result['presets'][] = $v->preset[0]; $result['output'][] = <<<EOD <div class="control-group"> <label for="{$idParent}{$id}" class="control-label ">{$label}</label> <div class="controls"> <input id="{$idParent}{$id}" name="{$id}" title="{$label}" class="span11 " type="text" value="" data-type="colorPicker"/> </div> </div> EOD; } return $result; }
function loadTree($forceReload = false) { if ($forceReload) { $this->init(); } $menu = $this->getEmptyMenu(); $menu['id'] = '__root__'; $this->_siteMapArray[$menu['id']] = $menu; $files = array(); $dir = org_glizy_Paths::getRealPath('APPLICATION_PAGE_TYPE'); if ($dirHandle = @opendir($dir)) { while ($fileName = readdir($dirHandle)) { if ($fileName != '.' && $fileName != '..' && !is_dir($dir . '/' . $fileName) && strstr($fileName, '.xml') !== false) { $files[] = $fileName; } } closedir($dirHandle); } //ordina il risultato alfabeticamente sort($files); // legge la localizzazione dei nomi dei pageType glz_loadLocale($dir); // crea i menù foreach ($files as $f) { $fileName = substr($f, 0, strrpos($f, '.')); $title = __T($fileName); if (empty($title)) { $title = $fileName; } $menu = $this->getEmptyMenu(); $menu['id'] = strtolower($fileName); $menu['parentId'] = $this->_searchParent($menu['id']); $menu['pageType'] = $fileName; $menu['title'] = $title; $menu['type'] = substr($fileName, 0, 1) == '_' ? 'SYSTEM' : 'PAGE'; $this->_siteMapArray[$menu['id']] = $menu; } $this->_makeChilds(); }
public function executeLater($email) { if ($this->submit && $this->controller->validate()) { $ar = org_glizy_ObjectFactory::createModel('org.glizy.models.User'); if (!$ar->find(array('user_email' => $email))) { // utente non trovato $this->view->validateAddError(__T('MW_LOSTPASSWORD_ERROR')); return false; } // utente trovato // genera una nuova password e la invia per email glz_import('org.glizy.helpers.Mail'); // invia la notifica all'utente $subject = org_glizy_locale_Locale::get('MW_LOSTPASSWORD_EMAIL_SUBJECT'); $body = org_glizy_locale_Locale::get('MW_LOSTPASSWORD_EMAIL_BODY'); $body = str_replace('##USER##', $email, $body); $body = str_replace('##HOST##', org_glizy_helpers_Link::makeSimpleLink(GLZ_HOST, GLZ_HOST), $body); $body = str_replace('##PASSWORD##', $ar->user_password, $body); org_glizy_helpers_Mail::sendEmail(array('email' => org_glizy_Request::get('email', ''), 'name' => $ar->user_firstName . ' ' . $ar->user_lastName), array('email' => org_glizy_Config::get('SMTP_EMAIL'), 'name' => org_glizy_Config::get('SMTP_SENDER')), $subject, $body); $this->changeAction('lostPasswordConfirm'); } }
public function save($data) { $isNew = !(intval($data->__id) && $data->__id > 0); $isDefault = $data->language_isDefault; $currentDefaultId = 0; $countryId = $data->language_FK_country_id; if ($countryId) { $ar = org_glizy_ObjectFactory::createModel('org.glizycms.core.models.Country'); if ($ar->load($countryId)) { $data->language_code = $ar->country_639_1; } } else { $data->language_code = ''; } if (!$data->language_order) { $data->language_order = 1; } // if isDefault read the current defautl language $ar = org_glizy_ObjectFactory::createModel('org.glizycms.core.models.Language'); if ($ar->find(array('language_isDefault' => 1))) { $currentDefaultId = $ar->language_id; } if (!$isDefault && $currentDefaultId == $data->__id) { return array(__T('You can\'t remove the default proerty, to do it set the default to other record')); } else { if ($isDefault && $currentDefaultId != $data->__id) { $ar->language_isDefault = 0; $ar->save(); } } if ($isNew && !$currentDefaultId) { return array(__T('Can\'t create a new language if there aren\'t a default one')); } $result = parent::save($data); if ($isNew && $currentDefaultId) { $this->duplicateMenu($currentDefaultId, $result['__id']); $this->duplicateMedia($currentDefaultId, $result['__id']); } }