/** * Return a nested-list tree navigation of exhibit pages. * * @param Exhibit|null Exhibit to print the tree of. * @param ExhibitPage|null If given, indicates the "current" page which will * be marked by a CSS class in the output * @return string */ function exhibit_builder_page_tree($exhibit = null, $exhibitPage = null) { if (!$exhibit) { $exhibit = get_current_record('exhibit'); } return get_view()->exhibitPageTree($exhibit, $exhibitPage); }
/** * Renders and displays the multiview. */ public function render($data = null, $subview = false) { if ($data != null) { $this->data = $data; } else { $this->data = array(); } $this->data['layout'] = $this; $result = get_view($this->base_path . $this->view_name); $this->parse_includes($result); $this->parse_nestedcontrols_cdata($result); $this->data['_extracted_content'] = $this->_extracted_content; $result = render_fragment($result, $this->data); $this->parse_layout($result, $subview); $this->parse_subviews($result); $this->parse_other_tags($result); $this->parse_targets($result); $this->parse_uses($result); $this->parse_controls($result); $this->parse_nestedcontrols($result); if ($this->layout != null) { $this->layout->add_content($this->target, $result); $result = $this->layout->render($data); } return $result; }
/** * Queue editor templates. * * @param array $args Array of arguments, with `exhibit`. */ public function hookNeatlineEditorTemplates($args) { if ($args['exhibit']->hasWidget(self::ID)) { echo get_view()->partial('waypoints/editor/form.php'); echo get_view()->partial('waypoints/editor/list.php'); } }
/** * Adds theme assets to queues. * * - Modernizr * - Respond.js * - Selectivizr * - Google Fonts style sheet * - Theme style sheet */ function queue_theme_assets() { queue_js_file('modernizr.min'); queue_js_file(array('respond.min', 'selectivizr.min'), 'javascripts', array('conditional' => 'lt IE 9')); get_view()->headLink()->prependStylesheet('http://fonts.googleapis.com/css?family=Crimson+Text:400,600,400italic,600italic|Cabin:400,600,400italic', 'screen'); queue_css_file('style'); }
function editFieldHTML($textField, $view = false) { if (!$view) { $view = get_view(); } return $view->formInput($textField, null, array("type" => "text", "class" => "rangeSearchTextField", "size" => 4, "maxlength" => 10)); }
function get_tags_list() { $tags = get_the_tags(); if (empty($tags)) { return; } get_view('post-tags', '', compact('tags')); }
/** * Filter the element input. * * @param array $components * @param array $args * @return array */ public function filterElementInput($components, $args) { // Use the cached vocab terms instead of $terms = explode("\n", $this->_simpleVocabTerms[$args['element']->id]); $selectTerms = array('' => 'Select Below') + array_combine($terms, $terms); $components['input'] = get_view()->formSelect($args['input_name_stem'] . '[text]', $args['value'], array('style' => 'width: 300px;'), $selectTerms); $components['html_checkbox'] = false; return $components; }
public function getTaggingForm($record = null) { if (get_view()->isTaggingAllowed()) { require_once PLUGIN_DIR . '/Tagging/forms/TaggingForm.php'; $taggingSession = new Zend_Session_Namespace('tagging'); $form = new Tagging_TaggingForm($record); if ($taggingSession->post) { $form->isValid(unserialize($taggingSession->post)); } unset($taggingSession->post); return $form; } }
/** * Send "info.json" for the current file. * * @internal The info is managed by the MediaControler because it indicates * capabilities of the IXIF server for the request of a file. */ public function infoAction() { $id = $this->getParam('id'); if (empty($id)) { throw new Omeka_Controller_Exception_404(); } $record = get_record_by_id('File', $id); if (empty($record)) { throw new Omeka_Controller_Exception_404(); } $info = get_view()->iiifInfo($record, false); $this->_sendJson($info); }
/** * Performs the form. */ public function perform() { $params = $this->_options['params']; // TODO Check acl (see ItemsBatchEditAll.php). // TODO Add logs by item. $view = get_view(); try { $view->bulkEdit()->perform($params); } catch (Exception $e) { $message = __('An error occurred in background process.'); _log(__('Bulk Metadata Editor: %s', $message), Zend_Log::ERR); return false; } }
/** * Get a URL to the public contribution page. * * @param string $action Action to link to, main index if none. * @return string URL */ function contribution_contribute_url($actionName = null) { $path = get_option('contribution_page_path'); if (empty($path)) { $route = 'contributionDefault'; } else { $route = 'contributionCustom'; } $options = array(); if (!empty($actionName)) { $options['action'] = $actionName; } return get_view()->url($options, $route, array(), true); }
public function alternativeManifestAction() { $id = $this->getParam('id'); if (empty($id)) { throw new Omeka_Controller_Exception_404(); } $recordType = $this->getParam('recordtype'); $record = get_record_by_id(Inflector::classify($recordType), $id); if (empty($record)) { throw new Omeka_Controller_Exception_404(); } $manifest = get_view()->iiifManifest($record, false, true, $this->getParam('image')); $this->_sendJson($manifest); }
/** * Shows plugin configuration page. */ public function hookConfigForm($args) { $flash = Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger'); // Full Csv Import. if ($this->isFullCsvImport()) { $flash->addMessage(__('You are using full Csv Import, so all import formats will be available.'), 'success'); } else { $flash->addMessage(__('You are using standard Csv Import, so you will be able to import metadata of items only, not metadata of files.'), 'error'); } // Require external processor. if (!$this->isXsltSupported()) { $flash->addMessage(__('No xslt processor is installed, neither the php internal one, nor an external one.') . ' ' . __('You must install one and set its path below.'), 'error'); } $view = get_view(); echo $view->partial('plugins/xml-import-config-form.php'); }
public function setUp() { parent::setUp(); $this->_view = get_view(); $this->_view->addHelperPath(CLEAN_URL_DIR . '/views/helpers', self::PLUGIN_NAME . '_View_Helper_'); $pluginHelper = new Omeka_Test_Helper_Plugin(); $pluginHelper->setUp(self::PLUGIN_NAME); // Add constraints if derivatives have been added in the config file. $fileDerivatives = Zend_Registry::get('bootstrap')->getResource('Config')->fileDerivatives; if (!empty($fileDerivatives) && !empty($fileDerivatives->paths)) { foreach ($fileDerivatives->paths->toArray() as $type => $path) { set_option($type . '_constraint', 1); } } $this->_prepareRecords(); $this->_reloadRoutes(); }
protected function buildRSSHeaders() { $headers = array(); // How do we determine what title to give the RSS feed? $headers['title'] = option('site_title'); $headers['link'] = xml_escape(get_view()->serverUrl(isset($_SERVER['REQUEST_URI']))); $headers['lastUpdate'] = time(); $headers['charset'] = "UTF-8"; // Feed could have a description, where would it be stored ? // $headers['description'] = "" $headers['author'] = option('site_title'); $headers['email'] = option('administrator_email'); $headers['copyright'] = option('copyright'); //How do we determine how long a feed can be cached? //$headers['ttl'] = return $headers; }
public function correctAction() { $id = $this->getParam('id'); $correction = $this->_helper->db->getTable('CorrectionsCorrection')->find($id); $item = $correction->getItem(); $item->setReplaceElementTexts(false); $view = get_view(); $elTexts = $view->allElementTexts($correction, array('return_type' => 'array')); //the array just gives the text, not the array that goes into setting element texts $elTexts = $this->reformatElTexts($elTexts); $item->addElementTextsByArray($elTexts); $item->save(); $correction->status = 'accepted'; $correction->reviewed = date('Y-m-d H:i:s'); $correction->save(); $this->_helper->redirector->gotoUrl("items/show/{$correction->item_id}"); }
/** * Render the markup for an exhibit page. * * @param ExhibitPage|null $exhibitPage */ function exhibit_builder_render_exhibit_page($exhibitPage = null) { if ($exhibitPage === null) { $exhibitPage = get_current_record('exhibit_page'); } $blocks = $exhibitPage->ExhibitPageBlocks; $rawAttachments = $exhibitPage->getAllAttachments(); $attachments = array(); foreach ($rawAttachments as $attachment) { $attachments[$attachment->block_id][] = $attachment; } foreach ($blocks as $index => $block) { $layout = $block->getLayout(); echo '<div class="exhibit-block layout-' . html_escape($layout->id) . '">'; echo get_view()->partial($layout->getViewPartial(), array('index' => $index, 'options' => $block->getOptions(), 'text' => $block->text, 'attachments' => array_key_exists($block->id, $attachments) ? $attachments[$block->id] : array())); echo '</div>'; } }
public function filterElementInput($components, $args) { $view = get_view(); $element = $args['element']; $element_id = $element->id; $index = $args['index']; $name = "Elements[{$element_id}][{$index}][text]"; $id = "Elements-{$element_id}-{$index}-text"; $first_id = "{$id}-first"; $middle_id = "{$id}-middle"; $last_id = "{$id}-last"; $value = $args['value']; if ($value === '') { $value = '{"first":"Insert","middle":"Name","last":"Here"}'; } $m = json_decode($value, true); $pieces = array($m['first'], $m['middle'], $m['last']); $value = json_encode(array('first' => $m['first'], 'middle' => $m['middle'], 'last' => $m['last'])); $serial = implode(' ', $pieces); $components['input'] = <<<EOT <input type="hidden" name="{$view->escape($name)}" id="{$view->escape($id)}" data-type="name" data-first="{$view->escape($first_id)}" data-middle="{$view->escape($middle_id)}" data-last="{$view->escape($last_id)}" value="{$view->escape($value)}"/> <input type="text" id="{$view->escape($first_id)}" value="{$view->escape($m['first'])}" data-parent="{$view->escape($id)}"/> <input type="text" id="{$view->escape($middle_id)}" value="{$view->escape($m['middle'])}" data-parent="{$view->escape($id)}"/> <input type="text" id="{$view->escape($last_id)}" value="{$view->escape($m['last'])}" data-parent="{$view->escape($id)}"/> EOT; $components['html_checkbox'] = NULL; return $components; }
/** * Get a URL to a record. * * @package Omeka\Function\View\Navigation * @uses Omeka_View_Helper_RecordUrl::recordUrl() * @param Omeka_Record_AbstractRecord|string $record * @param string|null $action * @param bool $getAbsoluteUrl * @param array $queryParams * @return string */ function record_url($record, $action = null, $getAbsoluteUrl = false, $queryParams = array()) { return get_view()->recordUrl($record, $action, $getAbsoluteUrl, $queryParams); }
$total_total_fees = '<b class="text-danger">$' . number_format($total_total_fees, 2) . '</b>'; if ($account_balance < 0) { $account_balance = number_format($account_balance, 2); $account_balance = str_replace('-', '-$', $account_balance); $account_balance = '<b class="text-danger">' . $account_balance . '</b>'; } else { $account_balance = '<b class="text-success">$' . number_format($account_balance, 2) . '</b>'; } // ------------------------------------ if ($row['user_advisor1'] > 0) { $query2 = 'SELECT * FROM users_advisors WHERE users_advisors_id=' . ($row['user_advisor1'] + 0) . ' LIMIT 1'; $res2 = $db->rq($query2); $row2 = $db->fetch($res2); } else { $row2 = false; } if ($row['user_advisor2'] > 0 && $row['user_advisor1'] != $row['user_advisor2']) { $query2 = 'SELECT * FROM users_advisors WHERE users_advisors_id=' . ($row['user_advisor2'] + 0) . ' LIMIT 1'; $res2 = $db->rq($query2); $row3 = $db->fetch($res2); } else { $row3 = false; } $line_script = "<script type=\"text/javascript\">\n\tanalytics.identify('{$row['user_account_num']}', {\n\temail : '{$row['user_email']}',\n\tfirm : '{$row2['advisor_firm']}',\n\tname : '{$row['user_account_name']}'\n});\nanalytics.track('Signed In');\nanalytics.page('WP Login');\n</script>"; $active = 'index'; get_view('layouts/header', compact('username', 'PageTitle')); get_view('layouts/sidebar', compact('active')); get_view('index_view', compact('row3', 'row2', 'userTitles', 'row', 'total_trading2', 'total_funding2', 'total_total_fees', 'account_balance', 'total_purchase', 'total_sales', 'total_fees', 'total_trading', 'total_deposit', 'total_withdraw', 'total_fees2', 'total_funding')); get_view('layouts/right_sidebar'); get_view('layouts/footer', compact('line_script'));
<div class="field"> <div class="two columns alpha"> <label for="exhibit_builder_sort_browse"><?php echo __('Sorting Exhibits'); ?> </label> </div> <div class="inputs five columns omega"> <p class="explanation"> <?php echo __("The default method by which you wish to sort the listing of exhibits on the exhibits/browse page. Default is 'Date Added'."); ?> </p> <?php echo get_view()->formSelect('exhibit_builder_sort_browse', get_option('exhibit_builder_sort_browse'), null, array('added' => 'Date Added', 'alpha' => 'Alphabetical', 'recent' => 'Recent')); ?> </div> </div>
/** * Defines public routes "main_path / my_collection | generic / dc:identifier". * * @todo Rechecks performance of routes definition. */ public function hookDefineRoutes($args) { if (is_admin_theme() && !get_option('clean_url_use_admin')) { return; } $router = $args['router']; $mainPath = get_option('clean_url_main_path'); $collectionGeneric = get_option('clean_url_collection_generic'); $itemGeneric = get_option('clean_url_item_generic'); $fileGeneric = get_option('clean_url_file_generic'); $allowedForItems = unserialize(get_option('clean_url_item_alloweds')); $allowedForFiles = unserialize(get_option('clean_url_file_alloweds')); // Note: order of routes is important: Zend checks from the last one // (most specific) to the first one (most generic). // Get all collections identifiers with one query. $collectionsIdentifiers = get_view()->getRecordTypeIdentifiers('Collection', false); if (!empty($collectionsIdentifiers)) { // Use one regex for all collections. Default is case insensitve. $collectionsRegex = array_map('preg_quote', $collectionsIdentifiers); // To avoid a bug with identifiers that contain a "/", that is not // escaped with preg_quote(). $collectionsRegex = '(' . str_replace('/', '\\/', implode('|', $collectionsRegex)) . ')'; // Add a collection route. $route = $mainPath . $collectionGeneric; $router->addRoute('cleanUrl_collections', new Zend_Controller_Router_Route($route . ':record_identifier', array('module' => 'clean-url', 'controller' => 'index', 'action' => 'collection-show'), array('record_identifier' => $collectionsRegex))); // Add a collection route for files. if (in_array('collection', $allowedForFiles)) { $router->addRoute('cleanUrl_collections_file', new Zend_Controller_Router_Route($route . ':collection_identifier/:record_identifier', array('module' => 'clean-url', 'controller' => 'index', 'action' => 'route-collection-file'), array('collection_identifier' => $collectionsRegex))); } // Add a collection / item route for files. if (in_array('collection_item', $allowedForFiles)) { $router->addRoute('cleanUrl_collections_item_file', new Zend_Controller_Router_Route($route . ':collection_identifier/:item_identifier/:record_identifier', array('module' => 'clean-url', 'controller' => 'index', 'action' => 'route-collection-item-file'), array('collection_identifier' => $collectionsRegex))); } // Add a collection route for items. if (in_array('collection', $allowedForItems)) { $router->addRoute('cleanUrl_collections_item', new Zend_Controller_Router_Route($route . ':collection_identifier/:record_identifier', array('module' => 'clean-url', 'controller' => 'index', 'action' => 'route-collection-item'), array('collection_identifier' => $collectionsRegex))); } } // Add a generic route for files. if (in_array('generic', $allowedForFiles)) { $route = $mainPath . $fileGeneric; $router->addRoute('cleanUrl_generic_file', new Zend_Controller_Router_Route($route . ':record_identifier', array('module' => 'clean-url', 'controller' => 'index', 'action' => 'route-file', 'collection_id' => NULL))); } // Add a generic / item route for files. if (in_array('generic_item', $allowedForFiles)) { $route = $mainPath . $itemGeneric; $router->addRoute('cleanUrl_generic_item_file', new Zend_Controller_Router_Route($route . ':item_identifier/:record_identifier', array('module' => 'clean-url', 'controller' => 'index', 'action' => 'route-item-file', 'collection_id' => NULL))); } // Add a generic route for items. if (in_array('generic', $allowedForItems)) { $route = $mainPath . trim($itemGeneric, '/'); $router->addRoute('cleanUrl_generic_items_browse', new Zend_Controller_Router_Route($route, array('module' => 'clean-url', 'controller' => 'index', 'action' => 'items-browse'))); $router->addRoute('cleanUrl_generic_item', new Zend_Controller_Router_Route($route . '/:record_identifier', array('module' => 'clean-url', 'controller' => 'index', 'action' => 'route-item', 'collection_id' => NULL))); } }
if ($is_admin) { $is_ip_view = true; $ip = $write[wr_ip]; } else { // 관리자가 아니라면 IP 주소를 감춘후 보여줍니다. $ip = preg_replace("/([0-9]+).([0-9]+).([0-9]+).([0-9]+)/", "\\1.♡.\\3.\\4", $write[wr_ip]); } // 분류 사용 $is_category = false; $category_name = ""; if ($board[bo_use_category]) { $is_category = true; $category_name = $write[ca_name]; // 분류명 } $view = get_view($write, $board, $board_skin_path, 255); if (strstr($sfl, "subject")) { $view[subject] = search_font($stx, $view[subject]); } $html = 0; if (strstr($view[wr_option], "html1")) { $html = 1; } else { if (strstr($view[wr_option], "html2")) { $html = 2; } } $view[content] = conv_content($view[wr_content], $html); if (strstr($sfl, "content")) { $view[content] = search_font($stx, $view[content]); }
/** * Display the config form. */ public function hookConfigForm() { echo get_view()->partial('plugins/docs-viewer-config-form.php'); }
/** * Print out the COinS span on the admin items browse page. */ public function hookAdminItemsBrowseSimpleEach() { echo get_view()->coins(get_current_record('item')); }
<div class="field"> <div class="two columns alpha"> <label for="select2_css_selector"> <?php echo __('CSS Selector'); ?> </label> </div> <div class="inputs five columns omega"> <p class="explanation"> <?php echo __('Select2 will be applied to the following selectors. ' . 'Separate multiple selectors with comma.'); ?> </p> <?php echo get_view()->formTextarea('select2_css_selector', get_option('select2_css_selector'), null); ?> </div> </div>
<div class="field"> <div id="youtube-width-label" class="two columns alpha"> <label for="youtube_width"><?php echo __('Width'); ?> </label> </div> <div class="inputs five columns omega"> <?php echo get_view()->formText('youtube_width', get_option('youtube_width'), array()); ?> <p class = "explanation">Enter the default width for display of videos imported from Youtube</p> </div> </div> <div class="field"> <div id="youtube-height-label" class="two columns alpha"> <label for="youtube_height"><?php echo __('Height'); ?> </label> </div> <div class="inputs five columns omega"> <?php echo get_view()->formText('youtube_height', get_option('youtube_height'), array()); ?> <p class = "explanation">Enter the default height for display of videos imported from Youtube</p> </div> </div>
/** * Renders and displays the ajax view. */ public function render($data = null, $subview = false) { if ($data != null) { $this->data = $data; } else { $this->data = array(); } $result = get_view($this->base_path . $this->view_name); $this->parse_helpers($result); $result = render_fragment($result, $this->data); $this->parse_subviews($result); $this->parse_uses($result); $this->parse_controls($result); $this->parse_nestedcontrols($result); $this->parse_other_tags($result); return $result; }
/** * Form element for advanced search. */ function exhibit_builder_items_search() { $view = get_view(); $html = '<div class="field"><div class="two columns alpha">' . $view->formLabel('exhibit', __('Search by Exhibit')) . '</div><div class="five columns omega inputs">' . $view->formSelect('exhibit', @$_GET['exhibit'], array(), get_table_options('Exhibit')) . '</div></div>'; echo $html; }
<title><?php echo specialchars_replace($config['cf_title'] . ' > ' . $subj1 . ' > ' . $subj2); ?> </title> <link><?php echo specialchars_replace(G5_BBS_URL . '/board.php?bo_table=' . $bo_table); ?> </link> <description>테스트 버전 0.2 (2004-04-26)</description> <language>ko</language> <?php $sql = " select * from {$g5['write_prefix']}{$bo_table} where wr_is_comment = 0 and wr_option not like '%secret%' and as_shingo >= '0' order by wr_num, wr_reply limit 0, {$lines} "; $result = sql_query($sql); for ($i = 0; $row = sql_fetch_array($result); $i++) { $view = get_view($row, $board, $board_skin_path); if (strstr($view['wr_option'], 'html')) { $html = 1; } else { $html = 0; } $view['wr_content'] = conv_content($view['wr_content'], $html); $file = $head_file = $tail_file = ''; if ($view['as_img'] == "2") { // 본문삽입 $view['wr_content'] = preg_replace_callback("/{이미지\\:([0-9]+)[:]?([^}]*)}/i", "conv_rich_content", $view['wr_content']); } else { for ($i = 0; $i <= count($view['file']); $i++) { if ($view['file'][$i]['view']) { $file .= '<p>' . get_view_thumbnail($view['file'][$i]['view']) . '</p>'; }