本文整理汇总了PHP中html::message方法的典型用法代码示例。如果您正苦于以下问题:PHP html::message方法的具体用法?PHP html::message怎么用?PHP html::message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类html
的用法示例。
在下文中一共展示了html::message方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: excluir
public function excluir($id)
{
$processo = ORM::Factory('processo', $id);
if ($processo->procedimentos->count()) {
$conteudo = '<h1>Excluir Processo</h1>';
$texto = 'Para remover este processo, é necessário move/remover todos os procedimentos vinculados a ele.<br>';
$texto .= html::anchor('processos/formulario/' . $processo->id, 'Ver o formulário deste processo');
$conteudo = $conteudo . html::message($texto, 'Atenção', 'erro');
$this->template->content = $conteudo;
} else {
$processo->delete();
html::flash_message('Processo excluído com sucesso!', 'success');
url::redirect('processos/');
}
}
示例2: excluir
public function excluir($id)
{
$esfera = ORM::Factory('esfera', $id);
if ($esfera->orgaos->count()) {
$conteudo = '<h1>Excluir esfera</h1>';
$texto = 'Para remover esta esfera, é necessário remover seus orgãos primeiro.<br>';
$texto .= html::anchor('esferas/formulario/' . $esfera->id, 'Voltar a esfera: ' . $esfera->nome);
$conteudo = $conteudo . html::message($texto, 'Atenção', 'erro');
$this->template->content = $conteudo;
} else {
$esfera->delete();
html::flash_message('Esfera excluída com sucesso!', 'success');
url::redirect('esferas/');
}
}
示例3: excluir
public function excluir($id)
{
$grupo = ORM::Factory('grupo_procedimento', $id);
if ($grupo->tipo_procedimentos->count()) {
$conteudo = '<h1>Excluir Grupo de Procedimentos</h1>';
$texto = 'Para remover este grupo de procedimentos, é necessário remover seus tipos de procedimentos primeiro.<br>';
$texto .= html::anchor('grupo_procedimentos/formulario/' . $grupo->id, 'Voltar ao Grupo: ' . $grupo->nome);
$conteudo = $conteudo . html::message($texto, 'Atenção', 'erro');
$this->template->content = $conteudo;
} else {
$grupo->delete();
html::flash_message('Grupo de procedimentos excluído com sucesso!', 'success');
url::redirect('grupo_procedimentos/');
}
}
示例4: excluir
public function excluir($id)
{
$advogado = ORM::Factory('advogado', $id);
if ($advogado->procedimentos->count()) {
$conteudo = '<h1>Excluir Advogado</h1>';
$texto = 'Para remover este advogado, é necessário move/remover todos os procedimentos que ele é responsável.<br>';
$texto .= html::anchor('advogados/', 'Voltar a lista de Advogados');
$conteudo = $conteudo . html::message($texto, 'Atenção', 'erro');
$this->template->content = $conteudo;
} else {
$advogado->delete();
html::flash_message('Advogado excluído com sucesso!', 'success');
url::redirect('advogados/');
}
}
示例5: excluir
public function excluir($id)
{
$pessoa = ORM::Factory('pessoa', $id);
if ($pessoa->processos()->count()) {
$conteudo = '<h1>Excluir Pessoa</h1>';
$texto = 'Para remover esta pessoa, é necessário remover todos os processos que ela faz parte.<br>';
$texto .= html::anchor('pessoas/', 'Voltar a lista de Pessoas');
$conteudo = $conteudo . html::message($texto, 'Atenção', 'erro');
$this->template->content = $conteudo;
} else {
$pessoa->delete();
html::flash_message('Pessoa excluída com sucesso!', 'success');
url::redirect('pessoas/');
}
}
示例6: excluir
public function excluir($id)
{
$grupo = ORM::Factory('grupo_acesso', $id);
if ($grupo->usuarios->count()) {
$conteudo = '<h1>Excluir Grupo de Acesso</h1>';
$texto = 'Para remover este Grupo de Acesso, é necessário remover/mover todos seus usuários primeiro.<br>';
$texto .= html::anchor('grupo_acessos', 'Voltar a lista de Grupos de Acesso');
$conteudo = $conteudo . html::message($texto, 'Atenção', 'erro');
$this->template->content = $conteudo;
} else {
$nome = $grupo->nome;
$grupo->delete();
html::flash_message('Grupo de Acesso <b>' . $nome . '</b> excluído com sucesso!', 'success');
url::redirect('grupo_acessos');
}
}
示例7: excluir
public function excluir($id)
{
$gaveta = ORM::Factory('gaveta', $id);
if ($gaveta->processos->count()) {
$conteudo = '<h1>Excluir gaveta</h1>';
$texto = 'Para remover esta gaveta, é necessário remover/mover seus processos primeiro.<br>';
$texto .= html::anchor('armarios/formulario/' . $gaveta->armario->id, 'Voltar ao Armário: ' . $gaveta->armario->nome);
$conteudo = $conteudo . html::message($texto, 'Atenção', 'erro');
$this->template->content = $conteudo;
} else {
$armario = $gaveta->armario->id;
$gaveta->delete();
html::flash_message('Gaveta excluída com sucesso!', 'success');
url::redirect('armarios/formulario/' . $armario);
}
}
示例8: excluir
public function excluir($id)
{
$orgao = ORM::Factory('orgao', $id);
if ($orgao->processos->count()) {
$conteudo = '<h1>Excluir orgão</h1>';
$texto = 'Para remover esta orgão, é necessário remover/mover seus processos primeiro.<br>';
$texto .= html::anchor('orgaos/formulario/' . $orgao->id, 'Voltar ao Orgão: ' . $orgao->nome);
$conteudo = $conteudo . html::message($texto, 'Atenção', 'erro');
$this->template->content = $conteudo;
} else {
$esfera = $orgao->esfera->id;
$orgao->delete();
html::flash_message('Orgão excluído com sucesso!', 'success');
url::redirect('esferas/formulario/' . $esfera);
}
}
示例9: excluir
public function excluir($armario_id)
{
$armario = ORM::Factory('armario', $armario_id);
//verifica se tem gavetas
if ($armario->gavetas->count()) {
$conteudo = '<h1>Excluir armário</h1>';
$texto = 'Para remover este armário, é necessário remover suas gavetas primeiro.<br>';
$texto .= html::anchor('armarios/formulario/' . $armario->id, 'Voltar ao Armário: ' . $armario->nome);
$conteudo = $conteudo . html::message($texto, 'Atenção', 'erro');
$this->template->content = $conteudo;
} else {
$armario->delete();
html::flash_message('Armário excluído com sucesso!', 'success');
url::redirect('armarios/');
}
}
示例10: array
});
</script>
<div class="clear"></div>
<?php
if ($esfera->id) {
echo '<h2>Orgãos' . html::anchor('orgaos/formulario/0/' . $esfera->id, '[ Adicionar Orgão]') . '</h2>';
if ($esfera->orgaos->count()) {
$caption = $esfera->orgaos->count() . ' Orgãos encontradas';
$headers = array('Nome', 'Processos', 'Ações');
$headers['sizes'] = array(300, FALSE, 200);
$footers = FALSE;
$lines = array();
foreach ($esfera->orgaos as $orgao) {
$col = array();
$col[] = $orgao->nome;
$col[] = $orgao->processos->count();
$action_links = html::anchor('orgaos/formulario/' . $orgao->id, 'Vizualizar', array('class' => 'view'));
$title = 'Tem certeza que deseja excluir ' . $orgao->nome . '?';
$action_links .= html::anchor('orgaos/excluir/' . $orgao->id, 'Excluir', array('class' => 'delete', 'title' => $title));
$col[] = $action_links;
$lines[] = $col;
}
echo html::grid($headers, $lines, $footers, $caption);
} else {
$texto = 'Não existem Orgãos para esta esfera.';
echo html::message($texto, FALSE);
}
}
?>
示例11: action_names
/**
* Names action
*/
public function action_names()
{
$input = request::input();
// legend
echo self::render_topic('names');
// code naming conventions
echo html::a(['name' => 'code']);
echo '<h3>Naming Conventions: Code</h3>';
echo object_name_code::explain(null, ['html' => true]);
// testing form
echo html::a(['name' => 'code_test']);
echo '<h3>Test name</h3>';
if (!empty($input['submit_yes'])) {
$result = object_name_code::check($input['type'] ?? null, $input['name'] ?? null);
if (!$result['success']) {
echo html::message(['options' => $result['error'], 'type' => 'danger']);
} else {
echo html::message(['options' => 'Name is good!', 'type' => 'success']);
}
}
$ms = 'Name: ' . html::input(['name' => 'name', 'value' => $input['name'] ?? null]) . ' ';
$ms .= 'Type: ' . html::select(['name' => 'type', 'options' => object_name_code::$types, 'value' => $input['type'] ?? null]) . ' ';
$ms .= html::submit(['name' => 'submit_yes']);
echo html::form(['name' => 'code', 'action' => '#code_test', 'value' => $ms]);
// database naming convention
echo '<br/><br/><hr/>';
echo html::a(['name' => 'db']);
echo '<h3>Naming Conventions: Database</h3>';
echo object_name_db::explain(null, ['html' => true]);
// testing form
echo html::a(['name' => 'db_test']);
echo '<h3>Test name</h3>';
if (!empty($input['submit_yes2'])) {
$result = object_name_db::check($input['type2'] ?? null, $input['name2'] ?? null);
if (!$result['success']) {
echo html::message(['options' => $result['error'], 'type' => 'danger']);
} else {
echo html::message(['options' => 'Name is good!', 'type' => 'success']);
}
}
$ms = 'Name: ' . html::input(['name' => 'name2', 'value' => $input['name2'] ?? null]) . ' ';
$ms .= 'Type: ' . html::select(['name' => 'type2', 'options' => object_name_db::$types, 'value' => $input['type2'] ?? null]) . ' ';
$ms .= html::submit(['name' => 'submit_yes2']);
echo html::form(['name' => 'db', 'action' => '#db_test', 'value' => $ms]);
}
示例12: render_container_type_details_rows
/**
* Details - render table
*
* @param array $rows
* @param array $values
* @param array $options
*/
public function render_container_type_details_rows($rows, $values, $options = [])
{
$result = '';
// empty_warning_message
if (empty($options['details_new_rows']) && empty($values) && isset($options['details_empty_warning_message'])) {
if (empty($options['details_empty_warning_message'])) {
return html::message(['type' => 'warning', 'options' => [object_content_messages::no_rows_found]]);
} else {
return html::message(['type' => 'warning', 'options' => [$options['details_empty_warning_message']]]);
}
}
// building table
$table = ['header' => ['row_number' => '', 'row_data' => '', 'row_delete' => ''], 'options' => [], 'skip_header' => true];
if (!empty($options['details_11'])) {
$table['class'] = 'table grid_table_details_11';
$table['header'] = ['row_data' => ''];
}
// header rows for table
if ($options['details_rendering_type'] == 'table') {
foreach ($rows as $k => $v) {
array_key_sort($v['elements'], ['order' => SORT_ASC]);
// group by
$groupped = [];
foreach ($v['elements'] as $k2 => $v2) {
$groupped[$v2['options']['label_name'] ?? ''][$k2] = $v2;
}
foreach ($groupped as $k2 => $v2) {
$first = current($v2);
$first_key = key($v2);
foreach ($v2 as $k3 => $v3) {
// hidden row
if ($k === $this::hidden && !application::get('flag.numbers.frontend.html.form.show_field_settings')) {
$v3['options']['row_class'] = ($v3['options']['row_class'] ?? '') . ' grid_row_hidden';
}
$data['options'][$k][$k2][$k3] = ['label' => $this->render_element_name($first), 'options' => $v3['options'], 'row_class' => $v3['options']['row_class'] ?? null];
}
}
}
// add a row to a table
$table['options']['__header'] = ['row_number' => ['value' => ' ', 'width' => '1%'], 'row_data' => ['value' => html::grid($data), 'width' => !empty($options['details_11']) ? '100%' : '98%'], 'row_delete' => ['value' => ' ', 'width' => '1%']];
}
// we must sort
array_key_sort($rows, ['order' => SORT_ASC]);
// generating rows
$row_number = 1;
// 1 to 1
if (!empty($options['details_11'])) {
$max_rows = 1;
$processing_values = 1;
} else {
$max_rows = count($values) + ($options['details_new_rows'] ?? 0);
$processing_values = !empty($values);
}
do {
// we exit if there's no rows and if we have no values
if ($row_number > $max_rows) {
break;
}
// render
$data = ['options' => []];
// grab next element from an array
if ($processing_values) {
if (!empty($options['details_11'])) {
$k0 = null;
$v0 = $values;
} else {
$k0 = key($values);
$v0 = current($values);
}
} else {
$k0 = $row_number;
$v0 = [];
}
$i0 = $row_number;
// we need to preset default values
if (!empty($options['details_parent_key'])) {
$fields = $this->sort_fields_for_processing($this->detail_fields[$options['details_parent_key']]['subdetails'][$options['details_key']]['elements'], $this->detail_fields[$options['details_parent_key']]['subdetails'][$options['details_key']]['options']);
} else {
$fields = $this->sort_fields_for_processing($this->detail_fields[$options['details_key']]['elements'], $this->detail_fields[$options['details_key']]['options']);
}
// todo: handle changed field
foreach ($fields as $k19 => $v19) {
if (array_key_exists('default', $v19['options']) && !isset($v0[$k19])) {
$temp = $this->process_default_value($k19, $v19['options']['default'], $v0[$k19] ?? null, $v0, true);
}
}
// looping though rows
foreach ($rows as $k => $v) {
// row_id
if (empty($options['details_parent_key'])) {
$row_id = "form_{$this->form_link}_details_{$options['details_key']}_{$row_number}_row";
} else {
$row_id = "form_{$this->form_link}_subdetails_{$options['details_parent_key']}_{$options['__parent_row_number']}_{$options['details_key']}_{$row_number}_row";
//.........这里部分代码省略.........
示例13: render
/**
* Render widget
*
* @return mixed
*/
public function render()
{
$result = '';
// action bar
$result .= '<div style="text-align: right;">';
$result .= html::a(array('value' => html::icon(['type' => 'comment']) . ' ' . i18n(null, 'New'), 'href' => 'javascript:void(0);', 'onclick' => "numbers.frontend_form.trigger_submit('#form_numbers_frontend_html_widgets_comments_model_form_comment_form', false, true); numbers.modal.show('widgets_comments_{$this->widget_link}_comment');"));
$result .= '</div>';
$result .= '<hr class="simple" />';
// form
$pk = http_build_query2($this->options['pk']);
$js = <<<TTT
\t\t\tvar mask_id = 'widgets_comments_{$this->widget_link}_mask';
\t\t\t\$.ajax({
\t\t\t\turl: numbers.controller_full,
\t\t\t\tmethod: 'post',
\t\t\t\tdata: '__ajax=1&__ajax_form_id=widgets_comments_{$this->widget_link}_list&{$pk}',
\t\t\t\tdataType: 'json',
\t\t\t\tsuccess: function (data) {
\t\t\t\t\tif (data.success) {
\t\t\t\t\t\t\$('#widgets_comments_{$this->widget_link}_wrapper').html(data.html);
\t\t\t\t\t\teval(data.js);
\t\t\t\t\t\t// remove mask after 100 miliseconds to let js to take affect
\t\t\t\t\t\tsetTimeout(function() {
\t\t\t\t\t\t\t\$('#' + mask_id).unmask();
\t\t\t\t\t\t\t// we need to trigger resize to redraw a screen
\t\t\t\t\t\t\t\$(window).trigger('resize');
\t\t\t\t\t\t}, 100);
\t\t\t\t\t}
\t\t\t\t}
\t\t\t});
TTT;
$form = new numbers_frontend_html_widgets_comments_model_form_comment(['input' => $this->options['input'], 'no_actions' => true, 'bypass_hidden_values' => $this->options['pk'], 'other' => ['model' => $this->options['model'], 'pk' => $this->options['pk'], 'map' => $this->options['map']], 'on_success_js' => "numbers.modal.hide('widgets_comments_{$this->widget_link}_comment');" . $js]);
$body = $form->render();
$footer = html::button2(['name' => 'submit_comment', 'value' => i18n(null, 'Submit'), 'type' => 'primary', 'onclick' => "numbers.frontend_form.trigger_submit('#form_numbers_frontend_html_widgets_comments_model_form_comment_form', true); return false;"]);
$result .= html::modal(['id' => "widgets_comments_{$this->widget_link}_comment", 'class' => 'large', 'title' => i18n(null, 'Add Comment'), 'body' => $body, 'footer' => $footer]);
// list of comments in descending order
$where = [];
foreach ($this->options['map'] as $k => $v) {
$where[$v] = $this->options['pk'][$k];
}
$datasource = new numbers_frontend_html_widgets_comments_model_datasource_comments();
$data = $datasource->get(['model' => $this->options['model'], 'where' => $where]);
if (!empty($data)) {
$table = ['header' => ['id' => ['value' => '#', 'width' => '1%'], 'inserted' => ['value' => i18n(null, 'Date & Time'), 'width' => '1%', 'nowrap' => true], 'important' => ['value' => i18n(null, 'Important'), 'width' => '1%'], 'em_entity_name' => ['value' => i18n(null, 'Entity'), 'width' => '10%'], 'comment_value' => i18n(null, 'Comment')], 'options' => []];
$row_number = 1;
foreach ($data as $k => $v) {
// we need to hide old comments
$row_style = '';
if ($row_number > 10) {
$row_style = 'display: none;';
}
$table['options'][$v['id']] = ['id' => ['value' => $row_number . '.', 'row_style' => $row_style, 'row_class' => "widgets_comments_{$this->widget_link}_list_hiden " . ($v['important'] ? 'success' : null)], 'inserted' => format::datetime($v['inserted']), 'important' => ['value' => $v['important'] ? i18n(null, 'Yes') : ''], 'em_entity_name' => ['value' => $v['em_entity_name'], 'width' => '10%', 'nowrap' => true], 'comment_value' => nl2br($v['comment_value'])];
$row_number++;
}
$result_list = html::table($table);
// link to show all rows
$total_comments = count($data);
if ($total_comments > 10) {
$result_list .= '<div style="text-align: right;">' . html::a(['href' => 'javascript:void(0);', 'value' => i18n(null, '[count] comment(s) are hidden. Show all comments.', ['replace' => ['[count]' => $total_comments - 10]]), 'onclick' => "\$('.widgets_comments_{$this->widget_link}_list_hiden').show(); \$(this).hide();"]) . '</div>';
}
} else {
$result_list = html::message(['type' => 'warning', 'options' => [i18n(null, object_content_messages::no_rows_found)]]);
}
// if we are making an ajax call
if (!empty($this->options['input']['__ajax']) && ($this->options['input']['__ajax_form_id'] ?? '') == "widgets_comments_{$this->widget_link}_list") {
layout::render_as(['success' => true, 'error' => [], 'html' => $result_list, 'js' => ''], 'application/json');
}
// load mask
numbers_frontend_media_libraries_loadmask_base::add();
// put list into result
$result .= "<div id=\"widgets_comments_{$this->widget_link}_mask\"><div id=\"widgets_comments_{$this->widget_link}_wrapper\">" . $result_list . '</div></div>';
// wrap everything into segment
if (isset($this->options['segment'])) {
$temp = is_array($this->options['segment']) ? $this->options['segment'] : [];
$temp['value'] = $result;
$result = html::segment($temp);
}
// anchor
$result = html::a(['name' => "widgets_comments_{$this->widget_link}_anchor"]) . $result;
return $result;
}
示例14: acesso_negado
public function acesso_negado()
{
$texto = 'Você não tem permissão para acessar este recurso.<br>Por favor entre em contato com o administrador.';
$conteudo = html::message($texto, 'Acesso Negado', 'erro');
$this->template->content = $conteudo;
}
示例15: render_data_default
/**
* Data default renderer
*
* @return string
*/
private final function render_data_default()
{
$result = '';
// if we have no rows we display a messsage
if ($this->num_rows == 0) {
return html::message(['type' => 'warning', 'options' => [i18n(null, object_content_messages::no_rows_found)]]);
}
$counter = 1;
$table = ['header' => [], 'options' => []];
// action flags
$actions = [];
if (object_controller::can('record_view')) {
$actions['view'] = true;
}
// generate columns
foreach ($this->columns as $k => $v) {
// if we can not view we skip action column
if (empty($actions) && $k == 'action') {
continue;
}
$table['header'][$k] = ['value' => i18n(null, $v['name']), 'nowrap' => true, 'width' => $v['width'] ?? null];
}
// generate rows
foreach ($this->rows as $k => $v) {
// process all columns first
$row = [];
foreach ($this->columns as $k2 => $v2) {
// if we can not view we skip action column
if (empty($actions) && $k2 == 'action') {
continue;
}
$value = [];
// create cell properties
foreach (['width', 'align'] as $v3) {
if (isset($v2[$v3])) {
$value[$v3] = $v2[$v3];
}
}
// process rows
if ($k2 == 'action') {
$value['value'] = [];
if (!empty($actions['view'])) {
$mvc = application::get('mvc');
$pk = extract_keys($this->model_object->pk, $v);
$url = $mvc['controller'] . '/_edit?' . http_build_query2($pk);
$value['value'][] = html::a(['value' => i18n(null, 'View'), 'href' => $url]);
}
$value['value'] = implode(' ', $value['value']);
} else {
if ($k2 == 'row_number') {
$value['value'] = format::id($counter) . '.';
} else {
if ($k2 == 'offset_number') {
$value['value'] = format::id($this->offset + $counter) . '.';
} else {
if (!empty($v2['options_model'])) {
if (strpos($v2['options_model'], '::') === false) {
$v2['options_model'] .= '::options';
}
$params = $v2['options_params'] ?? [];
if (!empty($v2['options_depends'])) {
foreach ($v2['options_depends'] as $k0 => $v0) {
$params[$k0] = $v[$v0];
}
}
$crypt_object = new crypt();
$hash = $crypt_object->hash($v2['options_model'] . serialize($params));
if (!isset($this->cached_options[$hash])) {
$method = factory::method($v2['options_model'], null, true);
$this->cached_options[$hash] = call_user_func_array($method, [['where' => $params]]);
}
if (isset($this->cached_options[$hash][$v[$k2]])) {
$value['value'] = $this->cached_options[$hash][$v[$k2]]['name'];
} else {
$value['value'] = null;
}
} else {
if (!empty($v2['options']) && !is_array($v[$k2])) {
if (isset($v2['options'][$v[$k2]])) {
$value['value'] = $v2['options'][$v[$k2]]['name'];
} else {
$value['value'] = null;
}
} else {
if (isset($v[$k2])) {
$value['value'] = $v[$k2];
} else {
$value['value'] = null;
}
}
}
}
}
}
// put value into row
//.........这里部分代码省略.........