Ejemplo n.º 1
0
 public function Fire()
 {
     if ($this->input->do == 'submit') {
         if (!filter_var($this->input->email, FILTER_VALIDATE_EMAIL)) {
             EventPump::Pump()->RaiseEvent(new StandardErrorEvent(l10n::S('INVALID_EMAIL')));
             return;
         }
         if (strlen($this->input->password) <= 4) {
             EventPump::Pump()->RaiseEvent(new StandardErrorEvent(l10n::S('PASSWORD_TOO_SHORT')));
             return;
         }
         $stmt = Bugdar::$db->Prepare("SELECT COUNT(*) AS count FROM users WHERE email = ?");
         $stmt->Execute(array($this->input->email));
         if ($stmt->FetchObject()->count > 0) {
             EventPump::Pump()->RaiseEvent(new StandardErrorEvent(l10n::S('EMAIL_IN_USE')));
             return;
         }
         $alias = preg_replace('/[^a-zA-Z0-9\\-_,\\. ]/', '', $this->input->alias);
         $salt = phalanx\base\Random(10);
         $user = new User();
         $user->email = $this->input->email;
         $user->alias = preg_replace('/[^a-zA-Z0-9\\-_,\\. ]/', '', $this->input->alias);
         $user->password = sha1($this->input->password);
         $user->usergroup_id = Usergroup::ROLE_REGISTERED;
         $user->Insert();
         $this->user_id = $user->user_id;
         EventPump::Pump()->PostEvent(new StandardSuccessEvent('login', l10n::S('USER_REGISTER_SUCCESS')));
     }
 }
Ejemplo n.º 2
0
 public function Fire()
 {
     if ($this->input->do == 'submit') {
         $bug = new Bug($this->input->bug_id);
         try {
             $bug->FetchInto();
         } catch (phalanx\data\ModelException $e) {
             EventPump::Pump()->RaiseEvent(new StandardErrorEvent(l10n::S('BUG_ID_NOT_FOUND')));
             return;
         }
         $body = trim($this->input->body);
         if (empty($body)) {
             EventPump::Pump()->RaiseEvent(new StandardErrorEvent(l10n::S('COMMENT_MISSING_BODY')));
             return;
         }
         $comment = new Comment();
         $comment->bug_id = $bug_id;
         $comment->post_user_id = Bugdar::$auth->current_user();
         $comment->post_date = time();
         $comment->body = $body;
         $comment->Insert();
         $this->comment_id = $comment->comment_id;
         $search = new SearchEngine();
         $search->IndexBug($bug);
         EventPump::Pump()->PostEvent(new StandardSuccessEvent('view_bug/' . $bug_id, l10n::S('USER_REGISTER_SUCCESS')));
     }
 }
 /**
  * Constructor.
  *
  */
 public function __construct($okt, $sPostPrefix = 'p_')
 {
     $this->okt = $okt;
     # POST prefix
     $this->sPostPrefix = $sPostPrefix;
     # locales
     l10n::set(OKT_LOCALES_PATH . '/' . $this->okt->user->language . '/definitions.less.editor');
 }
Ejemplo n.º 4
0
 public function Fire()
 {
     $stmt = Bugdar::$db->Prepare("SELECT * FROM " . TABLE_PREFIX . "users WHERE user_id = :id OR alias = :id");
     $stmt->Execute(array('id' => $this->input->_id));
     if (!($this->user = $stmt->FetchObject())) {
         EventPump::Pump()->RaiseEvent(new StandardErrorEvent(l10n::S('INVALID_USER')));
     }
 }
Ejemplo n.º 5
0
 protected function prepend()
 {
     # chargement des principales locales
     l10n::set(__DIR__ . '/locales/' . $this->okt->user->language . '/main');
     # permissions
     $this->okt->addPerm('rte_tinymce_4_config', __('m_rte_tinymce_4_perm_config'), 'configuration');
     # configuration
     $this->config = $this->okt->newConfig('conf_rte_tinymce_4');
 }
Ejemplo n.º 6
0
 protected function _getTemplate()
 {
     $d = dirname($this->_file);
     $f = basename($this->_file);
     $lcPath = $d . '/locale/' . $this->_locale . '/' . $f;
     l10n::loadFile($this->_locale, $lcPath);
     $this->_lmsg = l10n::getTemplate($this->_locale, $this->_msg);
     //echo $lcPath.' ';
 }
Ejemplo n.º 7
0
 public function __construct()
 {
     $this->registry = registry::getInstance();
     $this->path = $this->registry["path"];
     $this->html = html::getInstance();
     $this->session = $this->registry["session"];
     $this->cookie = $this->registry["cookie"];
     $this->ajax = new ajax();
     $this->l10n = l10n::getInstance();
 }
Ejemplo n.º 8
0
 protected function prepend_admin()
 {
     # on détermine si on est actuellement sur ce module
     $this->onThisModule();
     # chargement des locales admin
     l10n::set(__DIR__ . '/locales/' . $this->okt->user->language . '/admin');
     # on ajoutent un item au menu admin
     if (!defined('OKT_DISABLE_MENU')) {
         $this->okt->page->configSubMenu->add(__('m_lbl_fancybox_menu_config'), 'module.php?m=lbl_fancybox&amp;action=config', ON_LBL_FANCYBOX_MODULE && $this->okt->page->action === 'config', 25, $this->okt->checkPerm('fancybox_config'), null);
     }
 }
Ejemplo n.º 9
0
 protected function prepend_admin()
 {
     # on détermine si on est actuellement sur ce module
     $this->onThisModule();
     # chargement des locales admin
     l10n::set(__DIR__ . '/locales/' . $this->okt->user->language . '/admin');
     # on ajoutent un item au menu admin
     if (!defined('OKT_DISABLE_MENU')) {
         $this->okt->page->configSubMenu->add(__('Antispam'), 'module.php?m=antispam', ON_ANTISPAM_MODULE, 25, $this->okt->checkPerm('antispam'), null);
     }
 }
