本文整理汇总了PHP中MUtil_Html::raw方法的典型用法代码示例。如果您正苦于以下问题:PHP MUtil_Html::raw方法的具体用法?PHP MUtil_Html::raw怎么用?PHP MUtil_Html::raw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MUtil_Html
的用法示例。
在下文中一共展示了MUtil_Html::raw方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getHtmlOutput
/**
* Copied from parent, but insert chart instead of table after commented out part
*
* @param \Zend_View_Abstract $view
* @return type
*/
public function getHtmlOutput(\Zend_View_Abstract $view)
{
$snippets = array();
$data = $this->getModel()->load();
// Find the first token with answers
foreach ($data as $tokenData) {
$token = $this->loader->getTracker()->getToken($tokenData)->refresh();
$tokenAnswers = $token->getRawAnswers();
if (!empty($tokenAnswers)) {
break;
}
}
// Some spacing with previous elements
$snippets[] = \MUtil_Html::create()->p(\MUtil_Html::raw(' '), array('style' => 'clear:both;'));
$config = $this->getConfig($token);
// Fallback to all score elements in one chart when no config found
if (!is_array($config)) {
$config = array();
foreach ($tokenAnswers as $key => $value) {
if (substr(strtolower($key), 0, 5) == 'score') {
$config[0]['question_code'][] = $key;
}
}
}
// Set the default options
$defaultOptions = array('data' => $data, 'showHeaders' => false, 'showButtons' => false);
// Add all configured charts
foreach ($config as $chartOptions) {
$chartOptions = $chartOptions + $defaultOptions;
$snippets[] = $this->loader->getSnippetLoader($this)->getSnippet('Survey_Display_BarChartSnippet', $chartOptions);
}
// Clear the floats
$snippets[] = \MUtil_Html::create()->p(array('class' => 'chartfooter'));
return $snippets;
}
示例2: addBrowseTableColumns
/**
* Adds columns from the model to the bridge that creates the browse table.
*
* Adds a button column to the model, if such a button exists in the model.
*
* @param \MUtil_Model_Bridge_TableBridge $bridge
* @param \MUtil_Model_ModelAbstract $model
* @rturn void
*/
protected function addBrowseTableColumns(\MUtil_Model_Bridge_TableBridge $bridge, \MUtil_Model_ModelAbstract $model)
{
$model->setIfExists('gr2o_opened', 'tableDisplay', 'small');
$model->setIfExists('grs_email', 'formatFunction', array('MUtil_Html_AElement', 'ifmail'));
if ($menuItem = $this->findAllowedMenuItem('show')) {
$bridge->addItemLink($menuItem->toActionLinkLower($this->getRequest(), $bridge));
}
// Newline placeholder
$br = \MUtil_Html::create('br');
// Display separator and phone sign only if phone exist.
$phonesep = $bridge->itemIf($bridge->grs_phone_1, \MUtil_Html::raw('☏ '));
$citysep = $bridge->itemIf($bridge->grs_zipcode, \MUtil_Html::raw(' '));
if ($this->currentUser->hasPrivilege('pr.respondent.multiorg')) {
$bridge->addMultiSort('gr2o_patient_nr', $br, 'gor_name');
//, \MUtil_Html::raw(' '), 'gr2o_opened');
} else {
$bridge->addMultiSort('gr2o_patient_nr', $br, 'gr2o_opened');
}
$bridge->addMultiSort('name', $br, 'grs_email');
$bridge->addMultiSort('grs_address_1', $br, 'grs_zipcode', $citysep, 'grs_city');
$bridge->addMultiSort('grs_birthday', $br, $phonesep, 'grs_phone_1');
if ($menuItem = $this->findAllowedMenuItem('edit')) {
$bridge->addItemLink($menuItem->toActionLinkLower($this->getRequest(), $bridge));
}
}
示例3: getBrowseColumns
/**
* Set column usage to use for the browser.
*
* Must be an array of arrays containing the input for TableBridge->setMultisort()
*
* @return array or false
*/
public function getBrowseColumns()
{
// Newline placeholder
$br = \MUtil_Html::create('br');
$sp = \MUtil_Html::raw(' ');
$columns[10] = array('glo_name', $br, 'glo_organizations');
$columns[20] = array('glo_url', $br, 'glo_url_route');
$columns[30] = array('glo_address_1', $br, 'glo_zipcode', \MUtil_Html::raw(' '), 'glo_city');
$columns[40] = array(\MUtil_Html::raw('☏ '), 'glo_phone_1', $br, 'glo_filter', $sp, 'glo_match_to');
return $columns;
}
示例4: addBrowseTableColumns
/**
* Adds columns from the model to the bridge that creates the browse table.
*
* Overrule this function to add different columns to the browse table, without
* having to recode the core table building code.
*
* @param \MUtil_Model_Bridge_TableBridge $bridge
* @param \MUtil_Model_ModelAbstract $model
* @return void
*/
protected function addBrowseTableColumns(\MUtil_Model_Bridge_TableBridge $bridge, \MUtil_Model_ModelAbstract $model)
{
$bridge->gr2o_id_organization;
if ($menuItem = $this->menu->find(array('controller' => 'appointment', 'action' => 'show', 'allowed' => true))) {
$appButton = $menuItem->toActionLink($this->request, $bridge, $this->_('Show appointment'));
} else {
$appButton = null;
}
if ($menuItem = $this->menu->find(array('controller' => 'respondent', 'action' => 'show', 'allowed' => true))) {
$respButton = $menuItem->toActionLink($this->request, $bridge, $this->_('Show respondent'));
} else {
$respButton = null;
}
$br = \MUtil_Html::create('br');
$sp = \MUtil_Html::raw(' ');
$table = $bridge->getTable();
$table->appendAttrib('class', 'calendar');
$table->tbody()->getFirst(true)->appendAttrib('class', $bridge->row_class);
// Row with dates and patient data
$table->tr(array('onlyWhenChanged' => true, 'class' => 'date'));
$bridge->addSortable('date_only', $this->_('Date'), array('class' => 'date'))->colspan = 4;
// Row with dates and patient data
$bridge->tr(array('onlyWhenChanged' => true, 'class' => 'time middleAlign'));
$td = $bridge->addSortable('gap_admission_time');
$td->append(' ');
$td->img()->src = 'stopwatch.png';
$td->title = $bridge->date_only;
// Add title, to make sure row displays when time is same as time for previous day
$bridge->addSortable('gor_name');
$bridge->addSortable('glo_name')->colspan = 2;
$bridge->tr()->class = array('odd', $bridge->row_class);
$bridge->addColumn($appButton)->class = 'middleAlign';
$bridge->addMultiSort('gr2o_patient_nr', $sp, 'gap_subject', $br, 'name');
// $bridge->addColumn(array($bridge->gr2o_patient_nr, $br, $bridge->name));
$bridge->addMultiSort(array($this->_('With')), array(' '), 'gas_name', $br, 'gaa_name', array(' '), 'gapr_name');
// $bridge->addColumn(array($bridge->gaa_name, $br, $bridge->gapr_name));
$bridge->addColumn($respButton)->class = 'middleAlign rightAlign';
unset($table[\MUtil_Html_TableElement::THEAD]);
}
示例5: addBrowseTableColumns
/**
* Adds columns from the model to the bridge that creates the browse table.
*
* Overrule this function to add different columns to the browse table, without
* having to recode the core table building code.
*
* @param \MUtil_Model_Bridge_TableBridge $bridge
* @param \MUtil_Model_ModelAbstract $model
* @return void
*/
protected function addBrowseTableColumns(\MUtil_Model_Bridge_TableBridge $bridge, \MUtil_Model_ModelAbstract $model)
{
if ($model->has('row_class')) {
$bridge->getTable()->tbody()->getFirst(true)->appendAttrib('class', $bridge->row_class);
}
if ($this->showMenu) {
$showMenuItems = $this->getShowMenuItems();
foreach ($showMenuItems as $menuItem) {
$bridge->addItemLink($menuItem->toActionLinkLower($this->request, $bridge));
}
}
// Newline placeholder
$br = \MUtil_Html::create('br');
$by = \MUtil_Html::raw($this->_(' / '));
$sp = \MUtil_Html::raw(' ');
// make sure search results are highlighted
$this->applyTextMarker();
$bridge->addMultiSort('grco_created', $br, 'gr2o_patient_nr', $sp, 'respondent_name', $br, 'grco_address', $br, 'gtr_track_name');
$bridge->addMultiSort('grco_id_token', $br, 'assigned_by', $br, 'grco_sender', $br, 'gsu_survey_name');
$bridge->addMultiSort('status', $by, 'filler', $br, 'grco_topic');
if ($this->showMenu) {
$items = $this->findMenuItems('track', 'show');
$links = array();
$params = array('gto_id_token' => $bridge->gto_id_token, \Gems_Model::ID_TYPE => 'token');
$title = \MUtil_Html::create('strong', $this->_('+'));
foreach ($items as $item) {
if ($item instanceof \Gems_Menu_SubMenuItem) {
$bridge->addItemLink($item->toActionLinkLower($this->request, $params, $title));
}
}
}
$bridge->getTable()->appendAttrib('class', 'compliance');
$tbody = $bridge->tbody();
$td = $tbody[0][0];
$td->appendAttrib('class', \MUtil_Lazy::method($this->util->getTokenData(), 'getStatusClass', $bridge->getLazy('status')));
}
示例6: getTrackEngineList
/**
* Returns all registered track engines classes for use in drop down lists.
*
* @param boolean $extended When true return a longer name.
* @param boolean $userCreatableOnly Return only the classes that can be created by the user interface
* @return array Of classname => description
*/
public function getTrackEngineList($extended = false, $userCreatableOnly = false)
{
$results = array();
$dummyTrackData['gtr_id_track'] = 0;
foreach ($this->getTrackEngineClasses() as $className => $cls) {
if (!$userCreatableOnly || $cls->isUserCreatable()) {
if ($extended) {
$results[$className] = \MUtil_Html::raw(sprintf('<strong>%s</strong> %s', $cls->getName(), $cls->getDescription()));
} else {
$results[$className] = $cls->getName();
}
}
}
return $results;
}
示例7: addBrowseColumn4
/**
* Add first columns (group) from the model to the bridge that creates the browse table.
*
* You can actually add more than one column in this function, but just call all four functions
* with the default columns in each
*
* Overrule this function to add different columns to the browse table, without
* having to recode the core table building code.
*
* @param \MUtil_Model_Bridge_TableBridge $bridge
* @param \MUtil_Model_ModelAbstract $model
* @return void
*/
protected function addBrowseColumn4(\MUtil_Model_Bridge_TableBridge $bridge, \MUtil_Model_ModelAbstract $model)
{
$br = \MUtil_Html::create('br');
// Display separator and phone sign only if phone exist.
$phonesep = \MUtil_Html::raw('☏ ');
// $bridge->itemIf($bridge->grs_phone_1, \MUtil_Html::raw('☏ '));
$bridge->addMultiSort('grs_birthday', $br, $phonesep, 'grs_phone_1');
}
示例8: addRespondentCell
/**
* As this is a common cell setting, this function allows you to overrule it.
*
* @param \MUtil_Model_Bridge_TableBridge $bridge
* @param \MUtil_Model_ModelAbstract $model
*/
protected function addRespondentCell(\MUtil_Model_Bridge_TableBridge $bridge, \MUtil_Model_ModelAbstract $model)
{
$bridge->addMultiSort('gr2o_patient_nr', \MUtil_Html::raw('; '), 'respondent_name');
}
示例9: getBrowseColumns
/**
* Set column usage to use for the browser.
*
* Must be an array of arrays containing the input for TableBridge->setMultisort()
*
* @return array or false
*/
public function getBrowseColumns()
{
$br = \MUtil_Html::create('br');
$output[10] = array('gsu_survey_name', $br, 'gsu_survey_description');
$output[20] = array('gsu_surveyor_active', \MUtil_Html::raw($this->_(' [')), 'gso_source_name', \MUtil_Html::raw($this->_(']')), $br, 'gsu_status_show', $br, 'gsu_insertable');
$output[30] = array('gsu_active', \MUtil_Html::raw(' '), 'track_count', $br, 'gsu_id_primary_group');
$output[40] = array('gsu_code', $br, 'gsu_export_code');
return $output;
}
示例10: renderElement
/**
* Function to allow overloading of tag rendering only
*
* Renders the element tag with it's content into a html string
*
* The $view is used to correctly encode and escape the output
*
* @param \Zend_View_Abstract $view
* @return string Correctly encoded and escaped html output
*/
protected function renderElement(\Zend_View_Abstract $view)
{
$this->_currentContent = array();
// If the label was assigned an element lazy,
// now is the time to get it's value.
foreach ($this->_content as $key => $value) {
if ($value instanceof \MUtil_Lazy_LazyInterface) {
$value = \MUtil_Lazy::rise($value);
}
if ($value instanceof \Zend_Form_Element) {
if ($value instanceof \Zend_Form_Element_Hidden) {
return null;
}
// Only a label when a label decorator exists, but we do not use that decorator
$decorator = $value->getDecorator('Label');
if ($decorator) {
if (false === $decorator->getOption('escape')) {
$label = \MUtil_Html::raw($value->getLabel());
} else {
$label = $value->getLabel();
}
$class = $this->class ? \MUtil_Html::renderAny($view, $this->class) . ' ' : '';
if ($value->isRequired()) {
$class .= $this->getRequiredClass();
$this->_currentContent[$key] = array($this->getRequiredPrefix(), $label, $this->getRequiredPostfix());
} else {
$class .= $this->getOptionalClass();
$this->_currentContent[$key] = array($this->getOptionalPrefix(), $label, $this->getOptionalPostfix());
}
parent::__set('class', $class);
// Bypass existing property for drawing
if ($id = $value->getId()) {
parent::__set('for', $id);
// Always overrule
} else {
parent::__unset('for');
}
}
} elseif ($value instanceof \Zend_Form_DisplayGroup) {
return null;
} else {
$this->_currentContent[$key] = $value;
}
}
return parent::renderElement($view);
}
示例11: oneLine
public static function oneLine($line)
{
if (strlen($line) > 2) {
if ($p = strpos($line, '<', 1)) {
$line = substr($line, 0, $p);
}
if ($p = strpos($line, "\n", 1)) {
$line = substr($line, 0, $p);
}
}
return \MUtil_Html::raw(trim($line));
}
示例12: getBrowseColumns
/**
* Set column usage to use for the browser.
*
* Must be an array of arrays containing the input for TableBridge->setMultisort()
*
* @return array or false
*/
public function getBrowseColumns()
{
$model = $this->getModel();
$model->setIfExists('gr2o_opened', 'tableDisplay', 'small');
$model->setIfExists('grs_email', 'formatFunction', array('MUtil_Html_AElement', 'ifmail'));
// Newline placeholder
$br = \MUtil_Html::create('br');
// Display separator and phone sign only if phone exist.
$phonesep = \MUtil_Html::raw('☏ ');
// $bridge->itemIf($bridge->grs_phone_1, \MUtil_Html::raw('☏ '));
$citysep = \MUtil_Html::raw(' ');
// $bridge->itemIf($bridge->grs_zipcode, \MUtil_Html::raw(' '));
$filter = $this->getSearchFilter(true);
if (isset($filter[\MUtil_Model::REQUEST_ID2])) {
$column2 = 'gr2o_opened';
} else {
$column2 = 'gr2o_id_organization';
}
if (isset($filter['grc_success']) && !$filter['grc_success']) {
$model->set('grc_description', 'label', $this->_('Rejection code'));
$column2 = 'grc_description';
}
$columns[10] = array('gr2o_patient_nr', $br, $column2);
$columns[20] = array('name', $br, 'grs_email');
$columns[30] = array('grs_address_1', $br, 'grs_zipcode', $citysep, 'grs_city');
$columns[40] = array('grs_birthday', $br, $phonesep, 'grs_phone_1');
return $columns;
}
示例13: getMenuList
/**
* overrule to add your own buttons.
*
* @return \Gems_Menu_MenuList
*/
protected function getMenuList()
{
$links = $this->menu->getMenuList();
$links->addParameterSources($this->request, $this->menu->getParameterSource());
$source = new \Gems_Menu_ParameterSource(array('gro_id_track' => $this->trackId, 'gro_id_round' => $this->trackEngine->getPreviousRoundId($this->roundId)));
$links->append($this->menu->getCurrent()->toActionLink(true, \MUtil_Html::raw($this->_('< Previous')), $source));
$links->addCurrentParent($this->_('Cancel'));
$links->addCurrentChildren();
$links->addCurrentSiblings();
$source->offsetSet('gro_id_round', $this->trackEngine->getNextRoundId($this->roundId));
$links->append($this->menu->getCurrent()->toActionLink(true, \MUtil_Html::raw($this->_('Next >')), $source));
return $links;
}
示例14: getSourceList
/**
* Returns the source choices in an array.
*
* @param boolean $validAfter True if it concerns _valid_after_ dates
* @param boolean $firstRound List for first round
* @param boolean $detailed Return extended info
* @return array source_name => label
*/
protected function getSourceList($validAfter, $firstRound, $detailed = true)
{
if (!($validAfter || $this->project->isValidUntilRequired())) {
$results[self::NO_TABLE] = array($this->_('Does not expire'));
}
if (!($validAfter && $firstRound)) {
$results[self::ANSWER_TABLE] = array($this->_('Answers'), $this->_('Use an answer from a survey.'));
}
if ($this->_fieldsDefinition->hasAppointmentFields()) {
$results[self::APPOINTMENT_TABLE] = array($this->_('Appointment'), $this->_('Use an appointment linked to this track.'));
}
if (!($validAfter && $firstRound)) {
$results[self::TOKEN_TABLE] = array($this->_('Token'), $this->_('Use a standard token date.'));
}
$results[self::RESPONDENT_TRACK_TABLE] = array($this->_('Track'), $this->_('Use a track level date.'));
if ($detailed) {
foreach ($results as $key => $value) {
if (is_array($value)) {
$results[$key] = \MUtil_Html::raw(sprintf('<strong>%s</strong> %s', reset($value), next($value)));
}
}
} else {
foreach ($results as $key => $value) {
if (is_array($value)) {
$results[$key] = reset($value);
}
}
}
return $results;
}
示例15: applyToModel
/**
* Applies the fieldmap data to the model
*
* @param \MUtil_Model_ModelAbstract $model
*/
public function applyToModel(\MUtil_Model_ModelAbstract $model)
{
$map = $this->_getMap();
$oldfld = null;
$parent = null;
foreach ($map as $name => $field) {
$tmpres = array();
$tmpres['thClass'] = \Gems_Tracker_SurveyModel::CLASS_MAIN_QUESTION;
$tmpres['group'] = $field['gid'];
$tmpres['type'] = $this->_getType($field);
$tmpres['survey_question'] = true;
if ($tmpres['type'] === \MUtil_Model::TYPE_DATE) {
$tmpres['storageFormat'] = 'yyyy-MM-dd';
$tmpres['dateFormat'] = 'dd MMMM yyyy';
// $tmpres['formatFunction']
}
if ($tmpres['type'] === \MUtil_Model::TYPE_DATETIME) {
$tmpres['storageFormat'] = 'yyyy-MM-dd HH:mm:ss';
$tmpres['dateFormat'] = 'dd MMMM yyyy HH:mm';
// $tmpres['formatFunction']
}
if ($tmpres['type'] === \MUtil_Model::TYPE_TIME) {
$tmpres['storageFormat'] = 'yyyy-MM-dd HH:mm:ss';
$tmpres['dateFormat'] = 'HH:mm:ss';
// $tmpres['formatFunction']
}
// \MUtil_Echo::track($field);
$oldQuestion = isset($oldfld['question']) ? $oldfld['question'] : null;
if (isset($field['question']) && (!isset($oldfld) || $oldQuestion !== $field['question'])) {
$tmpres['label'] = \MUtil_Html::raw($this->removeMarkup($field['question']));
}
if (isset($field['help']) && $field['help']) {
$tmpres['description'] = \MUtil_Html::raw($this->removeMarkup($field['help']));
}
// Juggle the labels for sub-questions etc..
if (isset($field['sq_question'])) {
if (isset($tmpres['label'])) {
// Add non answered question for grouping and make it the current parent
//$parent = '_' . $name . '_';
$parent = $field['title'];
$model->set($parent, $tmpres);
$model->set($parent, 'type', \MUtil_Model::TYPE_NOVALUE);
}
if (isset($field['sq_question1'])) {
$tmpres['label'] = \MUtil_Html::raw(sprintf($this->translate->_('%s: %s'), $this->removeMarkup($field['sq_question']), $this->removeMarkup($field['sq_question1'])));
} else {
$tmpres['label'] = \MUtil_Html::raw($this->removeMarkup($field['sq_question']));
}
$tmpres['thClass'] = \Gems_Tracker_SurveyModel::CLASS_SUB_QUESTION;
}
if ($options = $this->_getMultiOptions($field)) {
$tmpres['multiOptions'] = $options;
}
// Code does not have to be unique. So if a title is used
// twice we only use it for the first result.
if (isset($field['code']) && !$model->has($field['code'])) {
$name = $field['code'];
}
// Parent storage
if (\Gems_Tracker_SurveyModel::CLASS_MAIN_QUESTION === $tmpres['thClass']) {
$parent = $name;
} elseif ($parent) {
// Add the name of the parent item
$tmpres['parent_question'] = $parent;
}
$model->set($name, $tmpres);
$oldfld = $field;
}
}