remove g2embed plugin

This commit is contained in:
Ian 2016-02-03 11:19:34 +01:00
parent 7025752f55
commit 6ad35f87d8
6 changed files with 0 additions and 362 deletions

View file

@ -1,26 +0,0 @@
<?php
/**
* @author Vladimír Ajgl <vlada@ajgl.cz>
* @translated 2009/07/16
*/
@define('G2EMBED_TITLE', 'Vložení fotogalerie Gallery2');
@define('G2EMBED_TITLE_DESC', 'Vkládá do Serendipity fotky z aplikace Gallery2. Ta MUSÍ běžet na jádře Gallery 2.1 RC2 nebo novějším.');
@define('G2EMBED_G2DIR', 'Systémový adresář Gallery 2');
@define('G2EMBED_G2DIR_DESC', 'Absoultní cesta na serveru k adresáři s instalací Galery 2.');
@define('G2EMBED_G2URI', 'HTTP cesta Gallery 2');
@define('G2EMBED_G2URI_DESC', 'Absolutní http cesta k vkládaným souborům.');
@define('G2EMBED_EMBEDURI', 'Jméno vloženého souboru Serendipity');
@define('G2EMBED_EMBEDURI_DESC', 'Absolutní cesta k souboru, do kterého bude vložena Gallery 2.');
@define('G2EMBED_PAGETITLE', 'URL zkratka (pro zpětnou kompatibilitu)');
@define('G2EMBED_HEADLINE', 'Nadpis');
@define('G2EMBED_HEADLINE_DESC', 'Zadejte nadpis stránky s fotogalerií.');
@define('G2EMBED_RELG2PATH', 'Relativní cesta k adresáři Gallery 2.');
@define('G2EMBED_RELG2PATH_DESC', 'Zde by měla být zadána reltivní cesta k instalaci Gallery 2.');
@define('G2EMBED_FONTSIZE', 'Velikost fontu pro tag div s galerií.');
@define('G2EMBED_FONTSIZE_DESC', 'Zde nastavte velikost písma, tj. hodnotu pro element font-size v tagu div galerie. To je nutné, protože při vkládání galerie se dostávají do konfliktu dva různé vkládané css styly, což v neošetřeném stavu vede k mrňavému nečitelnému textu ve výstupu galerie.');
@define('G2EMBED_DIVWIDTH', 'Šířka pro blok div s galerií.');
@define('G2EMBED_DIVWIDTH_DESC', 'Zde zadejte absolutní šířku pro galerii při prohlížení fotek a skrývání postranního sloupce.');
?>

View file

@ -1,26 +0,0 @@
<?php
/**
* @author Vladimír Ajgl <vlada@ajgl.cz>
* @translated 2009/07/16
*/
@define('G2EMBED_TITLE', 'Vložení fotogalerie Gallery2');
@define('G2EMBED_TITLE_DESC', 'Vkládá do Serendipity fotky z aplikace Gallery2. Ta MUSÍ běžet na jádře Gallery 2.1 RC2 nebo novějším.');
@define('G2EMBED_G2DIR', 'Systémový adresář Gallery 2');
@define('G2EMBED_G2DIR_DESC', 'Absoultní cesta na serveru k adresáři s instalací Galery 2.');
@define('G2EMBED_G2URI', 'HTTP cesta Gallery 2');
@define('G2EMBED_G2URI_DESC', 'Absolutní http cesta k vkládaným souborům.');
@define('G2EMBED_EMBEDURI', 'Jméno vloženého souboru Serendipity');
@define('G2EMBED_EMBEDURI_DESC', 'Absolutní cesta k souboru, do kterého bude vložena Gallery 2.');
@define('G2EMBED_PAGETITLE', 'URL zkratka (pro zpětnou kompatibilitu)');
@define('G2EMBED_HEADLINE', 'Nadpis');
@define('G2EMBED_HEADLINE_DESC', 'Zadejte nadpis stránky s fotogalerií.');
@define('G2EMBED_RELG2PATH', 'Relativní cesta k adresáři Gallery 2.');
@define('G2EMBED_RELG2PATH_DESC', 'Zde by měla být zadána reltivní cesta k instalaci Gallery 2.');
@define('G2EMBED_FONTSIZE', 'Velikost fontu pro tag div s galerií.');
@define('G2EMBED_FONTSIZE_DESC', 'Zde nastavte velikost písma, tj. hodnotu pro element font-size v tagu div galerie. To je nutné, protože při vkládání galerie se dostávají do konfliktu dva různé vkládané css styly, což v neošetřeném stavu vede k mrňavému nečitelnému textu ve výstupu galerie.');
@define('G2EMBED_DIVWIDTH', 'Šířka pro blok div s galerií.');
@define('G2EMBED_DIVWIDTH_DESC', 'Zde zadejte absolutní šířku pro galerii při prohlížení fotek a skrývání postranního sloupce.');
?>