Ejemplo n.º 10
0
 protected function prepend_admin()
 {
     # on détermine si on est actuellement sur ce module
     $this->onThisModule();
     # chargement des locales admin
     l10n::set(__DIR__ . '/locales/' . $this->okt->user->language . '/admin');
     # on ajoutent un item au menu admin
     if (!defined('OKT_DISABLE_MENU')) {
         $this->okt->page->configSubMenu->add(__('Images sets'), 'module.php?m=images_sets&amp;action=index', ON_IMAGES_SETS_MODULE && (!$this->okt->page->action || $this->okt->page->action === 'index'), 42, $this->okt->checkPerm('is_superadmin'), null);
     }
 }
Ejemplo n.º 11
0
function dc_load_locales()
{
    global $_lang, $core;
    $_lang = $core->auth->getInfo('user_lang');
    $_lang = preg_match('/^[a-z]{2}(-[a-z]{2})?$/', $_lang) ? $_lang : 'en';
    if (l10n::set(dirname(__FILE__) . '/../../locales/' . $_lang . '/date') === false && $_lang != 'en') {
        l10n::set(dirname(__FILE__) . '/../../locales/en/date');
    }
    l10n::set(dirname(__FILE__) . '/../../locales/' . $_lang . '/main');
    l10n::set(dirname(__FILE__) . '/../../locales/' . $_lang . '/plugins');
}
Ejemplo n.º 12
0
 protected function prepend_admin()
 {
     # on détermine si on est actuellement sur ce module
     $this->onThisModule();
     # chargement des locales admin
     l10n::set(__DIR__ . '/locales/' . $this->okt->user->language . '/admin');
     # on ajoutent un item au menu admin
     if (!defined('OKT_DISABLE_MENU')) {
         $this->okt->page->configSubMenu->add(__('Accessible Captcha'), 'module.php?m=accessible_captcha&amp;action=index', ON_ACCESSIBLE_CAPTCHA_MODULE && (!$this->okt->page->action || $this->okt->page->action === 'index'), 30, $this->okt->checkPerm('accessible_captcha_config'), null);
     }
 }
Ejemplo n.º 13
0
 public function detect()
 {
     $langs = $this->options();
     if (isset($_COOKIE['wLang']) && isset($langs[$_COOKIE['wLang']])) {
         return $_COOKIE['wLang'];
     }
     $lang = '';
     if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
         $negotiation = new ptlis\ConNeg\Negotiation();
         $lang = $negotiation->languageBest($_SERVER['HTTP_ACCEPT_LANGUAGE'], 'application/json;q=1,application/xml;q=0.7,text/html;q=0.3');
     }
     if (!$lang) {
         return $this->default;
     }
     $l10 = new l10n();
     $map = $l10->catalog($lang);
     if ($map && isset($map['localeFallback'])) {
         return $map['localeFallback'];
     }
     return $this->default;
 }
Ejemplo n.º 14
0
 protected function prepend()
 {
     # chargement des principales locales
     l10n::set(__DIR__ . '/locales/' . $this->okt->user->language . '/main');
     # enregistrement des triggers
     $this->okt->pages->triggers->registerTrigger('getPagesSelectFields', array('module_pages_example_extra_fields', 'getPagesSelectFields'));
     $this->okt->pages->triggers->registerTrigger('adminPostInit', array('module_pages_example_extra_fields', 'adminPostInit'));
     $this->okt->pages->triggers->registerTrigger('adminPopulateData', array('module_pages_example_extra_fields', 'adminPopulateData'));
     $this->okt->pages->triggers->registerTrigger('checkPostData', array('module_pages_example_extra_fields', 'checkPostData'));
     $this->okt->pages->triggers->registerTrigger('beforePageUpdate', array('module_pages_example_extra_fields', 'beforePageUpdate'));
     $this->okt->pages->triggers->registerTrigger('beforePageCreate', array('module_pages_example_extra_fields', 'beforePageCreate'));
     $this->okt->pages->triggers->registerTrigger('adminPostBuildTabs', array('module_pages_example_extra_fields', 'adminPostBuildTabs'));
 }
