/**
  * delete article and navigation node relation
  *
  * @param array $data
  */
 public function perform($data = FALSE)
 {
     $sql = "DELETE FROM {$this->config->dbTablePrefix}article_lock\n                  WHERE\n                   `id_article`={$data['id_article']}";
     $this->model->dba->query($sql);
     $sql = "DELETE FROM {$this->config->dbTablePrefix}article_media_pic\n                  WHERE\n                   `id_article`={$data['id_article']}";
     $this->model->dba->query($sql);
     $sql = "DELETE FROM {$this->config->dbTablePrefix}article_media_file\n                  WHERE\n                   `id_article`={$data['id_article']}";
     $this->model->dba->query($sql);
     $sql = "DELETE FROM {$this->config->dbTablePrefix}article_index\n                  WHERE\n                   `id_article`={$data['id_article']}";
     $this->model->dba->query($sql);
     $sql = "DELETE FROM {$this->config->dbTablePrefix}article_keyword\n                  WHERE\n                   `id_article`={$data['id_article']}";
     $this->model->dba->query($sql);
     $sql = "DELETE FROM {$this->config->dbTablePrefix}article_comment\n                  WHERE\n                   `id_article`={$data['id_article']}";
     $this->model->dba->query($sql);
     $sql = "DELETE FROM {$this->config->dbTablePrefix}article_user\n                  WHERE\n                   `id_article`={$data['id_article']}";
     $this->model->dba->query($sql);
     $sql = "DELETE FROM {$this->config->dbTablePrefix}article_controller_rel\n                  WHERE\n                   `id_article`={$data['id_article']}";
     $this->model->dba->query($sql);
     $this->model->action('common', 'removeUrlRewrite', array('module' => 'article'));
     $this->model->dba->query($sql);
     $sql = "SELECT \n                  `media_folder`,\n                  `id_node`\n                FROM \n                  {$this->config->dbTablePrefix}article_article\n                WHERE\n                   `id_article`={$data['id_article']}";
     $rs = $this->model->dba->query($sql);
     $row = $rs->fetchAssoc();
     if (isset($row['media_folder']) && !empty($row['media_folder'])) {
         // delete article data media folder
         JapaCommonUtil::deleteDirTree(JAPA_BASE_DIR . 'data/article/' . $row['media_folder']);
     }
     $sql = "DELETE FROM {$this->config->dbTablePrefix}article_article\n                  WHERE\n                   `id_article`={$data['id_article']}";
     $this->model->dba->query($sql);
     // reorder node related article ranks
     $this->model->action('article', 'reorderRank', array('id_node' => (int) $row['id_node']));
 }
 /**
  * init variables for this view
  *
  */
 private function initVars()
 {
     $post_search = $this->httpRequest->getParameter('search', 'post', 'raw');
     $get_search = $this->httpRequest->getParameter('search', 'get', 'raw');
     if (!empty($post_search)) {
         $this->searchString = JapaCommonUtil::stripSlashes((string) $post_search);
         $this->pagerUrlSearchString = urlencode(JapaCommonUtil::stripSlashes((string) $post_search));
     } elseif (!empty($get_search)) {
         $this->searchString = urldecode(JapaCommonUtil::stripSlashes((string) $get_search));
         $this->pagerUrlSearchString = JapaCommonUtil::stripSlashes((string) $get_search);
     } else {
         $this->searchString = '';
         $this->pagerUrlSearchString = '';
     }
     // assign template variable with search string
     $this->viewVar['search'] =& $this->searchString;
     // template array variables
     $this->viewVar['articles'] = array();
     $this->viewVar['pager'] = '';
     // set articles limit per page
     $this->articlesPerPage = 15;
     $search_page = $this->httpRequest->getParameter('search_page', 'get', 'int');
     // get current article pager page
     if (!empty($search_page)) {
         $this->pageNumber = (int) $search_page;
         $this->viewVar['search_page'] = (int) $search_page;
         $this->model->session->set('article_page', (int) $search_page);
     } elseif (NULL !== ($search_page = $this->model->session->get('search_page'))) {
         $this->pageNumber = $search_page;
         $this->viewVar['search_page'] = $search_page;
     } else {
         $this->pageNumber = 1;
         $this->viewVar['search_page'] = 1;
         $this->model->session->set('search_page', 1);
     }
     // The url passed to the pager action
     $this->pagerUrl = $this->controllerVar['url_base'] . '/' . $this->viewVar['adminWebController'] . '/nodecoration/1/mod/article/cntr/search/search/' . $this->pagerUrlSearchString;
     $order = $this->httpRequest->getParameter('order', 'post', 'raw');
     $ordertype = $this->httpRequest->getParameter('ordertype', 'post', 'alpha');
     // set article order
     if (!empty($order)) {
         $this->order = array((string) $order, (string) $ordertype);
         $this->viewVar['order'] = (string) $order;
         $this->viewVar['ordertype'] = (string) $ordertype;
         $this->model->session->set('article_order', (string) $order);
         $this->model->session->set('ordertype', (string) $ordertype);
         $this->model->session->del('article_page');
     } elseif (NULL !== ($order = $this->model->session->get('article_order'))) {
         $ordertype = $this->model->session->get('ordertype');
         $this->order = array($order, $ordertype);
         $this->viewVar['order'] = $order;
         $this->viewVar['ordertype'] = (string) $ordertype;
     } else {
         $this->order = array($this->config->getModuleVar('article', 'default_order'), $this->config->getModuleVar('article', 'default_ordertype'));
         $this->viewVar['order'] = $this->config->getModuleVar('article', 'default_order');
         $this->viewVar['ordertype'] = $this->config->getModuleVar('article', 'default_ordertype');
         $this->model->session->set('article_order', $this->config->getModuleVar('article', 'default_order'));
         $this->model->session->set('ordertype', $this->config->getModuleVar('article', 'default_ordertype'));
     }
 }
 /**
  * add text
  * @return int id of new text
  */
 private function addText()
 {
     $title = trim($this->httpRequest->getParameter('title', 'post', 'raw'));
     if (empty($title)) {
         $this->viewVar['error'][] = 'Title is empty';
         return FALSE;
     }
     return $this->model->action('misc', 'addText', array('error' => &$this->viewVar['error'], 'fields' => array('title' => JapaCommonUtil::stripSlashes(strip_tags((string) $title)), 'status' => 1)));
 }
 /**
  * add new node
  *
  * @param int $id_parent parent node of the new node
  */
 private function addKeyword($id_parent)
 {
     $title = trim($this->httpRequest->getParameter('title', 'post', 'raw'));
     if (empty($title)) {
         $this->viewVar['error'] = 'Title is empty';
         return FALSE;
     }
     return $this->model->action('keyword', 'add', array('fields' => array('title' => JapaCommonUtil::stripSlashes((string) $title), 'id_parent' => (int) $id_parent, 'status' => 1)));
 }
 /**
  * remove empty navigation data directory
  *
  * @return bool
  */
 private function removeEmptyDirectory($id_node, &$media_folder)
 {
     $dir = JAPA_BASE_DIR . 'data/navigation/' . $media_folder;
     if (TRUE == $this->isDirEmpty($dir)) {
         // delete whole tree
         JapaCommonUtil::deleteDirTree($dir);
         // remove media_folder reference
         $this->model->action('navigation', 'updateNode', array('id_node' => (int) $id_node, 'fields' => array('media_folder' => '')));
     }
 }
 /**
  * remove empty user directory
  *
  */
 private function removeEmptyDirectory(&$media_folder, &$data)
 {
     $dir = JAPA_BASE_DIR . 'data/article/' . $media_folder;
     if (TRUE == $this->isDirEmpty($dir)) {
         // delete whole tree
         JapaCommonUtil::deleteDirTree($dir);
         // remove media_folder reference
         $this->model->action('article', 'updateArticle', array('id_article' => (int) $data['id_article'], 'error' => &$data['error'], 'fields' => array('media_folder' => '')));
     }
 }
 private function createNodeMediaFolder($id_node)
 {
     // create unique folder that dosent exists
     do {
         $folder = JapaCommonUtil::unique_crc32();
     } while (@is_dir(JAPA_BASE_DIR . 'data/navigation/' . $folder));
     if (!mkdir(JAPA_BASE_DIR . 'data/navigation/' . $folder, $this->model->config->getVar('media_folder_rights'))) {
         throw new JapaModelException('Cant create media folder: ' . $folder);
     }
     if (!mkdir(JAPA_BASE_DIR . 'data/navigation/' . $folder . '/thumb', $this->model->config->getVar('media_folder_rights'))) {
         throw new JapaModelException('Cant create media folder: ' . $folder . '/thumb');
     }
     $this->model->action('navigation', 'updateNode', array('error' => &$data['error'], 'id_node' => $id_node, 'fields' => array('media_folder' => $folder)));
     return $folder;
 }
 /**
  * createUserMediaFolder
  *
  * @param int $id_user 
  * @return string name of the media folder
  */
 private function createUserMediaFolder($id_user)
 {
     // create unique folder that dosent exists
     do {
         $folder = JapaCommonUtil::unique_crc32();
     } while (@is_dir(JAPA_BASE_DIR . 'data/user/' . $folder));
     if (!mkdir(JAPA_BASE_DIR . 'data/user/' . $folder, $this->config->getVar('media_folder_rights'))) {
         throw new JapaModelException('Cant create media folder: ' . $folder);
     }
     if (!mkdir(JAPA_BASE_DIR . 'data/user/' . $folder . '/thumb', $this->config->getVar('media_folder_rights'))) {
         throw new JapaModelException('Cant create media folder: ' . $folder . '/thumb');
     }
     $error = array();
     $this->model->action('user', 'update', array('error' => &$error, 'id_user' => $id_user, 'fields' => array('media_folder' => (string) $folder)));
     return $folder;
 }
 private function deleteText($id_text)
 {
     $sql = "DELETE FROM {$this->config->dbTablePrefix}misc_text_lock\n                  WHERE\n                   `id_text`={$id_text}";
     $this->model->dba->query($sql);
     $sql = "DELETE FROM {$this->config->dbTablePrefix}misc_text_pic\n                  WHERE\n                   `id_text`={$id_text}";
     $this->model->dba->query($sql);
     $sql = "DELETE FROM {$this->config->dbTablePrefix}misc_text_file\n                  WHERE\n                   `id_text`={$id_text}";
     $this->model->dba->query($sql);
     $sql = "SELECT `media_folder` FROM {$this->config->dbTablePrefix}misc_text\n                  WHERE\n                   `id_text`={$id_text}";
     $rs = $this->model->dba->query($sql);
     $row = $rs->fetchAssoc();
     if (isset($row['media_folder']) && !empty($row['media_folder'])) {
         // delete user data media folder
         JapaCommonUtil::deleteDirTree(JAPA_BASE_DIR . 'data/misc/' . $row['media_folder']);
     }
     $sql = "DELETE FROM {$this->config->dbTablePrefix}misc_text\n                  WHERE\n                   `id_text`={$id_text}";
     $this->model->dba->query($sql);
 }
 /**
  * add new node
  *
  * @param int $id_parent parent node of the new node
  */
 private function addNode($id_parent)
 {
     $title = trim($this->httpRequest->getParameter('title', 'post', 'raw'));
     if (empty($title)) {
         $this->viewVar['error'] = 'Title is empty';
         return FALSE;
     }
     // init id_controller
     $id_controller = 0;
     // get associated view of the parent node
     if ($id_parent != 0) {
         $tmp = array();
         // get current node data
         $this->model->action('navigation', 'getNode', array('result' => &$tmp, 'id_node' => (int) $id_parent, 'fields' => array('id_controller')));
         $id_controller = $tmp['id_controller'];
     }
     $new_id_node = $this->model->action('navigation', 'addNode', array('id_parent' => (int) $id_parent, 'fields' => array('title' => JapaCommonUtil::stripSlashes((string) $title), 'id_controller' => (int) $id_controller, 'status' => 1)));
     // update node related content view
     $this->model->broadcast('newNodeContentController', array('id_parent' => (int) $id_parent, 'id_node' => (int) $new_id_node));
     return $new_id_node;
 }
 /**
  * delete user
  *
  * @param array $data
  */
 function perform($data = FALSE)
 {
     $sql = "DELETE FROM {$this->config->dbTablePrefix}user_access\n                  WHERE\n                   `id_user`={$data['id_user']}";
     $this->model->dba->query($sql);
     $sql = "DELETE FROM {$this->config->dbTablePrefix}user_lock\n                  WHERE\n                   `id_user`={$data['id_user']}";
     $this->model->dba->query($sql);
     $sql = "DELETE FROM {$this->config->dbTablePrefix}user_media_pic\n                  WHERE\n                   `id_user`={$data['id_user']}";
     $this->model->dba->query($sql);
     $sql = "DELETE FROM {$this->config->dbTablePrefix}user_media_file\n                  WHERE\n                   `id_user`={$data['id_user']}";
     $this->model->dba->query($sql);
     $sql = "SELECT `media_folder` FROM {$this->config->dbTablePrefix}user_user\n                  WHERE\n                   `id_user`={$data['id_user']}";
     $rs = $this->model->dba->query($sql);
     $row = $rs->fetchAssoc();
     if (isset($row['media_folder']) && !empty($row['media_folder'])) {
         // delete user data media folder
         JapaCommonUtil::deleteDirTree(JAPA_BASE_DIR . 'data/user/' . $row['media_folder']);
     }
     $sql = "DELETE FROM {$this->config->dbTablePrefix}user_user\n                  WHERE\n                   `id_user`={$data['id_user']}";
     $this->model->dba->query($sql);
     // inform other modules that this user (id_user) was deleted
     $this->model->broadcast('deleteUser', array('id_user' => $data['id_user']));
     return TRUE;
 }
 /**
  * delete_dir_tree
  *
  * Delete directory and content recursive
  *
  * @param string $dir Directory
  */
 public static function deleteDirTree($dir)
 {
     if (($handle = @opendir($dir)) != FALSE) {
         while (($file = readdir($handle)) != false) {
             if ($file == "." || $file == "..") {
                 continue;
             }
             if (@is_dir($dir . '/' . $file)) {
                 JapaCommonUtil::deleteDirTree($dir . '/' . $file);
             } else {
                 if (@unlink($dir . '/' . $file) == FALSE) {
                     trigger_error("Can not delete content in dir tree: {$dir}/{$file}", E_USER_ERROR);
                 }
             }
         }
         @closedir($handle);
         if (@rmdir($dir) == FALSE) {
             trigger_error("Can not remvoe dir: {$dir}", E_USER_ERROR);
         }
     } else {
         trigger_error("Can not delete content dir: {$dir}", E_USER_ERROR);
     }
 }
 private function deleteNode($id_node)
 {
     $this->model->action('common', 'removeUrlRewrite', array('module' => 'navigation'));
     $sql = "DELETE FROM {$this->config->dbTablePrefix}navigation_node_lock\n                  WHERE\n                   `id_node`={$id_node}";
     $this->model->dba->query($sql);
     $sql = "DELETE FROM {$this->config->dbTablePrefix}navigation_media_pic\n                  WHERE\n                   `id_node`={$id_node}";
     $this->model->dba->query($sql);
     $sql = "DELETE FROM {$this->config->dbTablePrefix}navigation_media_file\n                  WHERE\n                   `id_node`={$id_node}";
     $this->model->dba->query($sql);
     $sql = "DELETE FROM {$this->config->dbTablePrefix}navigation_index\n                  WHERE\n                   `id_node`={$id_node}";
     $this->model->dba->query($sql);
     $sql = "SELECT `media_folder` FROM {$this->config->dbTablePrefix}navigation_node\n                  WHERE\n                   `id_node`={$id_node}";
     $rs = $this->model->dba->query($sql);
     $row = $rs->fetchAssoc();
     if (isset($row['media_folder']) && !empty($row['media_folder'])) {
         // delete user data media folder
         JapaCommonUtil::deleteDirTree(JAPA_BASE_DIR . 'data/navigation/' . $row['media_folder']);
     }
     $sql = "DELETE FROM {$this->config->dbTablePrefix}navigation_node\n                  WHERE\n                   `id_node`={$id_node}";
     $this->model->dba->query($sql);
     // delete all node related content
     $this->model->broadcast('deleteNodeRelatedContent', array('id_node' => (int) $id_node));
 }
 /**
  * remove empty user directory
  *
  * @return bool
  */
 private function removeEmptyDirectory()
 {
     $dir = JAPA_BASE_DIR . 'data/user/' . $this->mediaFolder;
     if (TRUE == $this->isDirEmpty($dir)) {
         // delete whole tree
         JapaCommonUtil::deleteDirTree($dir);
         $error = array();
         // remove media_folder reference
         $this->model->action('user', 'update', array('id_user' => (int) $this->idUser, 'error' => &$error, 'fields' => array('media_folder' => '')));
     }
 }
 /**
  * reset form data
  *
  */
 private function resetFormData($login_name)
 {
     $this->viewVar['login'] = $this->model->action('common', 'safeHtml', strip_tags(JapaCommonUtil::stripSlashes($login_name)));
 }
 /**
  * Update node data
  *
  * @param int $rank New rank
  */
 private function updateLink()
 {
     $fields = array('id_node' => (int) $this->current_id_node, 'status' => (int) $this->link_status, 'title' => JapaCommonUtil::stripSlashes((string) $this->link_title), 'description' => JapaCommonUtil::stripSlashes((string) $this->link_description), 'url' => JapaCommonUtil::stripSlashes((string) $this->link_url));
     $this->model->action('link', 'updateLink', array('id_link' => (int) $this->id_link, 'fields' => $fields));
 }
 /**
  * Update node data
  *
  * @param int $rank New rank
  */
 private function updateKeyword()
 {
     $this->key_status = $this->httpRequest->getParameter('status', 'post', 'int');
     $this->key_description = trim($this->httpRequest->getParameter('description', 'post', 'raw'));
     $this->old_status = $this->httpRequest->getParameter('old_status', 'post', 'digits');
     $fields = array('id_parent' => (int) $this->key_key_id_parent, 'status' => (int) $this->key_status, 'title' => JapaCommonUtil::stripSlashes((string) $this->key_title), 'description' => JapaCommonUtil::stripSlashes((string) $this->key_description));
     if ($this->key_was_moved == TRUE) {
         // get id_sector and status of the new parent node
         $new_parent_node_data = array();
         $this->model->action('keyword', 'getKeyword', array('id_key' => (int) $this->key_key_id_parent, 'result' => &$new_parent_node_data, 'fields' => array('status')));
         // only if the new parent node status = 1 (inactive)
         if ($new_parent_key_data['status'] == 1) {
             $fields['status'] = $new_parent_key_data['status'];
         }
         // updates id_sector and status of subnodes
         $this->model->action('keyword', 'updateSubKeywords', array('id_key' => (int) $this->current_id_key, 'fields' => array('status' => (int) $fields['status'])));
     } elseif ($this->old_status != $this->key_status) {
         // updates status of subnodes
         $this->model->action('keyword', 'updateSubKeywords', array('id_key' => (int) $this->current_id_key, 'fields' => array('status' => (int) $fields['status'])));
     }
     $this->model->action('keyword', 'update', array('id_key' => (int) $this->current_id_key, 'fields' => $fields));
 }
 /**
  * strip slashes from form fields
  *
  * @param array $var_array Associative array
  */
 private function stripSlashesArray(&$var_array)
 {
     $tmp_array = array();
     foreach ($var_array as $f) {
         //$tmp_array[] = preg_replace("/\"/","'",JapaCommonUtil::stripSlashes( $f ));
         $tmp_array[] = JapaCommonUtil::stripSlashes($f);
     }
     return $tmp_array;
 }
 /**
  * reset the form fields with old user data
  *
  * @access privat
  */
 private function resetFormData()
 {
     $this->viewVar['user']['role'] = $this->httpRequest->getParameter('role', 'post', 'int');
     $this->viewVar['user']['status'] = $this->httpRequest->getParameter('status', 'post', 'int');
     $canceledit = $this->httpRequest->getParameter('canceledit', 'post', 'digits');
     $deleteuser = $this->httpRequest->getParameter('deleteuser', 'post', 'digits');
     $uploadlogo = $this->httpRequest->getParameter('uploadlogo', 'post', 'alnum');
     $deletelogo = $this->httpRequest->getParameter('deletelogo', 'post', 'alnum');
     $uploadpicture = $this->httpRequest->getParameter('uploadpicture', 'post', 'alnum');
     $imageID2del = $this->httpRequest->getParameter('imageID2del', 'post', 'raw');
     $imageIDmoveUp = $this->httpRequest->getParameter('imageIDmoveUp', 'post', 'digits');
     $imageIDmoveDown = $this->httpRequest->getParameter('imageIDmoveDown', 'post', 'digits');
     $fileIDmoveUp = $this->httpRequest->getParameter('fileIDmoveUp', 'post', 'digits');
     $fileIDmoveDown = $this->httpRequest->getParameter('fileIDmoveDown', 'post', 'digits');
     $uploadfile = $this->httpRequest->getParameter('uploadfile', 'post', 'alnum');
     $fileID2del = $this->httpRequest->getParameter('fileID2del', 'post', 'digits');
     $pid = $this->httpRequest->getParameter('pid', 'post', 'raw');
     $fid = $this->httpRequest->getParameter('fid', 'post', 'raw');
     $this->viewVar['user']['email'] = $this->httpRequest->getParameter('email', 'post', 'raw');
     $this->viewVar['user']['login'] = $this->httpRequest->getParameter('login', 'post', 'alnum');
     $this->viewVar['user']['name'] = $this->httpRequest->getParameter('name', 'post', 'alnum');
     $this->viewVar['user']['passwd'] = $this->httpRequest->getParameter('passwd', 'post', 'alnum');
     $this->viewVar['user']['lastname'] = $this->httpRequest->getParameter('lastname', 'post', 'alnum');
     $this->viewVar['user']['description'] = JapaCommonUtil::stripSlashes($this->httpRequest->getParameter('description', 'post', 'raw'));
     $this->viewVar['user']['user_gmt'] = $this->httpRequest->getParameter('user_gmt', 'post', 'int');
 }
 /**
  * init some variables
  *
  */
 private function initVars()
 {
     $this->searchString = JapaCommonUtil::stripSlashes((string) $this->searchString);
     $this->pagerUrlSearchString = urlencode(JapaCommonUtil::stripSlashes((string) $this->searchString));
     // strip bad code
     $this->searchString = $this->model->action('common', 'safeHtml', strip_tags($this->searchString));
     // assign template variable with search string
     $this->viewVar['search'] = $this->searchString;
     $this->viewVar['formsearch'] = $this->searchString;
     // template array variables
     $this->viewVar['articles'] = array();
     $this->viewVar['pager'] = '';
     // set articles limit per page
     $this->articlesPerPage = 10;
     $search_page = (int) $this->httpRequest->getParameter('search_page', 'get', 'digits');
     // get current article pager page
     if ($search_page === false) {
         $this->pageNumber = 1;
     } else {
         $this->pageNumber = (int) $search_page;
     }
     // view vars
     $this->viewVar['charset'] = $this->config->getModuleVar('common', 'charset');
     $this->viewVar['loggedUserRole'] = $this->viewVar['loggedUserRole'];
     $this->viewVar['adminWebController'] = $this->config->getVar('default_module_application_controller');
     $this->viewVar['cssFolder'] = JAPA_PUBLIC_DIR . 'styles/' . $this->config->getModuleVar('common', 'styles_folder');
     $this->viewVar['urlBase'] = $this->router->getBase();
 }
 private function _reset_form_data($login_name)
 {
     $this->viewVar['login_name'] = htmlentities($this->strip(JapaCommonUtil::stripSlashes($login_name)));
 }
 /**
  * set article field values depended on the configuration settings
  *
  */
 private function addSetArticleFields(&$articleFields)
 {
     if ($this->config->getModuleVar('article', 'use_overtitle') == 1) {
         $overtitle = trim($this->httpRequest->getParameter('overtitle', 'post', 'raw'));
         $articleFields['overtitle'] = JapaCommonUtil::stripSlashes((string) $overtitle);
     }
     if ($this->config->getModuleVar('article', 'use_subtitle') == 1) {
         $subtitle = trim($this->httpRequest->getParameter('subtitle', 'post', 'raw'));
         $articleFields['subtitle'] = JapaCommonUtil::stripSlashes((string) $subtitle);
     }
     if ($this->config->getModuleVar('article', 'use_description') == 1) {
         $description = trim($this->httpRequest->getParameter('description', 'post', 'raw'));
         $articleFields['description'] = JapaCommonUtil::stripSlashes((string) $description);
     }
     if ($this->config->getModuleVar('article', 'use_header') == 1) {
         $header = trim($this->httpRequest->getParameter('header', 'post', 'raw'));
         $articleFields['header'] = JapaCommonUtil::stripSlashes((string) $header);
     }
     if ($this->config->getModuleVar('article', 'use_ps') == 1) {
         $ps = trim($this->httpRequest->getParameter('ps', 'post', 'raw'));
         $articleFields['ps'] = JapaCommonUtil::stripSlashes((string) $ps);
     }
 }
 /**
  * Rollback setup of each module
  *
  */
 private function rollback()
 {
     $data = array('superuser_passwd' => JapaCommonUtil::stripSlashes($this->syspassword), 'dbtablesprefix' => JapaCommonUtil::stripSlashes($this->dbtablesprefix), 'dbhost' => JapaCommonUtil::stripSlashes($this->dbhost), 'dbport' => JapaCommonUtil::stripSlashes($this->dbport), 'dbuser' => JapaCommonUtil::stripSlashes($this->dbuser), 'dbpasswd' => JapaCommonUtil::stripSlashes($this->dbpasswd), 'dbname' => JapaCommonUtil::stripSlashes($this->dbname), 'charset' => JapaCommonUtil::stripSlashes($this->charset), 'config' => &$this->controllerVar['setup_config'], 'rollback' => TRUE);
     $this->model->broadcast('setup', $data);
 }
 /**
  * Update text data
  *
  * @param int $rank New rank
  */
 private function updatetext($format)
 {
     $fields = array('status' => (int) $this->status, 'title' => JapaCommonUtil::stripSlashes(strip_tags((string) $this->title)), 'description' => JapaCommonUtil::stripSlashes((string) $this->description), 'body' => JapaCommonUtil::stripSlashes((string) $this->body));
     if ($format != FALSE) {
         $fields['format'] = $format;
     }
     $this->model->action('misc', 'updateText', array('id_text' => (int) $this->current_id_text, 'fields' => $fields));
 }
 /**
  * remove empty user directory
  *
  * @return bool
  */
 private function removeEmptyDirectory()
 {
     $dir = JAPA_BASE_DIR . 'data/misc/' . $this->mediaFolder;
     if (TRUE == $this->isDirEmpty($dir)) {
         // delete whole tree
         JapaCommonUtil::deleteDirTree($dir);
         // remove media_folder reference
         $this->model->action('misc', 'updateText', array('id_text' => (int) $this->idText, 'fields' => array('media_folder' => '')));
     }
 }
 /**
  * reset the form fields with old link data
  *
  * @access privat
  */
 private function resetFormData()
 {
     $this->viewVar['title'] = htmlspecialchars(JapaCommonUtil::stripSlashes((string) $this->title), ENT_COMPAT, $this->config->getModuleVar('common', 'charset'));
 }
 /**
  * reset the form fields with old link data
  *
  * @access privat
  */
 private function resetFormData()
 {
     $this->viewVar['status'] = JapaCommonUtil::stripSlashes($this->link_status);
     $this->viewVar['title'] = htmlspecialchars(JapaCommonUtil::stripSlashes($this->link_title), ENT_COMPAT, $this->config->getModuleVar('common', 'charset'));
     $this->viewVar['url'] = htmlspecialchars(JapaCommonUtil::stripSlashes($this->link_url), ENT_COMPAT, $this->config->getModuleVar('common', 'charset'));
     $this->viewVar['description'] = JapaCommonUtil::stripSlashes($this->link_description);
 }