• R/O
  • SSH
  • HTTPS

zostportal: Commit


Commit MetaInfo

Revision95 (tree)
Time2020-10-11 06:17:15
Authorderekwildstar

Log Message

Zost.bsdesign e styles.css
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

Estilo para alertas atualizado

controller.php
¯¯¯¯¯¯¯¯¯¯¯¯¯¯

Comentários adicionados

view.xml.php
¯¯¯¯¯¯¯¯¯¯¯¯

Comentários adicionados

default.php
¯¯¯¯¯¯¯¯¯¯¯

Mais ajustes no form de envio de anexos (arquivos ou urls). Ainda não foi concluído

Change Summary

Incremental Difference

--- trunk/Projetos/Componentes/com_zost/site/views/zost/view.xml.php (revision 94)
+++ trunk/Projetos/Componentes/com_zost/site/views/zost/view.xml.php (revision 95)
@@ -53,6 +53,12 @@
5353 É por isso que o padrão de nomes de layouts é snake_case
5454 */
5555 $this->setLayout("default_xml");
56+ /*
57+ O content-disposition dos documentos xml são inline com filename =
58+ joomla (nome padrão do documento). Estou configurando o nome como
59+ "zost" apenas para aparecer bonitinho header :)
60+ */
61+ $this->document->setName("zost");
5662 parent::display($tpl);
5763 }
5864 }
--- trunk/Projetos/Componentes/com_zost/site/controller.php (revision 94)
+++ trunk/Projetos/Componentes/com_zost/site/controller.php (revision 95)
@@ -142,6 +142,13 @@
142142 $view->document = $document;
143143
144144 $view->display();
145+ /*
146+ Eu vi em algumas implementações de componentes a colocação de um exit()
147+ depois do display(). Isso quebra as coisas. Ao se fazer isso, o conteúdo
148+ esperado não é carregado dentro do template ativo. Isso acontecia com o
149+ componente de anexos (com_attachment)
150+ */
151+ //exit();
145152 }
146153 }
147154 ?>
\ No newline at end of file
--- trunk/Projetos/Templates/zost_basicblack/assets/_/css/styles.css (revision 94)
+++ trunk/Projetos/Templates/zost_basicblack/assets/_/css/styles.css (revision 95)
@@ -683,7 +683,7 @@
683683
684684 /* ==== Início: Personalização de alertas do Bootstrap ==== */
685685
686-.alert-info {
686+.alert-info, .alert-danger, alert-warning {
687687 text-shadow: initial;
688688 }
689689
--- trunk/Projetos/Templates/zost_basicblack/html/com_attachments/upload/default.php (revision 94)
+++ trunk/Projetos/Templates/zost_basicblack/html/com_attachments/upload/default.php (revision 95)
@@ -26,8 +26,6 @@
2626
2727 use Zost\Helpers;
2828 use Joomla\CMS\Language\Text;
29-//use Joomla\CMS\Factory;
30-//echo(__FILE__ . ":" . __LINE__);
3129
3230 $zostHelpers = Helpers::getHelpers();
3331
@@ -37,11 +35,11 @@
3735 $parent_id = $attachment->parent_id === null ? 0 : $attachment->parent_id;
3836 // Set up to toggle between uploading file/urls
3937 if ($attachment->uri_type == "file" ) {
40- $upload_toggle_button_text = "Em vez disso, informe o URL de uma arquivo";
38+ $upload_toggle_button_text = "Em vez disso, informe o URL de um arquivo";
4139 $upload_toggle_url = $this->upload_url_url;
4240 $upload_button_text = "Enviar";
4341 } else {
44- $upload_toggle_button_text = "Em vez disso, selecione um arquivo a enviar";
42+ $upload_toggle_button_text = "Em vez disso, selecione um arquivo a carregar";
4543 $upload_toggle_url = $this->upload_file_url;
4644 $upload_button_text = "Adicionar URL";
4745 }
@@ -67,92 +65,79 @@
6765 $upload_id = "upload_warning";
6866 break;
6967 }
70-/*
71-Quando há um erro no envio do arquivo ou do url, este scrip é chamado de forma
72-crua, exatamente como ele é, ou seja, apenas o miolo de algo que normalmente aparece dentro de <body>, por conta disso
73-precisamos recriar o html apenas neste caso. As duas funções abaixo criam o html necessário
74-*/
75-//continue aquicriando as funcoes tais como existem em view.html.php. Talvez não seja necessário recriar o html
76-//talvez tenha como configurar aqui o document e deixar que o joomla se vire. Verifique se ->doc tem algo dentro de erro
77-
78-// If this is an error re-display, display the CSS links directly
79-if ($this->error) {
80- //echo($this->startHTML());
81-}
8268 // Realizando uma tradução básica
8369 $parentEntityName = $attachment->parent_entity_name == "Article" ? "o artigo" : $attachment->parent_entity_name;
84-?>
85-<h2><?php echo(Text::sprintf("Anexos para %s \"%s\"",$parentEntityName, $attachment->parent_title)); ?></h2>
86-<?php
70+
71+echo("<h2>" . Text::sprintf("Anexos para %s \"%s\"",$parentEntityName, $attachment->parent_title) . "</h2>\n");
72+
8773 if ($this->error_msg) {
88-?>
89- <div class="formWarning" id="formWarning"><?php echo($this->error_msg); ?></div>
90-<?php
74+ echo(' <div class="alert alert-danger alert-dismissible fade show" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button><span style="font-weight: bold">' . $this->error_msg . '</span></div>'."\n");
9175 }
9276 ?>
9377 <form class="attachments" enctype="multipart/form-data" name="upload_form" action="<?php echo($this->save_url); ?>" method="post">
9478 <fieldset class="form-group">
95- <legend>Definição do anexo</legend>
96-<?php if ( $attachment->uri_type == 'file' ): ?>
97- <p><label for="<?php echo $upload_id ?>"><?php
98- echo JText::_('ATTACH_ATTACH_FILE_COLON') ?></label>
99- <a class="changeButton" href="<?php echo $upload_toggle_url ?>"><?php
100- echo $upload_toggle_button_text;?></a></p>
101- <p><input type="file" name="upload" id="<?php echo $upload_id; ?>"
102- size="78" maxlength="1024" /></p>
103- <p class="display_name"><label for="display_name"
104- title="<?php echo JText::_('ATTACH_DISPLAY_FILENAME_TOOLTIP'); ?>"
105- ><?php echo JText::_('ATTACH_DISPLAY_FILENAME_OPTIONAL_COLON'); ?></label>
106- <input type="text" name="display_name" id="display_name"
107- size="70" maxlength="80"
108- title="<?php echo JText::_('ATTACH_DISPLAY_FILENAME_TOOLTIP'); ?>"
109- value="<?php echo $attachment->display_name; ?>" /></p>
110-<?php else: ?>
111- <p><label for="<?php echo $upload_id ?>"><?php
112- echo JText::_('ATTACH_ENTER_URL') ?></label>
113- &nbsp;&nbsp;&nbsp;&nbsp;
114- <label for="verify_url"><?php echo JText::_('ATTACH_VERIFY_URL_EXISTENCE') ?></label>
115- <input type="checkbox" name="verify_url" value="verify" <?php echo $this->verify_url_checked ?>
116- title="<?php echo JText::_('ATTACH_VERIFY_URL_EXISTENCE_TOOLTIP'); ?>" />
117- &nbsp;&nbsp;&nbsp;&nbsp;
118- <label for="relative_url"><?php echo JText::_('ATTACH_RELATIVE_URL') ?></label>
119- <input type="checkbox" name="relative_url" value="relative" <?php echo $this->relative_url_checked ?>
120- title="<?php echo JText::_('ATTACH_RELATIVE_URL_TOOLTIP'); ?>" />
121- <a class="changeButton" href="<?php echo $upload_toggle_url ?>"><?php
122- echo $upload_toggle_button_text;?></a><br />
123- <input type="text" name="url" id="<?php echo $upload_id; ?>"
124- size="80" maxlength="255" title="<?php echo JText::_('ATTACH_ENTER_URL_TOOLTIP'); ?>"
125- value="<?php echo $attachment->url; ?>" /><br /><?php
126- echo JText::_('ATTACH_NOTE_ENTER_URL_WITH_HTTP'); ?></p>
127- <p class="display_name"><label for="display_name"
128- title="<?php echo JText::_('ATTACH_DISPLAY_URL_TOOLTIP'); ?>"
129- ><?php echo JText::_('ATTACH_DISPLAY_URL_COLON'); ?></label>
130- <input type="text" name="display_name" id="display_name"
131- size="70" maxlength="80"
132- title="<?php echo JText::_('ATTACH_DISPLAY_URL_TOOLTIP'); ?>"
133- value="<?php echo $attachment->display_name; ?>" /></p>
134-<?php endif; ?>
135- <p><label for="description"><?php echo JText::_('ATTACH_DESCRIPTION_COLON'); ?></label>
136- <input type="text" name="description" id="description"
137- size="70" maxlength="255"
138- value="<?php echo stripslashes($attachment->description); ?>" /></p>
79+<?php
80+if ($attachment->uri_type == "file") {
81+?>
82+ <legend>Carregar e anexar um arquivo (<a href="<?php echo($upload_toggle_url); ?>"><?php echo($upload_toggle_button_text); ?></a>)</legend>
83+ <div class="form-group">
84+ <input type="file" name="upload" id="<?php echo($upload_id); ?>" class="form-control-file" />
85+ </div>
86+ <div class="form-group">
87+ <label for="display_name">Nome de arquivo a ser exibido</label>
88+ <input type="text" name="display_name" id="display_name" class="form-control form-control-sm" maxlength="80" title="Informe um nome de arquivo alternativo a ser exibido ao invéz do nome de arquivo completo" value="<?php echo($attachment->display_name); ?>" />
89+ </div>
90+<?php
91+} else {
92+?>
93+ <legend>Anexar uma URL (<a href="<?php echo($upload_toggle_url); ?>"><?php echo($upload_toggle_button_text); ?></a>)</legend>
94+ <div class="form-group">
95+ <label for="<?php echo($upload_id); ?>">Informe o URL do arquivo</label>
96+ <div class="custom-control custom-switch" style="display: inline-block; float: right; margin-left: 1rem" title="Marque esta caixa para informar um URL relativo dentro deste site. Você provavelmente também precisará desmarcar a caixa &quot;Verificar a existência do URL&quot; para adicionar um URL relativo">
97+ <input class="custom-control-input" type="checkbox" name="relative_url" id="relative_url" value="relative" <?php echo($this->relative_url_checked); ?> />
98+ <label class="custom-control-label" for="relative_url">URL relativo</label>
99+ </div>
100+ <div class="custom-control custom-switch" style="display: inline-block; float: right" title="Marque esta caixa para verificar se a URL é acessível (apenas para URLs novas ou editadas). Ao manter esta caixa desmarcada o URL ainda será verificado quanto a sua sintaxe">
101+ <input class="custom-control-input" type="checkbox" name="verify_url" id="verify_url" value="verify" <?php echo($this->verify_url_checked); ?> />
102+ <label class="custom-control-label" for="verify_url">Verificar a existência do URL</label>
103+ </div>
104+ <input type="text" name="url" id="<?php echo($upload_id); ?>" class="form-control form-control-sm" maxlength="255" title="Digite o URL aqui. O recurso apontado pelo URL não será carregado, apenas o URL propriamente dito será salvo. Atenção: ao informar URLs relativos desmarque o checkbox &quot;Verificar a existência do URL&quot; e selecione &quot;URL Relativo&quot;" value="<?php echo($attachment->url); ?>" placeholder="Informe um url com o prefixo &quot;http&quot;, senão o URL será interpretado como relativo" />
105+ </div>
106+ <div class="form-group">
107+ <label for="display_name">URL a ser exibido</label>
108+ <input type="text" name="display_name" id="display_name" class="form-control form-control-sm" maxlength="80" title="Informe um URL alternativo a ser exibido ao invéz do URL original" value="<?php echo($attachment->display_name); ?>" />
109+ </div>
110+<?php
111+}
112+?>
113+ <div class="form-group">
114+ <label for="description">Descrição</label>
115+ <input type="text" name="description" id="description" class="form-control form-control-sm" maxlength="255" value="<?php echo(stripslashes($attachment->description)); ?>" title="Informe uma descrição curta para este anexo" />
116+ </div>
117+
118+
119+
139120 <?php if ( $this->may_publish ): ?>
140121 <div class="at_control"><label><?php echo JText::_('ATTACH_PUBLISHED'); ?></label><?php echo $this->publish; ?></div>
141122 <?php endif; ?>
123+
142124 <?php if ( $params->get('allow_frontend_access_editing', false) ): ?>
143125 &nbsp;&nbsp;&nbsp;&nbsp;
144126 <div class="at_control"><label for="access" title="<?php echo $this->access_level_tooltip; ?>"><? echo JText::_('ATTACH_ACCESS_COLON'); ?></label> <?php echo $this->access_level; ?></div>
145127 <?php endif; ?>
128+
146129 <?php if ( $params->get('user_field_1_name', false) ): ?>
147130 <p><label for="user_field_1"><?php echo $params->get('user_field_1_name'); ?>:</label>
148131 <input type="text" name="user_field_1" id="user_field_1" size="70" maxlength="100"
149132 value="<?php echo stripslashes($attachment->user_field_1); ?>" /></p>
150133 <?php endif; ?>
134+
151135 <?php if ( $params->get('user_field_2_name', false) ): ?>
152136 <p><label for="user_field_2"><?php echo $params->get('user_field_2_name'); ?>:</label>
153137 <input type="text" name="user_field_2" id="user_field_2" size="70" maxlength="100"
154138 value="<?php echo stripslashes($attachment->user_field_2); ?>" /></p>
155139 <?php endif; ?>
140+
156141 <?php if ( $params->get('user_field_3_name', false) ): ?>
157142 <p><label for="user_field_3"><?php echo $params->get('user_field_3_name'); ?>:</label>
158143 <input type="text" name="user_field_3" id="user_field_3" size="70" maxlength="100"
@@ -202,11 +187,8 @@
202187 $controller->displayString($parent_id, $attachment->parent_type, $attachment->parent_entity,
203188 'ATTACH_EXISTING_ATTACHMENTS',
204189 false, false, true, $this->from);
205- }
190+}
206191
207-if ($this->error) {
208- //echo($this->endHTML());
209-}
210192 /*
211193 Limpa todos os estilos existentes no array de estilos do documento. Isso faz com
212194 que possamos adicionar apenas nossos próprios estilos usando métodos do próprio
@@ -297,21 +279,4 @@
297279 /* ]]> */
298280 EOS;
299281
300-$zostHelpers->doc->addScriptDeclaration($scriptDeclaration);
301-
302-if ($this->error) {
303-// $this->document = &$zostHelpers->doc;
304-}
305-
306-/*
307-
308-this = AttachmentsViewUpload
309-
310- $document = JFactory::getDocument();
311- $this->assignRef('document', $document);
312-
313- $app = JFactory::getApplication();
314- $this->template = $app->getTemplate(true)->template;
315- $template_dir = $this->baseurl.'/templates/'.$this->template;
316-
317-*/
282+$zostHelpers->doc->addScriptDeclaration($scriptDeclaration);
\ No newline at end of file
Show on old repository browser