Ejemplo n.º 15
0
 protected static function jsToolBar()
 {
     $res = dcPage::cssLoad(dcPage::getPF('dcLegacyEditor/css/jsToolBar/jsToolBar.css')) . dcPage::jsLoad(dcPage::getPF('dcLegacyEditor/js/jsToolBar/jsToolBar.js'));
     if (isset($GLOBALS['core']->auth) && $GLOBALS['core']->auth->getOption('enable_wysiwyg')) {
         $res .= dcPage::jsLoad(dcPage::getPF('dcLegacyEditor/js/jsToolBar/jsToolBar.wysiwyg.js'));
     }
     $res .= dcPage::jsLoad(dcPage::getPF('dcLegacyEditor/js/jsToolBar/jsToolBar.dotclear.js')) . '<script type="text/javascript">' . "\n" . "//<![CDATA[\n" . "jsToolBar.prototype.dialog_url = 'popup.php'; " . "jsToolBar.prototype.iframe_css = '" . 'body{' . 'font: 12px "DejaVu Sans","Lucida Grande","Lucida Sans Unicode",Arial,sans-serif;' . 'color : #000;' . 'background: #f9f9f9;' . 'margin: 0;' . 'padding : 2px;' . 'border: none;' . (l10n::getTextDirection($GLOBALS['_lang']) == 'rtl' ? 'direction:rtl;' : '') . '}' . 'pre, code, kbd, samp {' . 'font-family:"Courier New",Courier,monospace;' . 'font-size : 1.1em;' . '}' . 'code {' . 'color : #666;' . 'font-weight : bold;' . '}' . 'body > p:first-child {' . 'margin-top: 0;' . '}' . "'; " . "jsToolBar.prototype.base_url = '" . html::escapeJS($GLOBALS['core']->blog->host) . "'; " . "jsToolBar.prototype.switcher_visual_title = '" . html::escapeJS(__('visual')) . "'; " . "jsToolBar.prototype.switcher_source_title = '" . html::escapeJS(__('source')) . "'; " . "jsToolBar.prototype.legend_msg = '" . html::escapeJS(__('You can use the following shortcuts to format your text.')) . "'; " . "jsToolBar.prototype.elements.blocks.options.none = '" . html::escapeJS(__('-- none --')) . "'; " . "jsToolBar.prototype.elements.blocks.options.nonebis = '" . html::escapeJS(__('-- block format --')) . "'; " . "jsToolBar.prototype.elements.blocks.options.p = '" . html::escapeJS(__('Paragraph')) . "'; " . "jsToolBar.prototype.elements.blocks.options.h1 = '" . html::escapeJS(__('Level 1 header')) . "'; " . "jsToolBar.prototype.elements.blocks.options.h2 = '" . html::escapeJS(__('Level 2 header')) . "'; " . "jsToolBar.prototype.elements.blocks.options.h3 = '" . html::escapeJS(__('Level 3 header')) . "'; " . "jsToolBar.prototype.elements.blocks.options.h4 = '" . html::escapeJS(__('Level 4 header')) . "'; " . "jsToolBar.prototype.elements.blocks.options.h5 = '" . html::escapeJS(__('Level 5 header')) . "'; " . "jsToolBar.prototype.elements.blocks.options.h6 = '" . html::escapeJS(__('Level 6 header')) . "'; " . "jsToolBar.prototype.elements.strong.title = '" . html::escapeJS(__('Strong emphasis')) . "'; " . "jsToolBar.prototype.elements.em.title = '" . html::escapeJS(__('Emphasis')) . "'; " . "jsToolBar.prototype.elements.ins.title = '" . html::escapeJS(__('Inserted')) . "'; " . "jsToolBar.prototype.elements.del.title = '" . html::escapeJS(__('Deleted')) . "'; " . "jsToolBar.prototype.elements.quote.title = '" . html::escapeJS(__('Inline quote')) . "'; " . "jsToolBar.prototype.elements.code.title = '" . html::escapeJS(__('Code')) . "'; " . "jsToolBar.prototype.elements.br.title = '" . html::escapeJS(__('Line break')) . "'; " . "jsToolBar.prototype.elements.blockquote.title = '" . html::escapeJS(__('Blockquote')) . "'; " . "jsToolBar.prototype.elements.pre.title = '" . html::escapeJS(__('Preformated text')) . "'; " . "jsToolBar.prototype.elements.ul.title = '" . html::escapeJS(__('Unordered list')) . "'; " . "jsToolBar.prototype.elements.ol.title = '" . html::escapeJS(__('Ordered list')) . "'; " . "jsToolBar.prototype.elements.link.title = '" . html::escapeJS(__('Link')) . "'; " . "jsToolBar.prototype.elements.link.href_prompt = '" . html::escapeJS(__('URL?')) . "'; " . "jsToolBar.prototype.elements.link.hreflang_prompt = '" . html::escapeJS(__('Language?')) . "'; " . "jsToolBar.prototype.elements.img.title = '" . html::escapeJS(__('External image')) . "'; " . "jsToolBar.prototype.elements.img.src_prompt = '" . html::escapeJS(__('URL?')) . "'; " . "jsToolBar.prototype.elements.img_select.title = '" . html::escapeJS(__('Media chooser')) . "'; " . "jsToolBar.prototype.elements.post_link.title = '" . html::escapeJS(__('Link to an entry')) . "'; " . "jsToolBar.prototype.elements.removeFormat = jsToolBar.prototype.elements.removeFormat || {}; " . "jsToolBar.prototype.elements.removeFormat.title = '" . html::escapeJS(__('Remove text formating')) . "'; ";
     if (!$GLOBALS['core']->auth->check('media,media_admin', $GLOBALS['core']->blog->id)) {
         $res .= "jsToolBar.prototype.elements.img_select.disabled = true;\n";
     }
     $res .= "jsToolBar.prototype.toolbar_bottom = " . (isset($GLOBALS['core']->auth) && $GLOBALS['core']->auth->getOption('toolbar_bottom') ? 'true' : 'false') . ";\n";
     $res .= "\n//]]>\n" . "</script>\n";
     return $res;
 }
Ejemplo n.º 16
0
 public function Fire()
 {
     $bug = new Bug($this->input->_id);
     try {
         $bug->FetchInto();
     } catch (\phalanx\data\ModelException $e) {
         EventPump::Pump()->RaiseEvent(new StandardErrorEvent(l10n::S('BUG_ID_NOT_FOUND')));
         return;
     }
     $this->bug = $bug;
     $this->bug_reporter = $bug->FetchReporter();
     $this->attributes = $bug->FetchAttributes();
     $this->comments = $bug->FetchComments();
 }
