function SetWikiparser($wiki = null, $preview = true) { $this->wikiparser = $wiki; $this->preview = $preview; // Generate preview for ajax? if ($preview && isset($_GET['input_wikitext_preview_field']) && $_GET['input_wikitext_preview_field'] == $this->name) { if (null === $this->wikiparser) { get_instance()->load->library('Wikiparser'); $parser = new Wikiparser(); } else { $parser =& $this->wikiparser; } if (isset($_POST['input_wikitext_preview'])) { $xml = $parser->parse($_POST['input_wikitext_preview']); } else { $xml = "POST input_wikitext_preview missing"; } header('content-type: text/xml'); ?> <<?php ?> ?xml version="1.0" encoding="UTF-8"?><?php ?> <wikitext><?php echo xml_escape($xml); ?> </wikitext><?php exit(0); } }
function __construct() { parent::__construct(); // Set the newline mode to line break. $this->newline_mode = 'br'; $this->enable_headings = false; $this->enable_youtube = false; $this->enable_mediaplayer = false; $this->enable_quickquotes = false; $this->enable_ordered_lists = false; unset($this->templates['pull_quote']); }
Session::logcheck("configuration-menu", "Osvdb"); $user = $_SESSION["_user"]; $id_document = GET('id_document') != "" ? GET('id_document') : (POST('id_document') != "" ? POST('id_document') : ""); $go_back = GET('go_back') ? 1 : 0; $options = GET('options') ? 1 : 0; if (!ossim_valid($id_document, OSS_DIGIT, 'illegal:' . _("id_document"))) { exit; } $db = new ossim_db(); $conn = $db->connect(); $document = Repository::get_document($conn, $id_document); $atch_list = Repository::get_attachments($conn, $id_document); $rel_list = Repository::get_relationships($conn, $id_document); $text = $document['text']; if (!empty($text)) { $wiki = new Wikiparser(); $text = $wiki->parse($text); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title> <?php echo gettext("OSSIM Framework"); ?> </title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/> <meta http-equiv="Pragma" CONTENT="no-cache"/> <?php
function __construct() { parent::__construct(); $this->multi_line = false; }
} if (!empty($level)) { $filters['level'] = $level; } /************************ ****** Pagination ****** ************************/ $pagination = array('page' => Util::calculate_pagination_page($from, $max_rows), 'page_rows' => $max_rows); /********************** ****** API Call ****** **********************/ // Call API to get status messages $status = new System_notifications(); list($message_list, $total_messages) = $status->get_status_messages($filters, $pagination); // Wiki Parser $wiki = new Wikiparser(); // Fill data array foreach ($message_list as $message) { $res = array(); $res['DT_RowId'] = $message['id']; $res['viewed'] = $message['viewed']; $res['description'] = $wiki->parse($message['message_description']); $res['actions'] = $wiki->parse($message['message_actions']); $res['alternative_actions'] = $wiki->parse($message['message_alternative_actions']); $res[] = $message['creation_time']; $res[] = $message['message_title'] . ($message['component_ip'] ? ' (' . $message['component_ip'] . ')' : ''); $res[] = $message['message_level']; $res[] = $message['message_type']; $res[] = ''; // Empty because this is for column actions that is managed in fnRowCallback $data[] = $res;
<?php // // Simple WikiRetriever usage example // require_once 'av_init.php'; Session::useractive(); $wiki = new Wikiparser(); $txt = POST('doctext'); if (!empty($txt)) { $output = $wiki->parse($txt); } echo $output;
Av_exception::throw_error(Av_exception::USER_ERROR, _('Error! Invalid Asset Type')); } $class_name = $asset_types[$_POST['asset_type']]; // Check Asset Permission if (method_exists($class_name, 'is_allowed') && !$class_name::is_allowed($conn, $asset_id)) { $error = sprintf(_('Error! %s is not allowed'), ucwords($asset_type)); Av_exception::throw_error(Av_exception::USER_ERROR, $error); } $asset_object = $class_name::get_object($conn, $asset_id); $filters = array('level' => 'error,warning,info', 'order_by' => 'message_level', 'only_unread' => 'true'); $pagination = array('page_rows' => 10, 'page' => 1); list($message_list, $total) = $asset_object->get_suggestions($filters, $pagination); } else { Av_exception::throw_error(Av_exception::USER_ERROR, _('Error retrieving information')); } } catch (Exception $e) { $db->close(); Util::response_bad_request($e->getMessage()); } // Wiki Parser $wiki = new Wikiparser(); //DATA $data = array(); foreach ($message_list as $msg) { $_res = array('component_id' => $msg['component_id'], 'component_ip' => $msg['component_ip'], 'component_name' => $msg['component_name'], 'component_type' => $msg['component_type'], 'creation_time' => $msg['creation_time'], 'id' => $msg['id'], 'message_action_role' => $msg['message_action_role'], 'message_actions' => $wiki->parse($msg['message_actions']), 'alternative_actions' => $wiki->parse($msg['message_alternative_actions']), 'message_description' => $wiki->parse($msg['message_description']), 'message_expire' => $msg['message_expire'], 'message_id' => $msg['message_id'], 'message_level' => $msg['message_level'], 'message_role' => $msg['message_role'], 'message_source' => $msg['message_source'], 'message_title' => $msg['message_title'], 'message_type' => $msg['message_type'], 'suppressed' => $msg['suppressed'], 'suppressed_time' => $msg['suppressed_time'], 'viewed' => $msg['viewed']); $data[] = $_res; } echo json_encode($data); $db->close(); /* End of file get_suggestions.php */ /* Location: /av_asset/common/providers/get_suggestions.php */
/** Update a tip * @param $values array('id'=>) * @return true if affected_rows != 0 */ function UpdateTip(&$values) { if (!isset($values['id'])) { return false; } $setters = array(); $bind = array(); if (isset($values['category_id'])) { $setters[] = '`crossword_tip_category_id`=?'; $bind[] = $values['category_id']; } if (isset($values['crossword_id'])) { $setters[] = '`crossword_tip_crossword_id`=?'; $bind[] = $values['crossword_id']; } if (isset($values['content_wikitext'])) { if (!isset($values['content_xhtml'])) { $this->load->library('Wikiparser'); $parser = new Wikiparser(); $values['content_xhtml'] = $parser->parse($values['content_wikitext']); } $setters[] = '`crossword_tip_content_wikitext`=?'; $bind[] = $values['content_wikitext']; $setters[] = '`crossword_tip_content_xml`=?'; $bind[] = $values['content_xhtml']; } if (empty($setters)) { return false; } $sql = 'UPDATE `crossword_tips` ' . 'SET ' . join(',', $setters) . ' ' . 'WHERE `crossword_tip_id`=?'; $bind[] = $values['id']; $this->db->query($sql, $bind); return $this->db->affected_rows() > 0; }