View file

@ -1,26 +0,0 @@
<?php
/**
* @author Vladimír Ajgl <vlada@ajgl.cz>
* @translated 2009/07/16
*/
@define('G2EMBED_TITLE', 'Vložení fotogalerie Gallery2');
@define('G2EMBED_TITLE_DESC', 'Vkládá do Serendipity fotky z aplikace Gallery2. Ta MUSÍ bìžet na jádøe Gallery 2.1 RC2 nebo novìjším.');
@define('G2EMBED_G2DIR', 'Systémový adresáø Gallery 2');
@define('G2EMBED_G2DIR_DESC', 'Absoultní cesta na serveru k adresáøi s instalací Galery 2.');
@define('G2EMBED_G2URI', 'HTTP cesta Gallery 2');
@define('G2EMBED_G2URI_DESC', 'Absolutní http cesta k vkládaným souborùm.');
@define('G2EMBED_EMBEDURI', 'Jméno vloženého souboru Serendipity');
@define('G2EMBED_EMBEDURI_DESC', 'Absolutní cesta k souboru, do kterého bude vložena Gallery 2.');
@define('G2EMBED_PAGETITLE', 'URL zkratka (pro zpìtnou kompatibilitu)');
@define('G2EMBED_HEADLINE', 'Nadpis');
@define('G2EMBED_HEADLINE_DESC', 'Zadejte nadpis stránky s fotogalerií.');
@define('G2EMBED_RELG2PATH', 'Relativní cesta k adresáøi Gallery 2.');
@define('G2EMBED_RELG2PATH_DESC', 'Zde by mìla být zadána reltivní cesta k instalaci Gallery 2.');
@define('G2EMBED_FONTSIZE', 'Velikost fontu pro tag div s galerií.');
@define('G2EMBED_FONTSIZE_DESC', 'Zde nastavte velikost písma, tj. hodnotu pro element font-size v tagu div galerie. To je nutné, protože pøi vkládání galerie se dostávají do konfliktu dva rùzné vkládané css styly, což v neošetøeném stavu vede k mròavému neèitelnému textu ve výstupu galerie.');
@define('G2EMBED_DIVWIDTH', 'Šíøka pro blok div s galerií.');
@define('G2EMBED_DIVWIDTH_DESC', 'Zde zadejte absolutní šíøku pro galerii pøi prohlížení fotek a skrývání postranního sloupce.');
?>

View file

@ -1,26 +0,0 @@
<?php
/**
* @author Vladimír Ajgl <vlada@ajgl.cz>
* @translated 2009/07/16
*/
@define('G2EMBED_TITLE', 'Vlo¾ení fotogalerie Gallery2');
@define('G2EMBED_TITLE_DESC', 'Vkládá do Serendipity fotky z aplikace Gallery2. Ta MUSÍ bì¾et na jádøe Gallery 2.1 RC2 nebo novìj¹ím.');
@define('G2EMBED_G2DIR', 'Systémový adresáø Gallery 2');
@define('G2EMBED_G2DIR_DESC', 'Absoultní cesta na serveru k adresáøi s instalací Galery 2.');
@define('G2EMBED_G2URI', 'HTTP cesta Gallery 2');
@define('G2EMBED_G2URI_DESC', 'Absolutní http cesta k vkládaným souborùm.');
@define('G2EMBED_EMBEDURI', 'Jméno vlo¾eného souboru Serendipity');
@define('G2EMBED_EMBEDURI_DESC', 'Absolutní cesta k souboru, do kterého bude vlo¾ena Gallery 2.');
@define('G2EMBED_PAGETITLE', 'URL zkratka (pro zpìtnou kompatibilitu)');
@define('G2EMBED_HEADLINE', 'Nadpis');
@define('G2EMBED_HEADLINE_DESC', 'Zadejte nadpis stránky s fotogalerií.');
@define('G2EMBED_RELG2PATH', 'Relativní cesta k adresáøi Gallery 2.');
@define('G2EMBED_RELG2PATH_DESC', 'Zde by mìla být zadána reltivní cesta k instalaci Gallery 2.');
@define('G2EMBED_FONTSIZE', 'Velikost fontu pro tag div s galerií.');
@define('G2EMBED_FONTSIZE_DESC', 'Zde nastavte velikost písma, tj. hodnotu pro element font-size v tagu div galerie. To je nutné, proto¾e pøi vkládání galerie se dostávají do konfliktu dva rùzné vkládané css styly, co¾ v neo¹etøeném stavu vede k mròavému neèitelnému textu ve výstupu galerie.');
@define('G2EMBED_DIVWIDTH', '©íøka pro blok div s galerií.');
@define('G2EMBED_DIVWIDTH_DESC', 'Zde zadejte absolutní ¹íøku pro galerii pøi prohlí¾ení fotek a skrývání postranního sloupce.');
?>