Ejemplo n.º 17
0
 protected function prepend_admin()
 {
     # on détermine si on est actuellement sur ce module
     $this->onThisModule();
     # chargement des locales admin
     l10n::set(__DIR__ . '/locales/' . $this->okt->user->language . '/admin');
     # on ajoutent un item au menu admin
     if (!defined('OKT_DISABLE_MENU')) {
         $this->okt->page->guestbookSubMenu = new htmlBlockList(null, adminPage::$formatHtmlSubMenu);
         $this->okt->page->mainMenu->add($this->getName(), 'module.php?m=guestbook', ON_GUESTBOOK_MODULE, 10, $this->okt->checkPerm('guestbook'), null, $this->okt->page->guestbookSubMenu, $this->url() . '/icon.png');
         $this->okt->page->guestbookSubMenu->add(__('c_a_menu_management'), 'module.php?m=guestbook&amp;action=index', ON_GUESTBOOK_MODULE && ($this->okt->page->action !== 'display' && $this->okt->page->action !== 'config'), 1);
         $this->okt->page->guestbookSubMenu->add(__('c_a_menu_display'), 'module.php?m=guestbook&amp;action=display', ON_GUESTBOOK_MODULE && $this->okt->page->action === 'display', 2, $this->okt->checkPerm('guestbook_display'));
         $this->okt->page->guestbookSubMenu->add(__('c_a_menu_configuration'), 'module.php?m=guestbook&amp;action=config', ON_GUESTBOOK_MODULE && $this->okt->page->action === 'config', 3, $this->okt->checkPerm('guestbook_config'));
     }
 }
Ejemplo n.º 18
0
 protected function prepend_admin()
 {
     # on détermine si on est actuellement sur ce module
     $this->onThisModule();
     # chargement des locales admin
     l10n::set(__DIR__ . '/locales/' . $this->okt->user->language . '/admin');
     # on ajoutent un item au menu admin
     if (!defined('OKT_DISABLE_MENU')) {
         $this->okt->page->contactSubMenu = new htmlBlockList(null, adminPage::$formatHtmlSubMenu);
         $this->okt->page->mainMenu->add($this->getName(), 'module.php?m=contact', ON_CONTACT_MODULE, 2000, $this->okt->checkPerm('contact_recipients'), null, $this->okt->page->contactSubMenu, $this->url() . '/icon.png');
         $this->okt->page->contactSubMenu->add(__('m_contact_menu_recipients'), 'module.php?m=contact&amp;action=index', ON_CONTACT_MODULE && (!$this->okt->page->action || $this->okt->page->action === 'index'), 1, $this->okt->checkPerm('contact_recipients'));
         $this->okt->page->contactSubMenu->add(__('m_contact_menu_fields'), 'module.php?m=contact&amp;action=fields', ON_CONTACT_MODULE && ($this->okt->page->action === 'fields' || $this->okt->page->action === 'field'), 2, $this->okt->checkPerm('contact_fields'));
         $this->okt->page->contactSubMenu->add(__('m_contact_menu_configuration'), 'module.php?m=contact&amp;action=config', ON_CONTACT_MODULE && $this->okt->page->action === 'config', 3, $this->okt->checkPerm('contact_config'));
     }
 }
Ejemplo n.º 19
0
 public function Fire()
 {
     if ($this->input->do == 'fire') {
         $user = new User();
         $user->set_condition('email = :email');
         $user->email = $this->input->email;
         try {
             $user = $user->Fetch();
         } catch (phalanx\data\ModelException $e) {
             EventPump::Pump()->RaiseEvent(new StandardErrorEvent(l10n::S('LOGIN_FAILED')));
             return;
         }
         if ($user->password != md5(sha1($this->input->password) . $user->salt)) {
             EventPump::Pump()->RaiseEvent(new StandardErrorEvent(l10n::S('LOGIN_FAILED')));
             return;
         }
         // We need to set _COOKIE values so that if the last_event requires
         // authentication, we can return the correct state.
         $expires = time() + 60 * 60 * 5;
         $this->_SetCookie('bugdar_user', $user->user_id, $expires);
         $this->_SetCookie('bugdar_pass', $user->authkey, $expires);
         $last_event = NULL;
         if ($this->input->last_event) {
             $last_event = unserialize(base64_decode($this->input->last_event));
             $class = $last_event[0];
             $input = $last_event[1];
             if (!class_exists($class)) {
                 $path = phalanx\base\CamelCaseToUnderscore($class);
                 $path = preg_replace('/_event$/', '', $path);
                 require_once BUGDAR_ROOT . "/events/{$path}.php";
             }
             $last_event = new $class($input);
         }
         $this->successful = TRUE;
         EventPump::Pump()->PostEvent($last_event ?: new StandardSuccessEvent('home', l10n::S('LOGIN_SUCCESSFUL')));
         return;
     }
     // Find the first non-UserLoginEvent that was processed. If the event
     // hasn't been finished, then this event preempted it and we should
     // store its data so that the user can return to what she was doing.
     $events = EventPump::Pump()->GetAllEvents();
     foreach ($events as $event) {
         if (!$event instanceof $this && $event->state() != EventPump::EVENT_FINISHED) {
             $this->last_event = base64_encode(serialize(array(get_class($event), $event->input)));
             break;
         }
     }
 }
Ejemplo n.º 20
0
 protected function prepend_admin()
 {
     # on détermine si on est actuellement sur ce module
     $this->onThisModule();
     # chargement des locales admin
     l10n::set(__DIR__ . '/locales/' . $this->okt->user->language . '/admin');
     # on ajoutent un élément au menu admin
     if (!defined('OKT_DISABLE_MENU')) {
         $this->okt->page->diarySubMenu = new htmlBlockList(null, adminPage::$formatHtmlSubMenu);
         $this->okt->page->mainMenu->add($this->getName(), 'module.php?m=diary', ON_DIARY_MODULE, 20, $this->okt->checkPerm('diary'), null, $this->okt->page->diarySubMenu, $this->url() . '/icon.png');
         $this->okt->page->diarySubMenu->add(__('m_diary_menu_management'), 'module.php?m=diary&amp;action=index', ON_DIARY_MODULE && (!$this->okt->page->action || $this->okt->page->action === 'index' || $this->okt->page->action === 'edit'), 10);
         $this->okt->page->diarySubMenu->add(__('m_diary_menu_add_event'), 'module.php?m=diary&amp;action=add', ON_DIARY_MODULE && $this->okt->page->action === 'add', 20, $this->okt->checkPerm('diary_add'));
         $this->okt->page->diarySubMenu->add(__('m_diary_menu_display'), 'module.php?m=diary&amp;action=display', ON_DIARY_MODULE && $this->okt->page->action === 'display', 200, $this->okt->checkPerm('diary_display'));
         $this->okt->page->diarySubMenu->add(__('m_diary_menu_config'), 'module.php?m=diary&amp;action=config', ON_DIARY_MODULE && $this->okt->page->action === 'config', 300, $this->okt->checkPerm('diary_config'));
     }
 }
