function replaceWidthHeight($w, $h, $string) { $finalstring = fop($string); $pattern = '/width="[^"]+" height="[^"]+"/i'; $replace = 'width="' . $w . '" height="' . $h . '"'; $finalstring = preg_replace($pattern, $replace, $finalstring); $pattern = '/height="[^"]+" width="[^"]+"/i'; $replace = 'height="' . $h . '"width="' . $w . '"'; $finalstring = preg_replace($pattern, $replace, $finalstring); $pattern = '/width=[^"]+&height=[^"]+&/i'; $replace = 'width=' . $w . '&height=' . $h . '&'; $finalstring = preg_replace($pattern, $replace, $finalstring); $pattern = '/height=[^"]+&width=[^"]+&/i'; $replace = 'height=' . $h . '&width=' . $w . '&'; $finalstring = preg_replace($pattern, $replace, $finalstring); return $finalstring; }
private function embed() { if ($this->results) { // ADD CLASS TO SUPERCONTAINER FOR SORT if ($this->canSort) { $sortCls = 'sortGalerias'; } else { $sortCls = 'noSortGalerias'; } if ($this->useSuperContainer) { $out[] = '<div class="superContainerMedia ' . $sortCls . ' ' . $this->superContainerCls . '" style="' . $this->superContainerStyle . '">'; } foreach ($this->results as $item) { if ($this->useContainer) { $out[] = '<div class="imagenes_galeria ' . $this->containerCls . '" style="' . $this->containerStyle . '" id="item_' . $item['id'] . '">'; } $out[] = '<div class="playerContainer imageContainer" id="player_' . $item['id'] . '">'; // PAYER $out[] = '<div id="s' . $item['id'] . '" class="player ' . $this->itemCls . '" style="' . $this->itemStyle . '"></div>'; $out[] = fop($item['embed']); $out[] = '</div>'; $out[] = $this->buildButtons($item); $out[] = $this->buildDisplayName($item); if ($this->useContainer) { $out[] = '</div>'; } } $out[] = '<div style="clear: both;"></div>'; if ($this->useSuperContainer) { $out[] = '</div>'; } return join('', $out); } }
public function getListado() { // ADD CLASS TO SUPERCONTAINER FOR SORT $sortCls = ''; if ($this->canSort) { $sortCls = 'sortListados'; } $this->tableImg = $this->tableImg ? $this->tableImg : $this->table; // SUPERCONTAINER $out[] = '<div class="' . $sortCls . ' ' . $this->superContainerCls . '">'; // LISTADOTABLA $out[] = '<div id="listadoTabla" class="' . $this->table . '"></div>'; // ITERATE ITEMS foreach ($this->contents as $row) { // CANTIDAD ITEMS O SUBCATEGORIAS EN ESTE BLOQUE if ($this->countItems) { $cantidad = a("SELECT COUNT(" . $this->whereCountItems . ") AS cantidad FROM " . $this->tableCountItems . " WHERE " . $this->whereCountItems . " = '" . $row[$this->campo] . "'"); } // ITEM $out[] = '<div id="listItem_' . $row['id'] . '" class="itemListado">'; // DATA TITLES $out[] = '<div class="dataTitlesContainer">'; // ITERA CAMPOS if ($this->campos) { $this->camposArray = explode(',', $this->campos); foreach ($this->camposArray as $c) { if ($row[$c]) { $out[] = '<div class="itemList line_' . $c . '">'; // ROW TITLE $out[] = '<div class="rowTitle">' . lang($c) . '</div>'; // VALUE FOR FIELD DATE if (stristr($c, 'date')) { $out[] = '<div class="rowValue">' . date($this->config['dateFormat'], strtotime($row[$c])) . '</div>'; } else { $out[] = '<div class="rowValue">' . lang(strip_tags(fop($row[$c])), true) . '</div>'; } $out[] = '</div>'; } } // CONTEO DE ITEMS if ($this->countItems) { $out[] = '<div class="itemList line_count">'; $out[] = '<div class="rowTitle">' . lang('cantidad') . '</div>'; $catId = false; if (isset($_GET['cat_id'])) { $catId = sprintf("%d", $_GET['cat_id']); } if (!$catId && $row[$this->campo]) { $q = 'cat_id=' . $row['id']; } if ($catId && $row[$this->campo]) { $q = 'cat_id=' . $catId . '&subcat_id=' . $row['id']; } $this->nameCountItems = $this->nameCountItems ? $this->nameCountItems : $this->tableCountItems; $out[] = '<div class="rowValue">'; $out[] = '<a href="?m=' . $_GET['m'] . '&action=list&' . $q . '">' . lang($this->nameCountItems) . ': ' . $cantidad['cantidad'] . '</a>'; $out[] = '</div>'; $out[] = '</div>'; } // ACTIONS if ($this->canEdit || $this->canDelete || $this->linkToFront || $this->canSort) { $out[] = '<div class="itemList line_actions">'; $out[] = '<div class="rowTitle">' . lang('acciones') . '</div>'; $catId = false; if (isset($_GET['cat_id'])) { $catId = sprintf("%d", $_GET['cat_id']); } $subcatId = false; if (isset($_GET['subcat_id'])) { $subcatId = sprintf("%d", $_GET['subcat_id']); } $q = ''; if ($catId && !$subcatId) { $q = '&cat_id=' . $catId; } if ($catId && $subcatId) { $q = '&cat_id=' . $catId . '&subcat_id=' . $subcatId; } $out[] = '<div class="rowValue">'; // EDIT if ($this->canEdit) { $out[] = '<a href="?m=' . $_GET['m'] . '&action=edit' . $q . '&id=' . $row['id'] . '" rel="' . lang('editar') . ' ' . lang($this->itemText) . '" title="' . lang('editar') . ' ' . lang($this->itemText) . '">'; $out[] = '<img alt="' . lang('editar') . ' ' . lang($this->itemText) . '" title="' . lang('editar') . ' ' . lang($this->itemText) . '" src="' . ICONSPATH . 'pencil.png"/>'; $out[] = '</a>'; } // DELETE if ($this->canDelete) { $out[] = '<a style="cursor: pointer;" onclick="borrar(\'' . $row['id'] . '\',\'' . $this->table . '\',\'delete_item\',0,0)" rel="' . lang('borrar') . ' ' . lang($this->itemText) . '" title="' . lang('borrar') . ' ' . lang($this->itemText) . '">'; $out[] = '<img alt="' . lang('borrar') . ' ' . lang($this->itemText) . '" title="' . lang('borrar') . ' ' . lang($this->itemText) . '" src="' . ICONSPATH . 'delete.png"/>'; $out[] = '</a>'; } // SORT if ($this->canSort) { $out[] = '<a rel="' . lang('ordenar') . '" title="' . lang('ordenar') . '">'; $out[] = '<img alt="' . lang('ordenar') . '" title="' . lang('ordenar') . '" src="' . ICONSPATH . 'move.png"/>'; $out[] = '</a>'; } // VER if ($this->linkToFront) { $out[] = '<a href="' . ROOT . $this->linkToFront . '?id=' . $row['id'] . '" rel="' . lang('ver') . ' ' . lang($this->itemText) . '" title="' . lang('ver') . ' ' . lang($this->itemText) . '" target="_blank">'; $out[] = '<img alt="' . lang('ver') . ' ' . lang($this->itemText) . '" title="' . lang('ver') . ' ' . lang($this->itemText) . '" src="' . ICONSPATH . 'eye.png"/>'; $out[] = '</a>'; } $out[] = '</div>'; $out[] = '</div>'; } // MEDIA if ($this->showImg) { $ShowMedia = new ShowMedia(); $ShowMedia->itemId = $row['id']; $ShowMedia->type = $this->mediaType; $ShowMedia->table = $this->tableImg; $ShowMedia->useColoursCloud = false; foreach ($this->showMediaCfg as $paramK => $paramV) { $ShowMedia->{$paramK} = $paramV; } if ($ShowMedia->getMediaOut()) { $out[] = '<div class="itemList line_media">'; $out[] = '<div class="rowTitle">' . lang('media') . '</div>'; $out[] = '<div class="rowValue">'; $out[] = '<div class="imagesContainer">'; $out[] = $ShowMedia->getMediaOut(); $out[] = '</div>'; $out[] = '<div style="clear: both;"></div>'; $out[] = '</div>'; $out[] = '</div>'; } } } $out[] = '</div>'; $out[] = '<div style="clear: both;"></div>'; $out[] = '</div>'; $out[] = '<div style="clear: both;"></div>'; } $out[] = '</div>'; return join("\n", $out); }
private function replaceField($field = '', $arrayFromReplace = array()) { // SEARCH {} IN TEMPLATE preg_match_all('/\\{(.*?)\\}/', $this->emailData[$field], $results); if (!$results || empty($results[0]) || empty($results[1])) { return $this->emailData[$field]; } $results[0] = array_unique($results[0]); $results[1] = array_unique($results[1]); foreach ($results[0] as $key => $value) { // ITERATE ALL {} FOUND IN TEMPLATE if (isset($arrayFromReplace[$results[1][$key]])) { $this->emailData[$field] = preg_replace('/' . $value . '/', fop($arrayFromReplace[$results[1][$key]]), $this->emailData[$field]); } } return $this->emailData[$field]; }
private function displayfield() { $out[] = $this->getContainerDiv(); // FIELD LABEL $out[] = $this->getFieldLabel(); // INPUT WRAPPER $name = $this->submitValue ? 'name="' . $this->name . '"' : ''; $out[] = '<div class="displayWrapper ' . $this->inputWrapperCls . '">'; $out[] = '<input id="' . $this->id . '" ' . $name . ' ' . $this->disabled . ' class="' . $this->inputCls . '" type="hidden" value="' . fop($this->value) . '" tabindex="' . $this->tabIndex . '" />'; $out[] = $this->value; $out[] = '</div>'; if ($this->afterFieldHtml) { $out[] = '<div class="afterFieldHtml">' . $this->afterFieldHtml . '</div>'; } $out[] = '</div>'; return join("\n", $out); }
$phpt->folder = $imm['tabla']; $imagenes[] = $phpt->getImgHtml(); // THUMB FOR PAGER $phpt2 = new PhpT(); $phpt2->fileName = $imm['nombre']; $phpt2->fileTitle = utf8_strtoupper($producto['nombre']); $phpt2->params = array('w' => 70, 'h' => 52, 'zc' => 1); $phpt2->folder = $imm['tabla']; $thumbs[] = $phpt2->getImgHtml(); } } $highlight1 = new highlight(utf8_ucfirst(utf8_strtolower($producto['nombre'])), $words); $hiTitulo = $highlight1->output_text; $highlight2 = new highlight($producto['resumen'], $words); $hiResumen = $highlight2->output_text; $highlight3 = new highlight(fop($producto['descripcion']), $words); $hiDescripcion = $highlight3->output_text; $out[] = '<h4 class="small">» ' . $hiTitulo . '</h4>'; $out[] = '<div class="productoAmpliado">'; $out[] = '<div style="position: relative; float: left;">'; if ($imagenes) { $out[] = '<div class="cycleProducto">' . join("\n", $imagenes) . '</div>'; } if ($thumbs) { $out[] = '<div class="cycleProductoPager">' . join("\n", $thumbs) . '</div>'; } $out[] = '</div>'; $out[] = '<div class="clear"></div>'; $out[] = '<i>' . $hiResumen . '</i>'; $out[] = $hiDescripcion; $out[] = '<div class="clear" style="padding: 20px 0 0 0;"></div>';
if ($x != 0) { $phpt->lightboxShowImg = false; } //$phpt->lightboxShowLink = true; $phpt->params = array('w' => 300, 'h' => 225, 'zc' => 1); $phpt->folder = $img['tabla']; $gal[] = $phpt->getImgHtml(); $x++; } } $out[] = '<div class="noticiaAmpliada">'; $out[] = '<h4>' . $noticia['titulo'] . '</h4>'; $out[] = '<div class="ceebox">' . join("\n", $gal) . '</div>'; $out[] = '<span class="date">' . $noticia['df'] . '</span>'; $out[] = '<i>' . $noticia['resumen'] . '</i>'; $out[] = fop($noticia['body']); $out[] = '<div class="clear" style="padding: 20px 0 0 0;"></div>'; $out[] = '</div>'; if ($items) { $out[] = '<h3>Otras Noticias</h3>'; $out[] = '<div style="float: left; width: 49%;">'; foreach ($chunks[0] as $i) { $out[] = '<div class="nota" style="margin-top: 14px;">'; $out[] = '<i>' . $i['df'] . '</i>'; $out[] = '<a href="noticia.php?id=' . $i['id'] . '" title="MAS"><strong>' . cortar($i['titulo'], 40, array('ending' => '...')) . '</strong></a>'; $out[] = '<p>' . cortar($i['resumen'], 90, array('ending' => '...')) . '</p>'; $out[] = '<a class="mas" href="noticia.php?id=' . $i['id'] . '" title="MAS">MAS</a>'; $out[] = '</div>'; } $out[] = '</div>'; $out[] = '<div style="float: right; width: 49%;">';