View file

@ -1,27 +0,0 @@
<?php #
/**
* @version
* @author Translator Name <yourmail@example.com>
* EN-Revision: Revision of lang_en.inc.php
*/
@define('G2EMBED_TITLE', 'Gallery2 Embed');
@define('G2EMBED_TITLE_DESC', 'Embeds Gallery2 within Serendipity. You must be running the Gallery 2.1 core. Gallery 2.1 RC2a or newer REQUIRED.');
@define('G2EMBED_G2DIR', 'Gallery 2 System Directory');
@define('G2EMBED_G2DIR_DESC', 'Absolute path to the Gallery 2 system directory on the server.');
@define('G2EMBED_G2URI', 'Gallery 2 HTTP Path');
@define('G2EMBED_G2URI_DESC', 'Absolute path to http path were the embedded file will reside.');
@define('G2EMBED_EMBEDURI', 'Serendipity Embed File Name');
@define('G2EMBED_EMBEDURI_DESC', 'Absolute path to the file in which gallery 2 will be embedded.');
@define('G2EMBED_PAGETITLE', 'URL shorthand name (Backwards compatibility)');
@define('G2EMBED_HEADLINE', 'Headline');
@define('G2EMBED_HEADLINE_DESC', 'Defines the heading for the document.');
@define('G2EMBED_RELG2PATH', 'Relative path to Gallery2 directory.');
@define('G2EMBED_RELG2PATH_DESC', 'This should be the relative path to the Gallery2 installation.');
@define('G2EMBED_FONTSIZE', 'Font size for the gallery div.');
@define('G2EMBED_FONTSIZE_DESC', 'This will set the font-size element of the gallery div. This is necessary because when embedding gallery, the two stylesheets conflict which results in small, unreadable text in gallery.');
@define('G2EMBED_DIVWIDTH', 'Width for the gallery div.');
@define('G2EMBED_DIVWIDTH_DESC', 'This should be an absolute width to use for the gallery div when viewing photoes and hiding the sidebar.');
?>

View file