Ejemplo n.º 21
0
 protected function prepend_admin()
 {
     # on détermine si on est actuellement sur ce module
     $this->onThisModule();
     # chargement des locales admin
     l10n::set(__DIR__ . '/locales/' . $this->okt->user->language . '/admin');
     # on ajoutent un item au menu admin
     if (!defined('OKT_DISABLE_MENU')) {
         $this->okt->page->catalogSubMenu = new htmlBlockList(null, adminPage::$formatHtmlSubMenu);
         $this->okt->page->mainMenu->add($this->getName(), 'module.php?m=catalog', ON_CATALOG_MODULE, 10, $this->okt->checkPerm('catalog'), null, $this->okt->page->catalogSubMenu, $this->url() . '/icon.png');
         $this->okt->page->catalogSubMenu->add('Gestion', 'module.php?m=catalog&amp;action=index', ON_CATALOG_MODULE && (!$this->okt->page->action || $this->okt->page->action === 'index' || $this->okt->page->action === 'edit'), 1);
         $this->okt->page->catalogSubMenu->add('Ajouter un produit', 'module.php?m=catalog&amp;action=add', ON_CATALOG_MODULE && $this->okt->page->action === 'add', 2, $this->config->categories_enable && $this->okt->checkPerm('catalog_add'));
         $this->okt->page->catalogSubMenu->add('Catégories', 'module.php?m=catalog&amp;action=categories', ON_CATALOG_MODULE && $this->okt->page->action === 'categories', 5, $this->config->categories_enable && $this->okt->checkPerm('catalog_categories'));
         $this->okt->page->catalogSubMenu->add('Affichage', 'module.php?m=catalog&amp;action=display', ON_CATALOG_MODULE && $this->okt->page->action === 'display', 10, $this->okt->checkPerm('catalog_display'));
         $this->okt->page->catalogSubMenu->add('Configuration', 'module.php?m=catalog&amp;action=config', ON_CATALOG_MODULE && $this->okt->page->action === 'config', 20, $this->okt->checkPerm('catalog_config'));
     }
 }
Ejemplo n.º 22
0
 protected function prepend_admin()
 {
     # chargement des locales admin
     l10n::set(__DIR__ . '/locales/' . $this->okt->user->language . '/admin');
     # on détermine si on est actuellement sur ce module
     $this->onThisModule();
     # on ajoutent un item au menu principal
     if (!defined('OKT_DISABLE_MENU')) {
         $this->okt->page->mainMenu->add(__('Users'), 'module.php?m=users', ON_USERS_MODULE, 5000000, $this->okt->checkPerm('users'), null, $this->okt->page->usersSubMenu = new htmlBlockList(null, adminPage::$formatHtmlSubMenu), $this->url() . '/icon.png');
         $this->okt->page->usersSubMenu->add(__('c_a_menu_management'), 'module.php?m=users&amp;action=index', ON_USERS_MODULE && (!$this->okt->page->action || $this->okt->page->action === 'index' || $this->okt->page->action === 'add' || $this->okt->page->action === 'edit'), 10, $this->okt->checkPerm('users'));
         $this->okt->page->usersSubMenu->add(__('m_users_Groups'), 'module.php?m=users&amp;action=groups', ON_USERS_MODULE && $this->okt->page->action === 'groups', 20, $this->okt->checkPerm('groups'));
         $this->okt->page->usersSubMenu->add(__('m_users_Custom_fields'), 'module.php?m=users&amp;action=fields', ON_USERS_MODULE && ($this->okt->page->action === 'fields' || $this->okt->page->action === 'field'), 30, $this->config->enable_custom_fields && $this->okt->checkPerm('users_custom_fields'));
         $this->okt->page->usersSubMenu->add(__('m_users_Export'), 'module.php?m=users&amp;action=export', ON_USERS_MODULE && $this->okt->page->action === 'export', 40, $this->okt->checkPerm('users_export'));
         $this->okt->page->usersSubMenu->add(__('c_a_menu_display'), 'module.php?m=users&amp;action=display', ON_USERS_MODULE && $this->okt->page->action === 'display', 90, $this->okt->checkPerm('users_display'));
         $this->okt->page->usersSubMenu->add(__('c_a_menu_configuration'), 'module.php?m=users&amp;action=config', ON_USERS_MODULE && $this->okt->page->action === 'config', 100, $this->okt->checkPerm('users_config'));
     }
 }
