function processPreview($request)
 {
     // Ticket Check
     if (!$GLOBALS['xoopsGTicket']->check(true, 'pico')) {
         redirect_header(XOOPS_URL . '/', 3, $GLOBALS['xoopsGTicket']->getErrors());
     }
     // initialize
     $cat_data = $this->currentCategoryObj->getData();
     $myts =& PicoTextSanitizer::getInstance();
     // assigning other than preview/request
     // parent::execute( $request ) ;
     // permission check (can_edit) done
     // request
     $request = pico_get_requests4content($this->mydirname, $errors = array(), $cat_data['post_auto_approved'], $cat_data['isadminormod'], $this->assign['content']['id']);
     $request['body_raw'] = $request['body'];
     $request['subject_raw'] = $request['subject'];
     $request4assign = array_map('htmlspecialchars_ent', $request);
     $this->assign['request'] = $request4assign;
     // override content data for edit
     $this->assign['content'] = $request4assign + $this->assign['content'];
     $this->assign['content']['filter_infos'] = pico_main_get_filter_infos($request['filters'], $cat_data['isadminormod']);
     $this->assign['content']['body_raw'] = $request['body'];
     $this->assign['content']['extra_fields'] = $request['extra_fields'];
     $this->assign['content']['ef'] = pico_common_unserialize($request['extra_fields']);
     // temporary $contentObj
     $tmpContentObj = new PicoContent($this->mydirname, 0, $this->currentCategoryObj, true);
     // preview
     $this->assign['preview'] = array('errors' => $errors, 'htmlheader' => $request['htmlheader'], 'subject' => $myts->makeTboxData4Show($request['subject'], 1, 1), 'body' => $tmpContentObj->filterBody($this->assign['content']));
 }
Example #2
0
 function getData4edit()
 {
     $mod_config = $this->categoryObj->getOverriddenModConfig();
     $cat_data = $this->categoryObj->getData();
     $ret4edit = array('vpath' => htmlspecialchars($this->data['vpath'], ENT_QUOTES), 'subject' => $this->data['approval'] == 0 && !$this->data['visible'] ? htmlspecialchars($this->data['subject_waiting'], ENT_QUOTES) : htmlspecialchars($this->data['subject'], ENT_QUOTES), 'subject_waiting' => htmlspecialchars($this->data['subject_waiting'], ENT_QUOTES), 'htmlheader' => htmlspecialchars($this->data['htmlheader'], ENT_QUOTES), 'htmlheader_waiting' => htmlspecialchars($this->data['htmlheader_waiting'], ENT_QUOTES), 'body' => htmlspecialchars($this->data['body'], ENT_QUOTES), 'body_waiting' => htmlspecialchars($this->data['body_waiting'], ENT_QUOTES), 'filters' => htmlspecialchars($this->data['filters'], ENT_QUOTES), 'filter_infos' => pico_main_get_filter_infos($this->data['filters'], $cat_data['isadminormod']), 'tags' => htmlspecialchars($this->data['tags'], ENT_QUOTES), 'modifier_uid' => is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0) + $this->getData4html();
     return $ret4edit;
 }