@ -1,231 +0,0 @@
<?php
# Copyright by Aaron Axelsen
# Modevia Web Services - http://www.modevia.com
# axelseaa [at] modevia [dot] com
#
if (IN_serendipity !== true) {
die ("Don't hack!");
}
// Probe for a language include with constants. Still include defines later on, if some constants were missing
$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
if (file_exists($probelang)) {
include $probelang;
}
include_once dirname(__FILE__) . '/lang_en.inc.php';
class serendipity_event_G2embed extends serendipity_event {
function serendipity_event_G2embed() {
$this->isG2Loaded = false;
}
function introspect(&$propbag) {
global $serendipity;
$propbag->add('name', G2EMBED_TITLE . ': ' . $this->get_config('pagetitle', ''));
$propbag->add('description', G2EMBED_TITLE_DESC);
$propbag->add('event_hooks', array('entries_header' => true, 'entry_display' => true, 'genpage' => true, 'frontend_generate_plugins' => true));
$propbag->add('configuration', array('g2dir', 'g2uri', 'embedUri', 'headline', 'pagetitle', 'fontsize', 'divwidth'));
$propbag->add('author', 'Aaron Axelsen');
$propbag->add('version', '0.3');
$propbag->add('requirements', array(
'serendipity' => '0.9.1',
'smarty' => '2.6.7',
'php' => '4.1.0'
));
$propbag->add('groups', array('FRONTEND_EXTERNAL_SERVICES'));
$propbag->add('stackable', true);
$this->pagetitle = $this->get_config('pagetitle', 'pagetitle');
}
function introspect_config_item($name, &$propbag)
{
global $serendipity;
switch($name) {
case 'headline':
$propbag->add('type', 'string');
$propbag->add('name', G2EMBED_HEADLINE);
$propbag->add('description', G2EMBED_HEADLINE_DESC);
$propbag->add('default', 'Photo Gallery');
break;
case 'g2dir':
$propbag->add('type', 'string');
$propbag->add('name', G2EMBED_G2DIR);
$propbag->add('description', G2EMBED_G2DIR_DESC);
$propbag->add('default', '/var/www/html/gallery2');
break;
case 'g2uri':
$propbag->add('type', 'string');
$propbag->add('name', G2EMBED_G2URI);
$propbag->add('description', G2EMBED_G2URI_DESC);
$propbag->add('default', $serendipity['serendipityHTTPPath']);
break;
case 'relativeG2Path':
$propbag->add('type', 'string');
$propbag->add('name', G2EMBED_RELG2PATH);
$propbag->add('description', G2EMBED_RELG2PATH_DESC);
$propbag->add('default', '../gallery2');
break;
case 'embedUri':
$propbag->add('type', 'string');
$propbag->add('name', G2EMBED_EMBEDURI);
$propbag->add('description', G2EMBED_EMBEDURI_DESC);
$propbag->add('default', $serendipity['rewrite'] != 'none'
? $serendipity['serendipityHTTPPath'] . 'gallery2.html'
: $serendipity['serendipityHTTPPath'] . $serendipity['indexFile'] . '?/gallery2.html');
break;
case 'pagetitle':
$propbag->add('type', 'string');
$propbag->add('name', G2EMBED_PAGETITLE);
$propbag->add('description', '');
$propbag->add('default', 'gallery2');
break;
case 'fontsize':
$propbag->add('type', 'string');
$propbag->add('name', G2EMBED_FONTSIZE);
$propbag->add('description', G2EMBED_FONTSIZE_DESC);
$propbag->add('default', '1.6em');
break;
case 'divwidth':
$propbag->add('type', 'string');
$propbag->add('name', G2EMBED_DIVWIDTH);
$propbag->add('description', G2EMBED_DIVWIDTH_DESC);
$propbag->add('default', '670px');
break;
default:
return false;
}
return true;
}
function loadG2() {
global $serendipity;
if ($this->isG2Loaded === false) {
require_once( $this->get_config('g2dir') . 'embed.php');
$ret = GalleryEmbed::init(array(
'g2Uri' => $this->get_config('g2uri'),
'embedUri' => $this->get_config('embedUri'),
//'fullInit' => 'false',
'gallerySessionId' => $_COOKIE['PHPSESSID']
));
GalleryCapabilities::set('login',true);
// handle the G2 request
$this->g2moddata = GalleryEmbed::handleRequest();
// show error message if isDone is not defined
if (!isset($this->g2moddata['isDone']))
{
print 'isDone is not defined, something very bad must have happened.';
exit;
}
// die if it was a binary data (image) request
if ($this->g2moddata['isDone'])
{
exit; /* uploads module does this too */
}
$this->isG2Loaded = true;
}
}
function show() {
global $serendipity;
if ($this->selected()) {
if (!headers_sent()) {
header('HTTP/1.0 200');
header('Status: 200 OK');
}
$this->loadG2();
//print_r($this->g2moddata['themeData']['systemLinks']);
echo '<h2><a href="' . $this->get_config('embedUri') . '">' . $this->get_config('headline') . '</a></h2>';
echo '<div id="gallery" style="font-size: ' . $this->get_config('fontsize') . ';';
if ($this->g2moddata['themeData']['item']['canContainChildren'] == 0 || isset($this->g2moddata['themeData']['systemLinks']['core.Logout'])) {
echo ' width:' . $this->get_config('divWidth') . ';';
}
echo '">'. $this->g2moddata['headHtml'] . $this->g2moddata['bodyHtml'] .'</div>';
//print_r($this->g2moddata['themeData']['permissions']);
}
}
function selected() {
global $serendipity;
if ($serendipity['GET']['subpage'] == $this->get_config('pagetitle') ||
preg_match('@^' . preg_quote($this->get_config('embedUri')) . '@i', $serendipity['GET']['subpage'])) {
return true;
}
return false;
}
function generate_content(&$title) {
$title = G2EMBED_TITLE.' ('.$this->get_config('pagetitle').')';
}
function event_hook($event, &$bag, &$eventData, $addData = null) {
global $serendipity;
$hooks = &$bag->get('event_hooks');
if (isset($hooks[$event])) {
switch($event) {
case 'frontend_generate_plugins':
if ($this->selected()) {
if ($this->g2moddata['themeData']['item']['canContainChildren'] == 0 || isset($this->g2moddata['themeData']['systemLinks']['core.Logout'])) {
$eventData = array();
}
}
break;
case 'genpage':
$args = implode('/', serendipity_getUriArguments($eventData, true));
if ($serendipity['rewrite'] != 'none') {
$nice_url = $serendipity['serendipityHTTPPath'] . $args;
} else {
$nice_url = $serendipity['serendipityHTTPPath'] . $serendipity['indexFile'] . '?/' . $args;
}
if (empty($serendipity['GET']['subpage'])) {
$serendipity['GET']['subpage'] = $nice_url;
}
break;
case 'entry_display':
if ($this->selected()) {
if (is_array($eventData)) {
$eventData['clean_page'] = true; // This is important to not display an entry list!
} else {
$eventData = array('clean_page' => true);
}
}
if (version_compare($serendipity['version'], '0.7.1', '<=')) {
$this->show();
}
return true;
break;
case 'entries_header':
$this->show();
return true;
break;
default:
return false;
break;
}
} else {
return false;
}
}
}