Ejemplo n.º 23
0
 protected function prepend_admin()
 {
     # chargement des locales admin
     l10n::set(__DIR__ . '/locales/' . $this->okt->user->language . '/admin');
     # on détermine si on est actuellement sur ce module
     $this->onThisModule();
     # on ajoute un item au menu admin
     if (!defined('OKT_DISABLE_MENU')) {
         $this->okt->page->partnersSubMenu = new htmlBlockList(null, adminPage::$formatHtmlSubMenu);
         $this->okt->page->mainMenu->add($this->getName(), 'module.php?m=partners', ON_PARTNERS_MODULE, 10, $this->okt->checkPerm('partners'), null, $this->okt->page->partnersSubMenu, $this->url() . '/icon.png');
         $this->okt->page->partnersSubMenu->add(__('c_a_menu_management'), 'module.php?m=partners&amp;action=index', ON_PARTNERS_MODULE && (!$this->okt->page->action || $this->okt->page->action === 'index' || $this->okt->page->action === 'edit'), 1);
         $this->okt->page->partnersSubMenu->add(__('m_partners_add_partner'), 'module.php?m=partners&amp;action=add', ON_PARTNERS_MODULE && $this->okt->page->action === 'add', 2, $this->okt->checkPerm('partners_add'));
         $this->okt->page->partnersSubMenu->add(__('m_partners_Categories'), 'module.php?m=partners&amp;action=categories', ON_PARTNERS_MODULE && $this->okt->page->action === 'categories', 3, $this->config->enable_categories && $this->okt->checkPerm('partners_add'));
         $this->okt->page->partnersSubMenu->add(__('c_a_menu_display'), 'module.php?m=partners&amp;action=display', ON_PARTNERS_MODULE && $this->okt->page->action === 'display', 10, $this->okt->checkPerm('partners_display'));
         $this->okt->page->partnersSubMenu->add(__('c_a_menu_configuration'), 'module.php?m=partners&amp;action=config', ON_PARTNERS_MODULE && $this->okt->page->action === 'config', 20, $this->okt->checkPerm('partners_config'));
     }
 }
Ejemplo n.º 24
0
 public function __construct()
 {
     $this->registry = registry::getInstance();
     $this->session = $this->registry["session"];
     $this->cookie = $this->registry["cookie"];
     $this->view = $this->registry["views"];
     $this->themes = $this->registry["themes"];
     $this->path = $this->registry["path"];
     $this->l10n = l10n::getInstance();
     $this->html = html::getInstance();
     $this->ajax = new ajax();
     $this->pagination = pagination::getInstance();
     if ($_SERVER["REQUEST_METHOD"] == "POST") {
         $this->data = $_POST;
     } else {
         $this->data = NULL;
     }
     $this->isAjax = $this->isAjax();
 }
Ejemplo n.º 25
0
 protected function prepend_admin()
 {
     # on détermine si on est actuellement sur ce module
     $this->onThisModule();
     # locales
     l10n::set(__DIR__ . '/locales/' . $this->okt->user->language . '/admin');
     # on ajoutent un item au menu admin
     if (!defined('OKT_DISABLE_MENU')) {
         $this->okt->page->homeSubMenu->add(__('Media manager'), 'module.php?m=media_manager', ON_MEDIA_MANAGER_MODULE && (!$this->okt->page->action || $this->okt->page->action === 'index'), 30, $this->okt->checkPerm('media') || $this->okt->checkPerm('media_admin'), null);
         /*
         			$this->okt->page->configSubMenu->add(
         				__('Media manager'),
         				'module.php?m=media_manager&amp;action=config',
         				ON_MEDIA_MANAGER_MODULE && ($this->okt->page->action === 'config'),
         				30,
         				$this->okt->checkPerm('media_config'),
         				null
         			);
         */
     }
 }
Ejemplo n.º 26
0
 /**
  * Load the translation strings
  *
  * @access public
  * @author Jerome Bogaerts, <*****@*****.**>
  * @param  common_ext_Extension $extension
  * @param  string langCode
  * @return mixed
  */
 public static function init(common_ext_Extension $extension, $langCode)
 {
     // if the langCode is empty do nothing
     if (empty($langCode)) {
         throw new Exception("Language is not defined");
     }
     //init the ClearFw l10n tools
     l10n::init();
     $basePath = $extension->getDir();
     if (!empty($_GET['ext']) && is_string($_GET['ext'])) {
         $shownExtension = common_ext_ExtensionsManager::singleton()->getExtensionById($_GET['ext']);
         if (!empty($shownExtension)) {
             try {
                 $basePath = $shownExtension->getDir();
                 $baseUrl = $shownExtension->getConstant('BASE_URL');
             } catch (common_exception_Error $e) {
                 // let the current base path be used...
             }
         }
     }
     l10n::set($basePath . 'locales' . DIRECTORY_SEPARATOR . $langCode . DIRECTORY_SEPARATOR . 'messages');
 }
Ejemplo n.º 27
0
 protected function prepend_admin()
 {
     # On détermine si on est actuellement sur ce module
     $this->onThisModule();
     # Chargement des locales admin
     l10n::set(__DIR__ . '/locales/' . $this->okt->user->language . '/admin');
     # On ajoutent un item au menu
     if (!defined('OKT_DISABLE_MENU')) {
         $this->okt->page->developmentSubMenu = new htmlBlockList(null, adminPage::$formatHtmlSubMenu);
         $this->okt->page->mainMenu->add(__('m_development_menu_development'), null, ON_DEVELOPMENT_MODULE, 10000001, true, null, $this->okt->page->developmentSubMenu, $this->url() . '/icon.png');
         $this->okt->page->developmentSubMenu->add(__('m_development_menu_development'), 'module.php?m=development&amp;action=index', ON_DEVELOPMENT_MODULE && (!$this->okt->page->action || $this->okt->page->action === 'index'), 1, $this->okt->checkPerm('development_debug_bar'));
         $this->okt->page->developmentSubMenu->add(__('m_development_menu_debugbar'), 'module.php?m=development&amp;action=debug_bar', ON_DEVELOPMENT_MODULE && $this->okt->page->action === 'debug_bar', 2, $this->okt->checkPerm('development_debug_bar'));
         $this->okt->page->developmentSubMenu->add(__('m_development_menu_bootstrap'), 'module.php?m=development&amp;action=bootstrap', ON_DEVELOPMENT_MODULE && $this->okt->page->action === 'bootstrap', 3, $this->okt->checkPerm('development_bootstrap'));
         $this->okt->page->developmentSubMenu->add(__('m_development_menu_counting'), 'module.php?m=development&amp;action=counting', ON_DEVELOPMENT_MODULE && $this->okt->page->action === 'counting', 4, $this->okt->checkPerm('development_counting'));
     }
     # Message admin home
     if ($this->okt->user->is_superadmin) {
         $this->okt->triggers->registerTrigger('adminIndexHtmlContent', array('module_development', 'adminIndexHtmlContent'));
     }
     # Add admin debug bar
     $this->debugBar->loadInAdminPart();
 }
