Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ssp committed Jun 14, 2012
1 parent a17e93e commit e354260
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 41 deletions.
6 changes: 5 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
This extension loads information about mathematicians from the
[Oberwolfach Photo Collection](http://owpdb.mfo.de/) and the
[Mathematics Genealogy Project](http://genealogy.mathematik.uni-bielefeld.de/genealogy/)
and displays them on the page.

Feel free to add some documentation or simply add a link to the online manual.
Used in [vifamath](http://vifamath.de).
5 changes: 2 additions & 3 deletions ext_localconf.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?php
if (!defined ('TYPO3_MODE')) die ('Access denied.');

## Extending TypoScript from static template uid=43 to set up userdefined tag:
t3lib_extMgm::addTypoScript($_EXTKEY,'editorcfg','
## Extending TypoScript from static template uid=43 to set up userdefined tag:
t3lib_extMgm::addTypoScript($_EXTKEY,'editorcfg','
tt_content.CSS_editor.ch.tx_mathematicians_pi1 = < plugin.tx_mathematicians_pi1.CSS_editor
',43);

Expand Down
4 changes: 0 additions & 4 deletions ext_tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,4 @@

t3lib_extMgm::addPlugin(array('LLL:EXT:mathematicians/locallang_db.xml:tt_content.list_type_pi1', $_EXTKEY.'_pi1'),'list_type');


t3lib_extMgm::addStaticFile($_EXTKEY,"pi1/static/","mathematicians");

t3lib_extMgm::addStaticFile($_EXTKEY,'static//', '');
?>
59 changes: 26 additions & 33 deletions pi1/class.tx_mathematicians_pi1.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,58 +45,53 @@ class tx_mathematicians_pi1 extends tslib_pibase {
* @param array $conf: The PlugIn configuration
* @return The content that is displayed on the website
*/
function main($content,$conf) {
function main($content,$conf) {
$this->conf=$conf;
$this->pi_setPiVarDefaults();
$this->pi_loadLL();

//init


// $GLOBALS['TSFE']->additionalHeaderData[100] = '<script type="text/javascript" src="fileadmin/js/jcarousel/lib/jquery-1.2.3.pack.js"></script>';
//init
$GLOBALS['TSFE']->additionalHeaderData[101] = '<script type="text/javascript" src="fileadmin/js/jcarousel/lib/jquery.jcarousel.js"></script>';
$GLOBALS['TSFE']->additionalHeaderData[102] = '<script type="text/javascript" src="fileadmin/js/maths.js"></script>';
$GLOBALS['TSFE']->additionalHeaderData[103] = '<link rel="stylesheet" href="fileadmin/js/jcarousel//lib/jquery.jcarousel.css" />';
$GLOBALS['TSFE']->additionalHeaderData[104] = '<link rel="stylesheet" href="fileadmin/js/jcarousel/skins/ie7/skin.css" />';

$lang = $GLOBALS["TSFE"]->sys_language_uid;
if ($lang == 1){
$this->templateCode = $this->cObj->fileResource("EXT:mathematicians/pi1/template_en.htm");
$this->templateCode = $this->cObj->fileResource("EXT:mathematicians/pi1/template_en.htm");
}
else {

$this->templateCode = $this->cObj->fileResource("EXT:mathematicians/pi1/template.htm");
$this->templateCode = $this->cObj->fileResource("EXT:mathematicians/pi1/template.htm");
}
$template = array();
$markerArray = array();
$markerArray = array();
$markerArray["###LANG###"] = $lang;
$markerArray["###OWLOGO###"] = 'fileadmin/images/ow-logo.gif';
$markerArray['###GENLOGO###']= 'fileadmin/images/gen-logo.gif';
//for later use
$markerArray["###OWLOGO###"] = 'fileadmin/images/ow-logo.gif';
$markerArray['###GENLOGO###']= 'fileadmin/images/gen-logo.gif';
//for later use
//$markerArray["###MACTUTLOGO###"] = 'fileadmin/images/MTl-logo.gif';

$content = '';
//generate search form
if (isset($_POST['person'])) {

$person = $_POST['person'];

$templateMarker = "###TEMPLATE_RESULT###";
$template = $this->cObj->getSubpart($this->templateCode, $templateMarker);

$markerArray["###SEARCHTERM###"] = $person;
//search OW
$markerArray["###OWRESULT###"]= ow_search($person);
//search Genealogy
$markerArray["###GENRESULT###"]= gen_search($person);

//for later use:search MacTutor
//$markerArray["###MACTUTRESULT###"]= mactut_search($person);
}
else {
//write intro text
$templateMarker = "###TEMPLATE###";
$template = $this->cObj->getSubpart($this->templateCode, $templateMarker);
if (isset($_POST['person'])) {
$person = $_POST['person'];
$templateMarker = "###TEMPLATE_RESULT###";
$template = $this->cObj->getSubpart($this->templateCode, $templateMarker);
$markerArray["###SEARCHTERM###"] = $person;
//search OW
$markerArray["###OWRESULT###"]= ow_search($person);
//search Genealogy
$markerArray["###GENRESULT###"]= gen_search($person);

//for later use:search MacTutor
//$markerArray["###MACTUTRESULT###"]= mactut_search($person);
}
else {
//write intro text
$templateMarker = "###TEMPLATE###";
$template = $this->cObj->getSubpart($this->templateCode, $templateMarker);
}
$content .= $this->cObj->substituteMarkerArrayCached($template, array(), $markerArray , array());
return $this->pi_wrapInBaseClass($content);
Expand All @@ -111,7 +106,6 @@ function main($content,$conf) {
*/

function ow_search($term) {

$owBaseURL = 'http://owpdb.mfo.de';
$owURL = $owBaseURL . '/vifa_search';
$owSearchParam = 'term=';
Expand All @@ -120,11 +114,10 @@ function ow_search($term) {

$xml = simplexml_load_file($owURL. '?'. $owSearchParam . $term);
$count = count($xml->result);
$result = '';
$showcount = 0;

$images = '';
if ($count > 0) {
if ($count > 0) {

while (($showcount < $count) and ($showcount < 7)) {
$img = $owBaseURL . (string)$xml->result[$showcount]->thumbnail;
Expand Down

0 comments on commit e354260

Please sign in to comment.