Example #1
0
 /**
  * Criar uma célula de dados comum
  *
  * @param string      $th      ID do título
  * @param string      $texto   Texto a ser exibido na scélula
  * @param array       $ou      Outras opções a serem atribuídas
  * @param string|null $th_nome Nome do cabeçalho dessa célula
  *
  * @return string
  */
 public function celulaComum($th, $texto, array $ou = [], $th_nome = null)
 {
     if (isset($th_nome)) {
         $ou = array_merge_recursive($ou, ['data-th' => $th_nome]);
     }
     // Fim if
     $atr = \Funcoes::arraySerializeApoios($this->celulas['conteudo'], $ou);
     $atr = !empty($atr) ? " {$atr}" : $atr;
     return "<td headers=\"{$th}\"{$atr}>{$texto}</td>";
 }
Example #2
0
 /**
  * Criar um link
  *
  * @param string      $tipo          Tipo de link
  * @param string      $href          Destino do link
  * @param string      $texto         Texto de exibição do link
  * @param string|null $title         Texto a ser atribuído no atributo 'title'
  * @param bool        $mostrar_texto Se definido como true, exibe o texto do link. Se false exibe apenas o ícone
  * @param array       $ou            outros atributos a serem aplicados no link
  *
  * @return string
  * @throws \DL3Exception
  */
 public function linkHTML($tipo, $href, $texto, $title = null, $mostrar_texto = true, array $ou = [])
 {
     if (!array_key_exists($tipo, $this->conf_links)) {
         throw new ApoioException(ERRO_LINKS_TIPO_DESCONHECIDO, 1404);
     }
     // Fim if
     if (!$mostrar_texto) {
         $ou = array_merge_recursive($ou, ['class' => '-so-icone']);
     }
     // Fim if
     $atr = \Funcoes::arraySerializeApoios($this->conf_links[$tipo], $ou);
     $atr = !empty($atr) ? " {$atr}" : $atr;
     return "<a href=\"{$href}\" title=\"{$title}\"{$atr}>{$texto}</a>";
 }