예제 #1
0
 public function run($params = null)
 {
     $dbconf = \fpcm\classes\baseconfig::getDatabaseConfig();
     $view = new \fpcm\model\view\module(\fpcm\model\abstracts\module::getModuleKeyByFolder(__DIR__), 'acp', 'main');
     $view->assign('dbconfig', $dbconf);
     $view->render();
 }
예제 #2
0
 public function run($params = null)
 {
     if ($params !== 'nkorgexample') {
         return false;
     }
     $view = new \fpcm\model\view\module(\fpcm\model\abstracts\module::getModuleKeyByFolder(__FILE__), 'ajax', 'logview');
     $view->assign('logfiledata', \fpcm\modules\nkorg\example\model\logfile::getLog());
     $view->render();
 }
예제 #3
0
 public function run($params = null)
 {
     $moduleEventList = new \fpcm\model\events\eventList();
     $sortedEvents = array();
     foreach ($moduleEventList->getSystemEventList() as $eventName) {
         $letter = strtoupper(substr($eventName, 0, 1));
         $sortedEvents[$letter][] = $eventName;
     }
     $view = new \fpcm\model\view\module('nkorg/modulecreator', 'acp', 'main', '');
     $view->assign('sortedEvents', $sortedEvents);
     $view->render();
 }
예제 #4
0
 public function run($params = null)
 {
     $this->db = \fpcm\classes\baseconfig::$fpcmDatabase;
     $view = new \fpcm\model\view\module('nkorg/classicimporter', 'acp', 'main', '');
     $import = true;
     if ($this->db->count(\fpcm\classes\database::tableRoll) > 3) {
         $import = false;
     }
     if ($this->db->count(\fpcm\classes\database::tableAuthors) > 1) {
         $import = false;
     }
     if ($this->db->count(\fpcm\classes\database::tableCategories) > 1) {
         $import = false;
     }
     if ($this->db->count(\fpcm\classes\database::tableArticles) > 0) {
         $import = false;
     }
     if ($this->db->count(\fpcm\classes\database::tableComments) > 0) {
         $import = false;
     }
     if (!$import) {
         $view->addErrorMessage('FPCM_CLASSICIMPORTER_NOIMPORT');
     }
     $view->assign('doimport', $import);
     $view->assign('importActions', array('FPCM_CLASSICIMPORTER_IMPORT_ROLLS' => 'imports/rolls.php', 'FPCM_CLASSICIMPORTER_IMPORT_USERS' => 'imports/users.php', 'FPCM_CLASSICIMPORTER_IMPORT_CATEGORIES' => 'imports/categories.php', 'FPCM_CLASSICIMPORTER_IMPORT_IPS' => 'imports/ipadresses.php', 'FPCM_CLASSICIMPORTER_IMPORT_SMILEYS' => 'imports/smileys.php', 'FPCM_CLASSICIMPORTER_IMPORT_UPLAODS' => 'imports/uploads.php', 'FPCM_CLASSICIMPORTER_IMPORT_ARTICLES' => 'imports/articles.php', 'FPCM_CLASSICIMPORTER_IMPORT_CONFIG' => 'imports/config.php', 'FPCM_CLASSICIMPORTER_IMPORT_TEMPLATES' => 'imports/templates.php'));
     $view->addJsVars(array('fpcmClassicImporterOpenModule' => $this->lang->translate('FPCM_CLASSICIMPORTER_OPENMODULE'), 'fpcmClassicImporterArticleID' => $this->lang->translate('FPCM_CLASSICIMPORTER_IMPORT_ARTICLES_ID')));
     $view->render();
 }
예제 #5
0
 public function run($params = null)
 {
     $moduleKey = \fpcm\model\abstracts\module::getModuleKeyByFolder(__DIR__);
     $view = new \fpcm\model\view\module($moduleKey, 'acp', 'main', '');
     $chapters = array();
     if ($this->config->system_mode) {
         $chapters['NKORG_INTEGRATION_PHPINCLUDE'] = 'phpinclude';
     }
     $chapters['NKORG_INTEGRATION_CSSCLASSES'] = 'cssclasses';
     $chapters['NKORG_INTEGRATION_SHOWARTICLES'] = 'showarticles';
     $chapters['NKORG_INTEGRATION_SHOWLATEST'] = 'showlatest';
     if ($this->config->system_mode) {
         $chapters['NKORG_INTEGRATION_SHOWPAGETITEL'] = 'showpagetitle';
         $chapters['NKORG_INTEGRATION_SHOWARTICLETITLE'] = 'showarticletitle';
         $chapters['NKORG_INTEGRATION_UTF8OUTPUT'] = 'utf8output';
     }
     $chapters['NKORG_INTEGRATION_RSSFEED'] = 'rssfeed';
     $view->assign('chapters', $chapters);
     $view->assign('sysmode', $this->config->system_mode);
     $view->assign('sysurl', $this->config->system_url);
     $view->render();
 }
