/** * Parser Hook * * The following method is assigned to a hook, which will be run whenever * the user adds a <bugs /> tag in the main MediaWiki code. * * @param string $text * @param array $args * @param obj $parser * @return str */ public static function executeHook($text, $args = array(), $parser) { $parser->disableCache(); // Set the page namespace $namespace['dbKey'] = $parser->getTitle()->getPrefixedDBkey(); $namespace['text'] = $parser->getTitle()->getPrefixedText(); $isParserHook = true; // Process request $instance = self::_getInstance(); $output = $instance->_processActionRequest($namespace, $isParserHook, $args); return $output; }
/** * Obtiene el nombre de la hoja leida * <br>Para poder utilizar esta funcion, se debe haber realizado la lectura * de la hoja mediante la funcion <i>obtenerHojaExcel()</i> * @param obj $hoja <p>Objeto WorkingSheet instanciado con la hoja leida</p> * @return string <p>El nombre de la hoja</p> */ function obtenerNombreHojaExcel($hoja) { try { $retorno = $hoja->getTitle(); } catch (Exception $ex) { //echo $ex->getMessage()."<br>"; $retorno = ""; } return $retorno; }
/** * Helper function to print the individual slides * * @param obj $albumobj Album object * @param obj $imgobj Current slide obj * @param int $width Slide image width * @param int $height Slide image height * @param int $cropw Slide image crop width * @param int $croph Slide image crop height * @param bool $linkslides True or false if the slides should be linked to their image page. * Note: In carousel mode this means full image links as here slides are always linked to the image page. * @param bool $crop True or false to crop the image * @param bool $carousel if the slideshow is a carousel so we can enable full image linking (only images allowed!) */ static function getSlide($albumobj, $imgobj, $width, $height, $cropw, $croph, $linkslides, $crop = false, $carousel = false) { global $_zp_current_image; if ($crop) { $imageurl = $imgobj->getCustomImage(NULL, $width, $height, $cropw, $croph, NULL, NULL, true, NULL); } else { $maxwidth = $width; $maxheight = $height; getMaxSpaceContainer($maxwidth, $maxheight, $imgobj); $imageurl = $imgobj->getCustomImage(NULL, $maxwidth, $maxheight, NULL, NULL, NULL, NULL, NULL, NULL); } $slidecontent = '<div class="slide">' . "\n"; // no space in carousels for titles! if (!$carousel) { $slidecontent .= '<h4>' . html_encode($albumobj->getTitle()) . ': ' . html_Encode($imgobj->getTitle()) . '</h4>' . "\n"; } if ($carousel) { // on the carousel this means fullimage as they are always linked anyway if ($linkslides) { $url = pathurlencode($imgobj->getFullImageURL()); } else { $url = pathurlencode($imgobj->getLink()); } $slidecontent .= '<a href="' . $url . '">' . "\n"; } else { if (!$carousel && $linkslides) { $slidecontent .= '<a href="' . pathurlencode($imgobj->getLink()) . '">' . "\n"; } } $active = ''; if ($carousel && !is_null($_zp_current_image)) { if ($_zp_current_image->filename == $imgobj->filename) { $active = ' class="activeslide"'; } else { $active = ''; } } $slidecontent .= '<img src="' . pathurlencode($imageurl) . '" alt=""' . $active . '>' . "\n"; if ($linkslides || $carousel) { $slidecontent .= '</a>' . "\n"; } // no space in carousels for this! if (getOption("cycle-slideshow_showdesc") && !$carousel) { $slidecontent .= '<div class="slide_desc">' . html_encodeTagged($imgobj->getDesc()) . '</div>' . "\n"; } $slidecontent .= '</div>' . "\n"; return $slidecontent; }