/** * Run script * */ public function run() { try { $content = $this->_factory->getModel('crawlerModel')->crawl($this->_args); //array of data to render $result = array(); $sortArr = array(); foreach ($content as $key => $data) { $time = $data['time']; Profiler::start($key); $renderData = TagCounterHelper::count($data['content'], 'img'); Profiler::stop($key); $time += Profiler::fetch($key); array_push($result, array($key, (int) $renderData['img'], $time)); array_push($sortArr, $renderData['img']); } array_multisort($sortArr, SORT_DESC, $result); if (!empty($result)) { array_unshift($result, $this->_tableHeaders); } ViewHelper::getRenderer()->process(array('grid' => $result)); } catch (Exception $e) { echo $e->getMessage(); } }
public static function flushMessage() { if (!empty($_SESSION['flash']['message'])) { $type = isset($_SESSION['flash']['type']) ? $_SESSION['flash']['type'] : 'warning'; ViewHelper::alertMessage($_SESSION['flash']['message'], $type); unset($_SESSION['flash']); } }
public function getImageUrl($id) { $obj = $this->_store->get($id); if ($obj != null) { return ViewHelper::link("data/" . $obj->getPath()); } return ViewHelper::assetLink("images/no_cover.png"); }
public function execute(Request $request, Response $response) { $userID = $request->getParameter("userID"); $state = $request->getParameter("state"); // Result data for AJAX response $result = array("id" => $request->getParameter("senderID"), "command" => "toggleCustomerAdmin"); if ($state == "true") { $GLOBALS["USERMANAGEMENT_DATA_ACCESS"]->setCustomerAdminRights($userID); $GLOBALS["USERMANAGEMENT_DATA_ACCESS"]->updateUserStatus($userID); } else { $GLOBALS["USERMANAGEMENT_DATA_ACCESS"]->removeCustomerAdminRights($userID); $GLOBALS["USERMANAGEMENT_DATA_ACCESS"]->updateUserStatus($userID); } $result["userid"] = $userID; $result["state"] = "ok"; $viewHelper = new ViewHelper(); $result["html"] = str_replace("</tr>", "", str_replace("<tr class=\"filter_user\" id=\"row[{$userID}]\">", "", $viewHelper->getEmployeeRow($userID, $GLOBALS["USERMANAGEMENT_DATA_ACCESS"]->getUserLogin($userID)))); return $result; }
public function execute() { $viewhelper = new ViewHelper(); $test = "H"; $hej = "då"; $viewhelper->assign('marke', 'Volvo'); $viewhelper->assign('modell', 'XC90'); $viewhelper->assign('pris', 235000); $viewhelper->assign('rabatteratPris', 235000 * 0.9); $viewhelper->assign('datum', date("Y-h-d")); $viewhelper->assign('bild', 'http://www.largus.fr/images/images/Volvo-XC-90-2014_1.jpg'); $viewhelper->display('./Variables.html'); }
public static function productsDetail() { $data = filter_input_array(INPUT_GET, self::getIdRules()); if (self::checkValues($data)) { $product = ProductsDB::get($data); $images = ImagesDB::getProdutAll(["izdelek_id" => $product["id"]]); echo ViewHelper::render("view/anonymous-products-detail.php", ["product" => $product, "images" => $images]); } else { ViewHelper::redirect(BASE_URL); } }
/** * @test */ public function getShortHTMLText() { // Sans ajouter de bouton... $fullText = "Mauris facilisis, erat sollicitudin porttitor imperdiet, {{LIRE_LA_SUITE}}nulla nibh ultrices quam"; $expected = "Mauris facilisis, erat sollicitudin porttitor imperdiet,"; $this->assertEquals($expected, h::trim(ViewHelper::getShortHTMLText($fullText, ''))); // Avec un bouton ajouté... $fullText = "Mauris facilisis, erat sollicitudin porttitor imperdiet, {{LIRE_LA_SUITE}}nulla nibh ultrices quam"; $buttonMore = ViewHelper::getButtonMore(); $expected = "Mauris facilisis, erat sollicitudin porttitor imperdiet, {$buttonMore}"; $this->assertEquals($expected, h::trim(ViewHelper::getShortHTMLText($fullText))); }
public static function edit() { $rules = self::getRules(); $rules["id"] = ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 1]]; $data = filter_input_array(INPUT_POST, $rules); if (self::checkValues($data)) { IgralecDB::update($data); echo ViewHelper::render("view/editor/main-editor.php"); } else { self::editForm($data); } }
public function execute(Request $request, Response $response) { // The user to (un)lock $userID = $request->getParameter("userID"); // Check if to lock or unlock $trashState = $request->getParameter("trashState"); $result = array("id" => $request->getParameter("senderID"), "command" => "trashRestoreUser"); // Lock user if ($trashState == "trash") { $GLOBALS["USERMANAGEMENT_DATA_ACCESS"]->trashUser($userID); $result["value"] = "trash"; } else { $GLOBALS["USERMANAGEMENT_DATA_ACCESS"]->restoreUser($userID); $result["value"] = "restore"; } $result["status"] = usermanangement::get_instance()->get_user_status_html($GLOBALS["USERMANAGEMENT_DATA_ACCESS"]->getUserLogin($userID)); $result["trashdate"] = $GLOBALS["USERMANAGEMENT_DATA_ACCESS"]->getTrashDate($userID); $result["state"] = "ok"; $viewHelper = new ViewHelper(); $result["html"] = str_replace("</tr>", "", str_replace("<tr class=\"filter_user\" id=\"row[{$userID}]\">", "", $viewHelper->getEmployeeRow($userID, $GLOBALS["USERMANAGEMENT_DATA_ACCESS"]->getUserLogin($userID)))); return $result; }
function videolink($key, $label, $data, &$list, $directory) { if (!isset($data[$key])) { return; } if ($key == 'youtube') { $list[] = ViewHelper::link('http://youtu.be/' . $data[$key], $label); } else { if ($key == 'vimeo') { $list[] = ViewHelper::link('https://vimeo.com/' . $data[$key], $label); } else { $list[] = ViewHelper::link('/' . BASE_PATH . 'data/' . $directory . '/trailers/' . $data[$key], $label); } } }
/** * getFilesOutput * @author Cornelius Hansjakob <*****@*****.**> * @version 1.0 */ public function getFilesOutput($rowset, $strFieldName, $strViewType) { $this->core->logger->debug('cms->views->helpers->PageHelper->getFilesOutput()'); $this->objViewHelper = new ViewHelper(); $strOutput = ''; foreach ($rowset as $row) { if ($strViewType != '' && $strViewType == $this->core->sysConfig->viewtypes->thumb) { if ($row->isImage) { if ($row->xDim < $row->yDim) { $strMediaSize = 'height="100"'; } else { $strMediaSize = 'width="100"'; } $strOutput .= '<div style="position: relative;" class="mediaitem" fileid="' . $row->id . '" id="' . $strFieldName . '_mediaitem_' . $row->id . '"> <table> <tbody> <tr> <td> <img src="' . sprintf($this->core->sysConfig->media->paths->thumb, $row->path) . $row->filename . '?v=' . $row->version . '" id="Img' . $row->id . '" ' . $strMediaSize . '/> </td> </tr> </tbody> </table> <div class="itemremovethumb" id="' . $strFieldName . '_remove' . $row->id . '" onclick="myForm.removeItem(\'' . $strFieldName . '\', \'' . $strFieldName . '_mediaitem_' . $row->id . '\', ' . $row->id . '); return false;"></div> </div>'; } } else { if ($row->isImage) { $strOutput .= '<div class="fileitem" fileid="' . $row->id . '" id="' . $strFieldName . '_fileitem_' . $row->id . '"> <div class="olfileleft"></div> <div class="itemremovelist" id="' . $strFieldName . '_remove' . $row->id . '" onclick="myForm.removeItem(\'' . $strFieldName . '\', \'' . $strFieldName . '_fileitem_' . $row->id . '\', ' . $row->id . '); return false;"></div> <div class="olfileitemicon"><img width="32" height="32" src="' . sprintf($this->core->sysConfig->media->paths->icon32, $row->path) . $row->filename . '?v=' . $row->version . '" id="File' . $row->id . '" alt="' . htmlentities($row->description, ENT_COMPAT, $this->core->sysConfig->encoding->default) . '"/></div> <div class="olfileitemtitle">' . htmlentities($row->title == '' && (isset($row->alternativTitle) || isset($row->fallbackTitle)) ? isset($row->alternativTitle) && $row->alternativTitle != '' ? $row->alternativTitle : $row->fallbackTitle : $row->title, ENT_COMPAT, $this->core->sysConfig->encoding->default) . '</div> <div class="clear"></div> </div>'; } else { $strOutput .= '<div class="fileitem" fileid="' . $row->id . '" id="' . $strFieldName . '_fileitem_' . $row->id . '"> <div class="olfileleft"></div> <div class="itemremovelist" id="' . $strFieldName . '_remove' . $row->id . '" onclick="myForm.removeItem(\'' . $strFieldName . '\', \'' . $strFieldName . '_fileitem_' . $row->id . '\', ' . $row->id . '); return false;"></div> <div class="olfileitemicon"><img width="32" height="32" src="' . $this->objViewHelper->getDocIcon($row->extension, 32) . '" id="File' . $row->id . '" alt="' . htmlentities($row->description, ENT_COMPAT, $this->core->sysConfig->encoding->default) . '"/></div> <div class="olfileitemtitle">' . htmlentities($row->title == '' && (isset($row->alternativTitle) || isset($row->fallbackTitle)) ? isset($row->alternativTitle) && $row->alternativTitle != '' ? $row->alternativTitle : $row->fallbackTitle : $row->title, ENT_COMPAT, $this->core->sysConfig->encoding->default) . '</div> <div class="clear"></div> </div>'; } } } return $strOutput . '<div id="divClear_' . $strFieldName . '" class="clear"></div>'; }
public static function delete() { $rules = ['delete_confirmation' => FILTER_REQUIRE_SCALAR, 'id' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 1]]]; $data = filter_input_array(INPUT_POST, $rules); if (self::checkValues($data)) { UporabnikDB::delete($data); $url = BASE_URL . "uporabnik"; } else { if (isset($data["id"])) { $url = BASE_URL . "uporabnik/edit?id=" . $data["id"]; } else { $url = BASE_URL . "uporabnik"; } } ViewHelper::redirect($url); }
/** * The View has been created. * * We need to give a reference to ourself to the View Helper. * * @access public */ public function __construct() { ViewHelper::$_view = $this; }
echo $string['oeditsummary']; ?> "> <tbody> <tr> <th><?php echo $string['type']; ?> </th> <td> <select id="display_method" name="display_method" class="sct-type"<?php echo $disabled; ?> > <?php echo ViewHelper::render_options($question->get_display_methods(), $question->get_display_method(), 3); ?> </select> </td> <th class="small"><?php echo $string['experts']; ?> </th> </tr> <?php $experts = range(0, 40); $index = 1; foreach ($question->options as $o_id => $option) { include 'options/opt_sct.php'; $index++; }
private function loadUtility() { ViewHelper::setConfig(self::$config); }
<link rel="stylesheet" href="/<?php echo BASE_PATH; ?> stylesheets/layout.css"> <link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css"> <!-- Favicons ================================================== --> <link rel="shortcut icon" href="/<?php echo BASE_PATH; ?> images/favicon.png"> <?php if (isset($presskit)) { ViewHelper::render('analytics', array('code' => $presskit->developer->analytics)); } ?> </head> <body> <!-- Primary Page Layout ================================================== --> <div class="container"> <?php if (sizeof(ErrorHelper::$errors)) { echo '<ul class="errors sixteen columns">'; foreach (ErrorHelper::$errors as $error) { echo '<li>', $error, '</li>'; } echo '</ul>';
?> <?php echo $form->textFieldGroup($model, 'postoperative_sleep_ahi', array('widgetOptions' => array('htmlOptions' => array('class' => 'span5', 'maxlength' => 255)))); ?> <?php echo $form->textFieldGroup($model, 'recovery_time', array('widgetOptions' => array('htmlOptions' => array('class' => 'span5')))); ?> <!-- 2015-12-29 create --> <?php echo $form->textAreaGroup($model, 'memo', array('widgetOptions' => array('htmlOptions' => array('rows' => 6, 'cols' => 50, 'class' => 'span8')))); ?> <?php echo $form->dropDownListGroup($model, 'is_surgical_priority', array('wrapperHtmlOptions' => array('class' => 'col-sm-5'), 'widgetOptions' => array('data' => ViewHelper::yesOrNotSelectOptions(), 'htmlOptions' => array('prompt' => '未選擇')))); ?> <?php echo $form->dropDownListGroup($model, 'is_outside_dentist', array('wrapperHtmlOptions' => array('class' => 'col-sm-5'), 'widgetOptions' => array('data' => ViewHelper::yesOrNotSelectOptions(), 'htmlOptions' => array('prompt' => '未選擇')))); ?> <div class="form-actions"> <?php $this->widget('booster.widgets.TbButton', array('buttonType' => 'submit', 'context' => 'primary', 'label' => $model->isNewRecord ? 'Create' : 'Save')); ?> </div> <?php $this->endWidget();
<dt>Social:</dt> <?php foreach ($data->socials as $social) { ?> <dd><?php echo ViewHelper::link($social['link'], $social['name']); ?> </dd> <?php } ?> <dt>Releases:</dt> <?php foreach ($data->games as $game) { ?> <dd><?php echo ViewHelper::linkProject($game->directory, $game->title); ?> </dd> <?php } ?> <dt>Phone:</dt> <dd><?php echo ViewHelper::callto($data->phone); ?> </dd> </dl> </div>
echo TextHelper::_('COBALT_COMPANIES_NAME'); ?> </th> <th class="contact"><?php echo ucwords(TextHelper::_('COBALT_CONTACT_DETAILS')); ?> </th> <th class="created" ><?php echo TextHelper::_('COBALT_COMPANIES_ADDED'); ?> </th> <th class="updated" ><?php echo TextHelper::_('COBALT_COMPANIES_UPDATED'); ?> </th> <th class="notes" > </th> </thead> <tbody id="list"> <?php $n = count($this->companies); for ($i = 0; $i < $n; $i++) { $company = $this->companies[$i]; $k = $i % 2; $cView = ViewHelper::getView('companies', 'entry', 'phtml'); $cView->company = $company; $cView->k = $k; echo $cView->render(); } ?> </tbody>
?> <div class="news"> <div class="header"> <div class="eventDate"><?php echo Yii::app()->format->date($data->news->event_date); ?> </div> <?php // NB : on indique le chemin complet au fragment _tags parce que cette vue peut être appelée en dehors // du module 'news' (par exemple : dans la page d'accueil du site) $this->renderPartial('news.views.news._tags', array('news' => $data)); ?> <div class="clear"></div> </div> <h2><?php echo CHtml::link(CHtml::encode($data->title), $newsUrl); ?> </h2> <hr/> <?php echo ViewHelper::getShortHTMLText($data->content, CHtml::link(Yii::t('NewsModule.msg', "Read the full news"), $newsUrl)); ?> <div class="clear" style="padding-bottom: 10px"> <?php // sert à garantir que le bas de l'image ne dépasse pas sur le bas de la cartouche quand le texte est court ?> </div> </div>
require_once 'details_common.php'; $disp_method_class = 'dichotomous-display'; require_once 'detail_parts/details_presentation.php'; ?> <tr> <th><label for="option_order"><?php echo $string['optionorder']; ?> </label></th> <td> <select id="option_order" name="option_order"<?php echo $disabled; ?> > <?php echo ViewHelper::render_options($question->get_option_orders(), $question->get_option_order(), 3); ?> </select> </td> </tr> </tbody> </table> <?php require_once 'detail_parts/details_marking.php'; require_once 'detail_parts/details_general_feedback.php'; ?> <div class="form"> <h2 class="midblue_header"><?php echo $string['options'];
<dt>Platforms:</dt> <?php if (isset($data->platforms)) { foreach ($data->platforms as $platform) { if (isset($platform['link'])) { echo '<dd>', ViewHelper::link($platform['link'], $platform['name']), '</dd>'; } else { echo '<dd>', $platform['name'], '</dd>'; } } } ?> <dt>Website:</dt> <dd><?php echo ViewHelper::link($data->website); ?> </dd> </dl> <?php if ($data->prices != null) { ?> <table class="prices"> <?php foreach ($data->prices as $key => $platform) { ?> <caption>Regular Price <?php echo $key != null ? '(' . $key . ')' : ''; ?> </caption>
<?php require 'php/viewhelper.php'; $helper = new ViewHelper(); $fields = array('name' => 'Please Enter A Valid Name (at least three letters)', 'email' => 'Please Enter A Valid Email Address', 'phone' => 'Please Enter A Valid Telephone Number (numbers, hyphens and spaces only)'); echo $helper->doctype(); ?> <html> <head> <?php echo $helper->stylesheet_link_tag('style'); ?> <?php echo $helper->js_include_tag('jquery'); ?> <?php echo $helper->js_include_tag('application'); ?> </head> <body> <div id='wrapper'> <h1>Test Form</h1> <form> <?php foreach ($fields as $field => $error) { ?> <?php echo $helper->label($field, ucwords($field));
?> " type="hidden" /> </td> <td class="small align-right"> <select id="option_correct<?php echo $index; ?> " name="option_correct<?php echo $index; ?> "<?php echo $disabled; ?> > <?php echo ViewHelper::render_options($experts, $option->get_correct(), 3); ?> </select> </td> </tr> <tr<?php echo $alt_c; ?> > <th class="spaced-bottom"><label for="option_correct_fback<?php echo $index; ?> "><?php echo $string['feedback']; ?> </label></th>
<?php echo ViewHelper::render_options($marks_partial, $mark_partial, 3); ?> </select> </span> <?php } if ($allow_neg or $mark_incorrect != 0) { ?> <label for="option_marks_incorrect" class="heavy"><?php echo $string['marksincorrect']; ?> </label> <select id="option_marks_incorrect" name="option_marks_incorrect"> <?php echo ViewHelper::render_options($marks_negative, $mark_incorrect, 3); ?> </select> <?php } else { ?> <input type="hidden" id="option_marks_incorrect" name="option_marks_incorrect" value="<?php echo $mark_incorrect; ?> " /> <?php } ?> </td> </tr> </tbody>
public static function orderCancelledDetail() { $rules = ["id" => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 1]]]; $data = filter_input_array(INPUT_POST, $rules); if ($data == null) { $data["id"] = $_SESSION["pid"]; } if (self::checkValues($data)) { $order = OrdersDB::get($data); echo ViewHelper::render("view/customer-order-detail-cancelled.php", ["order" => $order, "products" => OrdersDB::getOrderProducts(["narocilo_id" => $data["id"]]), "user" => UsersDB::get(["id" => $order["uporabnik_id"]])]); } else { ViewHelper::redirect(BASE_URL); } }
/** * getListView * @author Cornelius Hansjakob <*****@*****.**> * @version 1.0 */ public function getListView($rowset, $arrFileIds) { $this->core->logger->debug('cms->views->helpers->OverlayHelper->getListView()'); $this->objViewHelper = new ViewHelper(); /** * create header of list output */ $strOutputTop = ' <div> <div class="olfiletopleft"></div> <div class="olfiletopitemicon"></div> <div class="olfiletopitemtitle bold">Titel</div> <div class="olfiletopright"></div> <div class="clear"></div> </div>'; /** * output of list rows (elements) */ $strOutput = ''; $blnIsImageView = false; if (count($rowset) > 0) { $strOutput .= ' <div class="olfileitemcontainer">'; foreach ($rowset as $row) { $strHidden = ''; if (array_search($row->id, $arrFileIds) !== false) { $strHidden = ' style="display:none;"'; } if ($row->isImage) { $blnIsImageView = true; if ($row->xDim < $row->yDim) { $strMediaSize = 'height="32"'; } else { $strMediaSize = 'width="32"'; } $strOutput .= ' <div class="olfileitem" id="olFileItem' . $row->id . '" onclick="myOverlay.addItemToThumbArea(\'olFileItem' . $row->id . '\', ' . $row->id . '); return false;"' . $strHidden . '> <div class="olfileleft"></div> <div style="display:none;" id="Remove' . $row->id . '" class="itemremovelist"></div> <div class="olfileitemicon"><img ' . $strMediaSize . ' id="File' . $row->id . '" src="' . sprintf($this->core->sysConfig->media->paths->icon32, $row->path) . $row->filename . '?v=' . $row->version . '" alt="' . $row->description . '"/></div> <div class="olfileitemtitle">' . htmlentities($row->title == '' && (isset($row->alternativTitle) || isset($row->fallbackTitle)) ? isset($row->alternativTitle) && $row->alternativTitle != '' ? $row->alternativTitle : $row->fallbackTitle : $row->title, ENT_COMPAT, $this->core->sysConfig->encoding->default) . '</div> <div class="olfileright"></div> <div class="clear"></div> </div>'; } else { $strOutput .= ' <div class="olfileitem" id="olFileItem' . $row->id . '" onclick="myOverlay.addFileItemToListArea(\'olFileItem' . $row->id . '\', ' . $row->id . '); return false;"' . $strHidden . '> <div class="olfileleft"></div> <div style="display:none;" id="Remove' . $row->id . '" class="itemremovelist"></div> <div class="olfileitemicon"><img width="32" height="32" id="File' . $row->id . '" src="' . $this->objViewHelper->getDocIcon($row->extension, 32) . '" alt="' . $row->description . '"/></div> <div class="olfileitemtitle">' . htmlentities($row->title == '' && (isset($row->alternativTitle) || isset($row->fallbackTitle)) ? isset($row->alternativTitle) && $row->alternativTitle != '' ? $row->alternativTitle : $row->fallbackTitle : $row->title, ENT_COMPAT, $this->core->sysConfig->encoding->default) . '</div> <div class="olfileright"></div> <div class="clear"></div> </div>'; } } $strOutput .= ' <div class="clear"></div> </div>'; } /** * list footer */ $strOutputBottom = ' <div> <div class="olfilebottomleft"></div> <div class="olfilebottomcenter"></div> <div class="olfilebottomright"></div> <div class="clear"></div> </div>'; /** * return html output */ if ($strOutput != '') { if ($blnIsImageView) { return $strOutput . '<div class="clear"></div>'; } else { return $strOutputTop . $strOutput . $strOutputBottom . '<div class="clear"></div>'; } } }
?> </th> <th class="address" ><?php echo TextHelper::_('COBALT_ADDRESS'); ?> </th> <th class="added" ><?php echo TextHelper::_('COBALT_PEOPLE_ADDED'); ?> </th> <th class="updated" ><?php echo TextHelper::_('COBALT_PEOPLE_UPDATED'); ?> </th> </tr> </thead> <tbody id="list"> <?php $n = count($this->people); $k = 0; for ($i = 0; $i < $n; $i++) { $person = $this->people[$i]; $k = $i % 2; $pView = ViewHelper::getView('people', 'entry', 'phtml'); $pView->person = $person; $pView->k = $k; echo $pView->render(); } ?> </tbody>
echo $category['title']; ?> </a></li> <?php } ?> </ul> </div> <div class="widget"> <h4>Submit your event</h4> <p>Arranging an event that is not listed here? Let us know! We love to get the word out about events the community would be interested in.</p> <p style="text-align: center;"><a href="<?php ViewHelper::url('?page=add-event'); ?> " class="btn success">Submit your event!</a></p> </div> </div> </div> </div> <?php include_once 'footer.php';
?> > <?php echo ViewHelper::render_options($rows, $question->get_rows(), 3, false, '', '', " {$string['rows']}"); ?> </select> <label for="editor" class="heavy"><?php echo $string['editor']; ?> </label> <select id="editor" name="editor"<?php echo $disabled; ?> > <?php echo ViewHelper::render_options($editors, $editor, 3); ?> </select> </td> </tr> <?php require_once 'detail_parts/details_marking.php'; ?> </tbody> </table> <table id="q-options" class="form" summary="<?php echo $string['reminders']; ?> "> <?php