예제 #6
0
 public function run($params = null)
 {
     $view = new \fpcm\model\view\module(\fpcm\model\abstracts\module::getModuleKeyByFolder(__DIR__), 'acp', 'main');
     $cfgKey = \fpcm\modules\nkorg\sitemaplinklist\nkorgsitemaplinklist::NKORG_SITEMAPLINKLIST_CONFIGKEY;
     if ($this->config->{$cfgKey}) {
         $savedpath = $this->config->{$cfgKey};
         $listcontent = array();
         $xmlObject = new \SimpleXMLElement(file_get_contents($savedpath));
         foreach ($xmlObject->children() as $child) {
             $listcontent[base64_encode($child->loc->__toString())] = $child->loc->__toString();
         }
     } else {
         $savedpath = '/';
         $listcontent = false;
     }
     $acfile = new \fpcm\modules\nkorg\sitemaplinklist\model\activelinkfile();
     $activeLinks = array_map('base64_encode', $acfile->loadData());
     $view->assign('savedpath', $savedpath);
     $view->assign('listcontent', $listcontent);
     $view->assign('activeLinks', $activeLinks);
     $view->render();
 }
예제 #7
0
 public function run($params = null)
 {
     if (\fpcm\classes\http::postOnly('btnClearLog') !== null) {
         \fpcm\modules\nkorg\example\model\logfile::cleanup();
     }
     $view = new \fpcm\model\view\module(\fpcm\model\abstracts\module::getModuleKeyByFolder(__FILE__), 'acp', 'main');
     $view->addMessage('FPCM_EXAMPLE_HEADLINE');
     $view->addNoticeMessage('FPCM_EXAMPLE_HEADLINE');
     $view->addErrorMessage('FPCM_EXAMPLE_HEADLINE');
     $view->assign('logfiledata', \fpcm\modules\nkorg\example\model\logfile::getLog());
     $view->render();
 }
예제 #8
0
 public function run($params = null)
 {
     $view = new \fpcm\model\view\module('nkorg/rssimport', 'acp', 'main', '');
     $userlist = new \fpcm\model\users\userList();
     $users = $userlist->getUsersNameList();
     $seluser = array_values(array_slice($users, 0, 1));
     $view->assign('userids', $users);
     $view->assign('selectedUser', $seluser[0]);
     $categorylist = new \fpcm\model\categories\categoryList();
     $categories = $categorylist->getCategoriesNameListCurrent();
     $selcategory = array_values(array_slice($categories, 0, 1));
     $view->assign('categoryids', $categories);
     $view->assign('selectedCategory', $selcategory[0]);
     $view->render();
 }
예제 #9
0
 public function run($params = null)
 {
     $view = new \fpcm\model\view\module(\fpcm\model\abstracts\module::getModuleKeyByFolder(__DIR__), 'acp', 'main');
     $messages = new \fpcm\modules\nkorg\inactivity_manager\model\messages();
     if (!is_null(\fpcm\classes\http::get('added'))) {
         $view->addNoticeMessage('NKORGINACTIVITY_MANAGER_SAVED_OK');
     }
     if (!is_null(\fpcm\classes\http::get('btnDeleteTerms')) && !is_null(\fpcm\classes\http::get('ids'))) {
         $ids = \fpcm\classes\http::get('ids');
         if ($messages->deleteMessage($ids)) {
             $view->addNoticeMessage('NKORGINACTIVITY_MANAGER_DELETE_OK');
         } else {
             $view->addErrorMessage('NKORGINACTIVITY_MANAGER_DELETE_FAILED');
         }
     }
     $view->assign('messages', $messages->getMessages());
     $view->render();
 }
예제 #10
0
 public function run($params = null)
 {
     $view = new \fpcm\model\view\module(\fpcm\model\abstracts\module::getModuleKeyByFolder(__DIR__), 'acp', 'main');
     $termlist = new \fpcm\modules\nkorg\tweetextender\model\termlist();
     if (!is_null(\fpcm\classes\http::get('added'))) {
         $view->addNoticeMessage('NKORG_TWEETENTENDER_SAVED_OK');
     }
     if (!is_null(\fpcm\classes\http::get('btnDeleteTerms')) && !is_null(\fpcm\classes\http::get('ids'))) {
         $ids = \fpcm\classes\http::get('ids');
         if ($termlist->deleteTerms($ids)) {
             $view->addNoticeMessage('NKORG_TWEETENTENDER_DELETE_OK');
         } else {
             $view->addErrorMessage('NKORG_TWEETENTENDER_DELETE_FAILED');
         }
     }
     $terms = $termlist->getTerms();
     $view->assign('terms', $terms);
     $view->render();
 }