Ejemplo n.º 28
0
 public function Fire()
 {
     // If an ID was passed, try updating the record.
     if ($this->input->_id) {
         try {
             $this->usergroup = new Usergroup($this->input->_id);
             $this->usergroup->FetchInto();
         } catch (\phalanx\data\ModelException $e) {
             EventPump::Pump()->RaiseEvent(new StandardErrorEvent(l10n::S('ERROR_INVALID_ID')));
             return;
         }
     } else {
         // Otherwise, create a new one.
         $this->usergroup = new Usergroup();
     }
     if ($this->input->_method == 'POST') {
         $title = \phalanx\data\Cleaner::HTML($this->input->title);
         if (empty($title)) {
             EventPump::Pump()->RaiseEvent(new StandardErrorEvent('The title field is required.'));
             return;
         }
         $this->usergroup->title = $title;
         if (!empty($this->input->display_title)) {
             $this->usergroup->display_title = \phalanx\data\Cleaner::HTML($this->input->display_title);
         }
         $mask = 0;
         foreach ($this->input->permissions as $name => $bit) {
             $mask += $bit * Usergroup::$permissions[$name];
         }
         $this->usergroup->mask = $mask;
         // Save the actual record.
         if ($this->input->_id) {
             $this->usergroup->Update();
         } else {
             $this->usergroup->Insert();
         }
     }
 }
Ejemplo n.º 29
0
 /**
  * Constructor.
  *
  * @param oktCore $okt
  * @param array $aConfig
  * @param string $sBase
  * @param string $sTplFamily
  * @param string $sBaseUrl
  * @return void
  */
 public function __construct($okt, $aConfig, $sBase, $sTplFamily, $sBaseUrl = '/')
 {
     $this->okt = $okt;
     $this->aConfig = $aConfig;
     $this->sTplFamily = $sTplFamily;
     $this->sBase = util::formatAppPath($sBase, false, false);
     $this->sBaseUrl = $sBaseUrl;
     $this->loadTemplatesPaths();
     $this->loadTemplatesInfos();
     l10n::set(OKT_LOCALES_PATH . '/' . $this->okt->user->language . '/admin.templates.config');
     # téléchargement d'un template
     if (!empty($_GET['tpl_download']) && !empty($_GET['tpl_id']) && array_key_exists(rawurldecode($_GET['tpl_id']), $this->getTplInfos()) && !empty($_GET['tpl_family']) && rawurldecode($_GET['tpl_family']) == $this->sTplFamily) {
         $this->dowloadTemplate(rawurldecode($_GET['tpl_id']));
     }
     # suppression d'un template
     if (!empty($_GET['tpl_delete']) && !empty($_GET['tpl_id']) && array_key_exists(rawurldecode($_GET['tpl_id']), $this->getTplInfos()) && !empty($_GET['tpl_family']) && rawurldecode($_GET['tpl_family']) == $this->sTplFamily) {
         $this->deleteTemplate(rawurldecode($_GET['tpl_id']));
         $this->okt->redirect($this->sBaseUrl . 'tpl_family=' . rawurlencode($this->sTplFamily) . '&tpl_deleted=1');
     }
     if (isset($this->okt->page) && !empty($_GET['tpl_family']) && rawurldecode($_GET['tpl_family']) == $this->sTplFamily) {
         $this->okt->page->messages->success('tpl_deleted', __('c_a_tpl_config_tpl_deleted'));
     }
 }
Ejemplo n.º 30
0
 /**
  * ISO Codes
  *
  * Returns an array predefined languages ISO codes as you can find on
  * {@link http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes}
  * The list as additionnal IETF codes as pt-br.
  *
  * @param boolean	$flip			Flip resulting array
  * @param boolean	$name_with_code	Prefix (code) to names
  * @return array
  */
 public static function getISOcodes($flip = false, $name_with_code = false)
 {
     if (empty(self::$langs)) {
         self::$langs = array('aa' => 'Afaraf', 'ab' => 'Аҧсуа', 'ae' => 'avesta', 'af' => 'Afrikaans', 'ak' => 'Akan', 'am' => 'አማርኛ', 'an' => 'Aragonés', 'ar' => '‫العربية', 'as' => 'অসমীয়া', 'av' => 'авар мацӀ', 'ay' => 'aymar aru', 'az' => 'azərbaycan dili', 'ba' => 'башҡорт теле', 'be' => 'Беларуская', 'bg' => 'български език', 'bh' => 'भोजपुरी', 'bi' => 'Bislama', 'bm' => 'bamanankan', 'bn' => 'বাংলা', 'bo' => 'བོད་ཡིག', 'br' => 'brezhoneg', 'bs' => 'bosanski jezik', 'ca' => 'Català', 'ce' => 'нохчийн мотт', 'ch' => 'Chamoru', 'co' => 'corsu', 'cr' => 'ᓀᐦᐃᔭᐍᐏᐣ', 'cs' => 'česky', 'cu' => 'ѩзыкъ словѣньскъ', 'cv' => 'чӑваш чӗлхи', 'cy' => 'Cymraeg', 'da' => 'dansk', 'de' => 'Deutsch', 'dv' => '‫ދިވެހި', 'dz' => 'རྫོང་ཁ', 'ee' => 'Ɛʋɛgbɛ', 'el' => 'Ελληνικά', 'en' => 'English', 'eo' => 'Esperanto', 'es' => 'español', 'et' => 'Eesti keel', 'eu' => 'euskara', 'fa' => '‫فارسی', 'ff' => 'Fulfulde', 'fi' => 'suomen kieli', 'fj' => 'vosa Vakaviti', 'fo' => 'Føroyskt', 'fr' => 'français', 'fy' => 'Frysk', 'ga' => 'Gaeilge', 'gd' => 'Gàidhlig', 'gl' => 'Galego', 'gn' => "Avañe'ẽ", 'gu' => 'ગુજરાતી', 'gv' => 'Ghaelg', 'ha' => '‫هَوُسَ', 'he' => '‫עברית', 'hi' => 'हिन्दी', 'ho' => 'Hiri Motu', 'hr' => 'Hrvatski', 'ht' => 'Kreyòl ayisyen', 'hu' => 'Magyar', 'hy' => 'Հայերեն', 'hz' => 'Otjiherero', 'ia' => 'Interlingua', 'id' => 'Bahasa Indonesia', 'ie' => 'Interlingue', 'ig' => 'Igbo', 'ii' => 'ꆇꉙ', 'ik' => 'Iñupiaq', 'io' => 'Ido', 'is' => 'Íslenska', 'it' => 'Italiano', 'iu' => 'ᐃᓄᒃᑎᑐᑦ', 'ja' => '日本語', 'jv' => 'basa Jawa', 'ka' => 'ქართული', 'kg' => 'KiKongo', 'ki' => 'Gĩkũyũ', 'kj' => 'Kuanyama', 'kk' => 'Қазақ тілі', 'kl' => 'kalaallisut', 'km' => 'ភាសាខ្មែរ', 'kn' => 'ಕನ್ನಡ', 'ko' => '한국어', 'kr' => 'Kanuri', 'ks' => 'कश्मीरी', 'ku' => 'Kurdî', 'kv' => 'коми кыв', 'kw' => 'Kernewek', 'ky' => 'кыргыз тили', 'la' => 'latine', 'lb' => 'Lëtzebuergesch', 'lg' => 'Luganda', 'li' => 'Limburgs', 'ln' => 'Lingála', 'lo' => 'ພາສາລາວ', 'lt' => 'lietuvių kalba', 'lu' => 'Luba-Katanga	', 'lv' => 'latviešu valoda', 'mg' => 'Malagasy fiteny', 'mh' => 'Kajin M̧ajeļ', 'mi' => 'te reo Māori', 'mk' => 'македонски јазик', 'ml' => 'മലയാളം', 'mn' => 'Монгол', 'mo' => 'Limba moldovenească', 'mr' => 'मराठी', 'ms' => 'bahasa Melayu', 'mt' => 'Malti', 'my' => 'ဗမာစာ', 'na' => 'Ekakairũ Naoero', 'nb' => 'Norsk bokmål', 'nd' => 'isiNdebele', 'ne' => 'नेपाली', 'ng' => 'Owambo', 'nl' => 'Nederlands', 'nl-be' => 'Nederlands (Belgium)', 'nn' => 'Norsk nynorsk', 'no' => 'Norsk', 'nr' => 'Ndébélé', 'nv' => 'Diné bizaad', 'ny' => 'chiCheŵa', 'oc' => 'Occitan', 'oj' => 'ᐊᓂᔑᓈᐯᒧᐎᓐ', 'om' => 'Afaan Oromoo', 'or' => 'ଓଡ଼ିଆ', 'os' => 'Ирон æвзаг', 'pa' => 'ਪੰਜਾਬੀ', 'pi' => 'पाऴि', 'pl' => 'polski', 'ps' => '‫پښتو', 'pt' => 'Português', 'pt-br' => 'Português (Brasil)', 'qu' => 'Runa Simi', 'rm' => 'rumantsch grischun', 'rn' => 'kiRundi', 'ro' => 'română', 'ru' => 'Русский', 'rw' => 'Ikinyarwanda', 'sa' => 'संस्कृतम्', 'sc' => 'sardu', 'sd' => 'सिन्धी', 'se' => 'Davvisámegiella', 'sg' => 'yângâ tî sängö', 'sh' => 'Srpskohrvatski', 'si' => 'සිංහල', 'sk' => 'slovenčina', 'sl' => 'slovenščina', 'sm' => "gagana fa'a Samoa", 'sn' => 'chiShona', 'so' => 'Soomaaliga', 'sq' => 'Shqip', 'sr' => 'српски језик', 'ss' => 'SiSwati', 'st' => 'seSotho', 'su' => 'Basa Sunda', 'sv' => 'Svenska', 'sw' => 'Kiswahili', 'ta' => 'தமிழ்', 'te' => 'తెలుగు', 'tg' => 'тоҷикӣ', 'th' => 'ไทย', 'ti' => 'ትግርኛ', 'tk' => 'Türkmen', 'tl' => 'Tagalog', 'tn' => 'seTswana', 'to' => 'faka Tonga', 'tr' => 'Türkçe', 'ts' => 'xiTsonga', 'tt' => 'татарча', 'tw' => 'Twi', 'ty' => 'Reo Mā`ohi', 'ug' => 'Uyƣurqə', 'uk' => 'Українська', 'ur' => '‫اردو', 'uz' => "O'zbek", 've' => 'tshiVenḓa', 'vi' => 'Tiếng Việt', 'vo' => 'Volapük', 'wa' => 'Walon', 'wo' => 'Wollof', 'xh' => 'isiXhosa', 'yi' => '‫ייִדיש', 'yo' => 'Yorùbá', 'za' => 'Saɯ cueŋƅ', 'zh' => '中文', 'zh-hk' => '中文 (香港)', 'zh-tw' => '中文 (臺灣)', 'zu' => 'isiZulu');
     }
     $langs = self::$langs;
     if ($name_with_code) {
         foreach ($langs as $k => &$v) {
             $v = '(' . $k . ') ' . $v;
         }
     }
     if ($flip) {
         return array_flip($langs);
     }
     return $langs;
 }