예제 #11
0
 public function run($params = null)
 {
     $this->dataPath = \fpcm\classes\baseconfig::$dataDir . 'langeditback/';
     $view = new \fpcm\model\view\module(\fpcm\model\abstracts\module::getModuleKeyByFolder(__DIR__), 'acp', 'main');
     $systemFiles = glob(\fpcm\classes\baseconfig::$langDir . '*/*.php');
     $moduleFiles = glob(\fpcm\classes\baseconfig::$moduleDir . '*/*/lang/*/*.php');
     if (!is_array($systemFiles) || !is_array($moduleFiles)) {
         $view->addErrorMessage('NKORG_LANGEDITOR_LOADERROR');
         $view->render();
         return true;
     }
     $langfiles = array_merge($systemFiles, $moduleFiles);
     $selectedFile = '';
     $lines = array();
     if (!is_null(\fpcm\classes\http::postOnly('btnLangfileSelect')) && \fpcm\classes\http::postOnly('langfile')) {
         $selectedFile = base64_decode(\fpcm\classes\http::postOnly('langfile'));
         if (!in_array($selectedFile, $langfiles) || !file_exists($selectedFile)) {
             $view->addErrorMessage('NKORG_LANGEDITOR_SELECTERROR');
             $selectedFile = '';
         } else {
             require $selectedFile;
             if (!isset($lang)) {
                 $view->addErrorMessage('NKORG_LANGEDITOR_FILEERROR');
             } else {
                 $lines = $lang;
             }
         }
     }
     if (!is_null(\fpcm\classes\http::postOnly('btnEditLangfile')) && \fpcm\classes\http::postOnly('langitems') && \fpcm\classes\http::postOnly('langfile')) {
         $selectedFile = base64_decode(\fpcm\classes\http::postOnly('langfile'));
         if (!is_writable(\fpcm\classes\baseconfig::$langDir)) {
             $view->addErrorMessage('NKORG_LANGEDITOR_NOTWRITABLE', array('{{syslangapth}}' => \fpcm\model\files\ops::removeBaseDir(\fpcm\classes\baseconfig::$langDir)));
         } else {
             $langItems = \fpcm\classes\http::postOnly('langitems', array(4, 7));
             $deletedItems = \fpcm\classes\http::postOnly('deleteitems');
             if (!is_array($deletedItems)) {
                 $deletedItems = array();
             }
             $fileLines = array();
             foreach ($langItems as $item) {
                 $name = $item['name'];
                 $value = $item['value'];
                 $hash = md5($name . $value);
                 if (!$name || !$value || in_array($hash, $deletedItems)) {
                     continue;
                 }
                 $fileLines[strtoupper($name)] = str_replace('\\n', PHP_EOL, $value);
             }
             $lines = $fileLines;
             $selectedFileBack = str_replace(DIRECTORY_SEPARATOR, '_', ltrim(\fpcm\model\files\ops::removeBaseDir($selectedFile), DIRECTORY_SEPARATOR));
             $dest = $this->dataPath . $selectedFileBack . '.' . date('YmdHis');
             if (!copy($selectedFile, $dest)) {
                 $dest = \fpcm\model\files\ops::removeBaseDir($dest, true);
                 $view->addErrorMessage('NKORG_LANGEDITOR_BACKUPERROR', array('{{path}}' => $dest));
                 trigger_error('Unable to create backup of ' . \fpcm\model\files\ops::removeBaseDir($selectedFile) . ' in ' . \fpcm\model\files\ops::removeBaseDir($this->dataPath, true));
             } else {
                 $fileContent = file_get_contents($selectedFile);
                 $langVarPos = strpos($fileContent, '$lang');
                 $fileContent = trim(substr($fileContent, 0, $langVarPos));
                 $fileContent .= PHP_EOL . PHP_EOL . '$lang = ' . var_export($fileLines, true) . ';' . PHP_EOL . '?>';
                 if (!file_put_contents($selectedFile, $fileContent)) {
                     trigger_error('Unable to save changes to language file ' . $selectedFile);
                     $view->addErrorMessage('NKORG_LANGEDITOR_SAVEERROR');
                 } else {
                     $view->addNoticeMessage('NKORG_LANGEDITOR_SAVEOK');
                 }
                 $cache = new \fpcm\classes\cache();
                 $cache->cleanup();
             }
         }
     }
     $files = array($this->lang->translate('NKORG_LANGEDITOR_FILE') => '');
     $excludeArray = array('help.php', 'tz.php');
     foreach ($langfiles as $langfile) {
         $basename = basename($langfile);
         if (in_array($basename, $excludeArray)) {
             continue;
         }
         $files[\fpcm\model\files\ops::removeBaseDir($langfile)] = base64_encode($langfile);
     }
     $view->assign('lines', $lines);
     $view->assign('langfiles', $files);
     $view->assign('selectedFile', $selectedFile);
     $view->render();
 }