コード例 #1
0
 protected function getSortingLinks()
 {
     $sortHelper = t3lib_div::makeInstance('Tx_Solr_Sorting', $this->configuration['search.']['sorting.']['options.']);
     $query = $this->search->getQuery();
     $queryLinkBuilder = t3lib_div::makeInstance('Tx_Solr_Query_LinkBuilder', $query);
     $queryLinkBuilder->setLinkTargetPageId($this->parentPlugin->getLinkTargetPageId());
     $sortOptions = array();
     $urlParameters = t3lib_div::_GP('tx_solr');
     $urlSortParameters = t3lib_div::trimExplode(',', $urlParameters['sort']);
     $configuredSortOptions = $sortHelper->getSortOptions();
     foreach ($configuredSortOptions as $sortOptionName => $sortOption) {
         $sortDirection = $this->configuration['search.']['sorting.']['defaultOrder'];
         if (!empty($this->configuration['search.']['sorting.']['options.'][$sortOptionName . '.']['defaultOrder'])) {
             $sortDirection = $this->configuration['search.']['sorting.']['options.'][$sortOptionName . '.']['defaultOrder'];
         }
         $sortIndicator = $sortDirection;
         $currentSortOption = '';
         $currentSortDirection = '';
         foreach ($urlSortParameters as $urlSortParameter) {
             $explodedUrlSortParameter = explode(' ', $urlSortParameter);
             if ($explodedUrlSortParameter[0] == $sortOptionName) {
                 list($currentSortOption, $currentSortDirection) = $explodedUrlSortParameter;
                 break;
             }
         }
         // toggle sorting direction for the current sorting field
         if ($currentSortOption == $sortOptionName) {
             switch ($currentSortDirection) {
                 case 'asc':
                     $sortDirection = 'desc';
                     $sortIndicator = 'asc';
                     break;
                 case 'desc':
                     $sortDirection = 'asc';
                     $sortIndicator = 'desc';
                     break;
             }
         }
         if (!empty($this->configuration['search.']['sorting.']['options.'][$sortOptionName . '.']['fixedOrder'])) {
             $sortDirection = $this->configuration['search.']['sorting.']['options.'][$sortOptionName . '.']['fixedOrder'];
         }
         $sortParameter = $sortOptionName . ' ' . $sortDirection;
         $temp = array('link' => $queryLinkBuilder->getQueryLink($sortOption['label'], array('sort' => $sortParameter)), 'url' => $queryLinkBuilder->getQueryUrl(array('sort' => $sortParameter)), 'optionName' => $sortOptionName, 'field' => $sortOption['field'], 'label' => $sortOption['label'], 'is_current' => '0', 'direction' => $sortDirection, 'indicator' => $sortIndicator, 'current_direction' => ' ');
         // set sort indicator for the current sorting field
         if ($currentSortOption == $sortOptionName) {
             $temp['selected'] = 'selected="selected"';
             $temp['current'] = 'current';
             $temp['is_current'] = '1';
             $temp['current_direction'] = $sortIndicator;
         }
         // special case relevance: just reset the search to normal behavior
         if ($sortOptionName == 'relevance') {
             $temp['link'] = $queryLinkBuilder->getQueryLink($sortOption['label'], array('sort' => NULL));
             $temp['url'] = $queryLinkBuilder->getQueryUrl(array('sort' => NULL));
             unset($temp['direction'], $temp['indicator']);
         }
         $sortOptions[] = $temp;
     }
     return $sortOptions;
 }
コード例 #2
0
 /**
  * userFunc on save of the record
  * @param $conf
  */
 function saveRecord($conf)
 {
     //print "TEST";
     //t3lib_div::print_array($conf);
     //check loaded LL
     if (!$this->LOCAL_LANG_loaded) {
         $this->user_dmailsubscribe();
     }
     if (intval($conf['rec']['uid'])) {
         $fe = t3lib_div::_GP('FE');
         $newFieldsArr = $fe['tt_address']['module_sys_dmail_category'];
         //$newFields = implode(',',$newFieldsArr);
         //print "NewFields: $newFields<br />";
         $count = 0;
         $GLOBALS['TYPO3_DB']->exec_DELETEquery('sys_dmail_ttaddress_category_mm', 'uid_local=' . $conf['rec']['uid']);
         if (is_array($newFieldsArr)) {
             foreach (array_keys($newFieldsArr) as $uid) {
                 if (is_numeric($uid)) {
                     $count++;
                     $GLOBALS['TYPO3_DB']->exec_INSERTquery('sys_dmail_ttaddress_category_mm', array('uid_local' => intval($conf['rec']['uid']), 'uid_foreign' => intval($uid), 'sorting' => $count));
                 }
             }
             $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tt_address', 'uid=' . intval($conf['rec']['uid']), array('module_sys_dmail_category' => $count));
         }
         /** 
          * IK: 27.04.09 
          * localized title in own field 
          */
         if (t3lib_div::inList('m,f', $conf['rec']['gender'])) {
             $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tt_address', 'uid=' . intval($conf['rec']['uid']), array('tx_directmailsubscription_localgender' => $this->pi_getLL('tt_addressGender' . strtoupper($conf['rec']['gender']))));
         }
     }
     return;
 }
コード例 #3
0
ファイル: class.sitemap_xml.php プロジェクト: paddyez/tq_seo
 /**
  * Create Sitemap
  * (either Index or page)
  *
  * @return string 		XML Sitemap
  */
 protected function createSitemap()
 {
     $ret = '';
     $page = t3lib_div::_GP('page');
     $pageLimit = 10000;
     // Page limit on sitemap (DEPRECATED)
     $tmp = $this->getExtConf('sitemap_pageSitemapItemLimit', false);
     if ($tmp !== false) {
         $pageLimit = (int) $tmp;
     }
     if (isset($this->tsSetup['pageLimit']) && $this->tsSetup['pageLimit'] != '') {
         $pageLimit = (int) $this->tsSetup['pageLimit'];
     }
     $pageItems = count($this->sitemapPages);
     $pageItemBegin = $pageLimit * ($page - 1);
     $pageCount = ceil($pageItems / $pageLimit);
     if (empty($page) || $page == 'index') {
         $ret = $this->createSitemapIndex($pageCount);
     } elseif (is_numeric($page)) {
         if ($pageItemBegin <= $pageItems) {
             $this->sitemapPages = array_slice($this->sitemapPages, $pageItemBegin, $pageLimit);
             $ret = $this->createSitemapPage($page);
         }
     }
     return $ret;
 }
コード例 #4
0
    /**
     * Queries a table for records and completely processes them
     *
     * Returns a two-dimensional array of almost finished records;
     * they only need to be put into a <li>-structure
     *
     * @param array $params
     * @param integer $recursionCounter recursion counter
     * @return mixed array of rows or FALSE if nothing found
     */
    public function queryTable(&$params, $recursionCounter = 0)
    {
        $uid = t3lib_div::_GP('uid');
        $records = parent::queryTable($params, $recursionCounter);
        if ($this->checkIfTagIsNotFound($records)) {
            $text = htmlspecialchars($params['value']);
            $javaScriptCode = '
var value=\'' . $text . '\';

Ext.Ajax.request({
	url : \'ajax.php\' ,
	params : { ajaxID : \'News::createTag\', item:value,newsid:\'' . $uid . '\' },
	success: function ( result, request ) {
		var arr = result.responseText.split(\'-\');
		setFormValueFromBrowseWin(arr[5], arr[2] +  \'_\' + arr[0], arr[1]);
		TBE_EDITOR.fieldChanged(arr[3], arr[6], arr[4], arr[5]);
	},
	failure: function ( result, request) {
		Ext.MessageBox.alert(\'Failed\', result.responseText);
	}
});
';
            $javaScriptCode = trim(str_replace('"', '\'', $javaScriptCode));
            $link = implode(' ', explode(chr(10), $javaScriptCode));
            $records['tx_news_domain_model_tag_' . strlen($text)] = array('text' => '<div onclick="' . $link . '">
							<span class="suggest-path">
								<a>' . sprintf($GLOBALS['LANG']->sL('LLL:EXT:news/Resources/Private/Language/locallang_be.xml:tag_suggest'), $text) . '</a>
							</span></div>', 'table' => 'tx_news_domain_model_tag', 'class' => 'suggest-noresults', 'style' => 'background-color:#E9F1FE !important;background-image:url(' . $this->getDummyIconPath() . ');');
        }
        return $records;
    }
コード例 #5
0
ファイル: hooks.php プロジェクト: raimundlandig/winkel.de-DEV
	/**
	 * A hook to modifiy the js part of the extension,
	 * e.g. loading an extra custom layer
	 *
	 * @param	string		$js: the existing js
	 * @param	array		$$data: Array holding the config of the js
	 * @param	obj		$lconf: $this->config of the plugin
	 * @param	obj		$pobj: $this of the plugin
	 * @return	the full js part, so you should know what you do!
	 */
	function extraGetJsProcessor($js, $data, $lConf, &$pObj) {
	  $postvar = t3lib_div::_GP('custom');
	  if ($postvar) {
      $additionalJS = 'function CustomGetTileUrl(a,b) {
                              if (b==17 && a.x>=70461 && a.x<=70465 && a.y>=45785 && a.y<= 45790) {
                                return "http://p28123.typo3server.info/fileadmin/dev/map/tiles/Tile_"+(a.x)+"_"+(a.y)+"_"+b+".jpg";
                              } else if (b==16 && a.x>=35230 && a.x<=35232 && a.y>=22892 && a.y<= 22895) {
                                return "http://p28123.typo3server.info/fileadmin/dev/map/tiles/Tile_"+(a.x)+"_"+(a.y)+"_"+b+".jpg";
                              } else {
                                return G_NORMAL_MAP.getTileLayers()[0].getTileUrl(a,b);
                              }
                      	   }';
      $additionalMap = 'var copyright = new GCopyright(1,new GLatLngBounds(new GLatLng(37.584580682182, 3.5339760780334), new GLatLng(57.584580682182, 23.533976078033)), 0, "Digitales Oberösterreichisches Raum-Informations-System");
      	var copyrightCollection = new GCopyrightCollection(\'Custom Layer\');
  		copyrightCollection.addCopyright(copyright);

  		var tilelayers = [new GTileLayer(copyrightCollection , 16, 17)];
  		tilelayers[0].getTileUrl = CustomGetTileUrl;

  		var custommap = new GMapType(tilelayers, G_SATELLITE_MAP.getProjection(), "Custom Layer", {errorMessage:"No chart data available"});
  		map.addMapType(custommap);';

  		$js = str_replace('//###MAKEMAP###',$additionalMap,$js);
  	}

    $all =  $js.$additionalJS;

    return $all;




	}
コード例 #6
0
 /**
  * Processing of clickmenu items
  *
  * @param	object		Reference to parent
  * @param	array		Menu items array to modify
  * @param	string		Table name
  * @param	integer		Uid of the record
  * @return	array		Menu item array, returned after modification
  * @todo	Skinning for icons...
  */
 function main(&$backRef, $menuItems, $table, $uid)
 {
     global $BE_USER, $TCA;
     $localItems = array();
     if ($backRef->cmLevel && t3lib_div::_GP('subname') == 'moreoptions' || $table === 'pages' && $uid == 0) {
         // Show import/export on second level menu OR root level.
         $LL = $this->includeLL();
         $modUrl = $backRef->backPath . t3lib_extMgm::extRelPath('impexp') . 'app/index.php';
         $url = $modUrl . '?tx_impexp[action]=export&id=' . ($table == 'pages' ? $uid : $backRef->rec['pid']);
         if ($table == 'pages') {
             $url .= '&tx_impexp[pagetree][id]=' . $uid;
             $url .= '&tx_impexp[pagetree][levels]=0';
             $url .= '&tx_impexp[pagetree][tables][]=_ALL';
         } else {
             $url .= '&tx_impexp[record][]=' . rawurlencode($table . ':' . $uid);
             $url .= '&tx_impexp[external_ref][tables][]=_ALL';
         }
         $localItems[] = $backRef->linkItem($GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->getLLL('export', $LL)), $backRef->excludeIcon(t3lib_iconWorks::getSpriteIcon('actions-document-export-t3d')), $backRef->urlRefForCM($url), 1);
         if ($table == 'pages') {
             $url = $modUrl . '?id=' . $uid . '&table=' . $table . '&tx_impexp[action]=import';
             $localItems[] = $backRef->linkItem($GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->getLLL('import', $LL)), $backRef->excludeIcon(t3lib_iconWorks::getSpriteIcon('actions-document-import-t3d')), $backRef->urlRefForCM($url), 1);
         }
     }
     return array_merge($menuItems, $localItems);
 }
コード例 #7
0
 /**
  * Die dazu das aktuelle item für eine Detailseite zu holen bzw dieses zurückzusetzen.
  * Dazu muss den Linker einfach folgendes für den action namen liefern: "show" + den eigentlichen key.
  * 
  * Dann brauch man in der Detailansicht noch einen Button nach folgendem Schema:
  * $markerArray['###NEWSEARCHBTN###'] = $formTool->createSubmit('showHowTo[clear]', '###LABEL_BUTTON_BACK###'); 
  * 
  * @param string $key
  * @param tx_rnbase_mod_IModule $module
  * 
  * @return tx_rnbase_model_base
  */
 public static function getCurrentItem($key, tx_rnbase_mod_IModule $module)
 {
     $itemid = 0;
     $data = t3lib_div::_GP('show' . $key);
     if ($data) {
         list($itemid, ) = each($data);
     }
     $dataKey = 'current' . $key;
     if ($itemid === 'clear') {
         $data = t3lib_BEfunc::getModuleData(array($dataKey => ''), array($dataKey => '0'), $module->getName());
         return false;
     }
     // Daten mit Modul abgleichen
     $changed = $itemid ? array($dataKey => $itemid) : array();
     $data = t3lib_BEfunc::getModuleData(array($dataKey => ''), $changed, $module->getName());
     $itemid = $data[$dataKey];
     if (!$itemid) {
         return false;
     }
     $modelData = explode('|', $itemid);
     $item = tx_rnbase::makeInstance($modelData[0], $modelData[1]);
     if (!$item->isValid()) {
         $item = null;
         //auf null setzen damit die Suche wieder angezeigt wird
     }
     return $item;
 }
コード例 #8
0
 function init()
 {
     global $BE_USER, $LANG, $BACK_PATH, $TCA_DESCR, $TCA, $CLIENT, $TYPO3_CONF_VARS;
     if (t3lib_div::_GP('pageId') < 0 || t3lib_div::_GP('pageId') == '' || t3lib_div::_GP('templateId') < 0 || t3lib_div::_GP('templateId') == '' || t3lib_div::_GP('ISOcode') == '') {
         die('if you want to us this mod you need at least to define pageId, templateId and ISOcode as GET parameter. Example path/to/TinyMCETemplate.php?pageId=7&templateId=2&ISOcode=en');
     }
     $this->pageId = t3lib_div::_GP('pageId');
     $this->templateId = t3lib_div::_GP('templateId');
     $this->ISOcode = t3lib_div::_GP('ISOcode');
     $this->pageTSconfig = t3lib_BEfunc::getPagesTSconfig($this->pageId);
     if (t3lib_div::_GP('mode') != 'FE') {
         $this->conf = $this->pageTSconfig['RTE.']['default.'];
     } else {
         $this->conf = $this->pageTSconfig['RTE.']['default.']['FE.'];
     }
     $LANG->init(strtolower($this->ISOcode));
     $this->tinymce_rte = t3lib_div::makeInstance('tx_tinymce_rte_base');
     $this->conf = $this->tinymce_rte->init($this->conf);
     $row = array('pid' => $this->pageId, 'ISOcode' => $this->ISOcode);
     $this->conf = $this->tinymce_rte->fixTinyMCETemplates($this->conf, $row);
     if (is_array($this->conf['TinyMCE_templates.'][$this->templateId]) && $this->conf['TinyMCE_templates.'][$this->templateId]['include'] != '') {
         if (is_file($this->conf['TinyMCE_templates.'][$this->templateId]['include'])) {
             include_once $this->conf['TinyMCE_templates.'][$this->templateId]['include'];
         } else {
             die('no file found at include path');
         }
     }
 }
コード例 #9
0
 /** **********************************************************************************************
  * Get category by given uid ($_GP[tx_kiddognews_ajax]['uid'])
  ********************************************************************************************** */
 public function getCategoriesByForeignUid()
 {
     // Workaround for the foreignUid
     $node = t3lib_div::_GP('node');
     if ($node == 'root') {
         $this->tx_kiddognews_ajax['foreignUid'] = 1;
     } else {
         $this->tx_kiddognews_ajax['foreignUid'] = $node;
     }
     $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('name, uid', 'tx_kiddognews_domain_model_category', 'foreign_uid =' . $this->tx_kiddognews_ajax['foreignUid'], '', 'name', '');
     $categories = '[';
     while ($row = mysql_fetch_array($res)) {
         $categories .= '{"text":"' . $row['name'] . '","id":"' . $row['uid'] . '","iconCls":"folder","draggable":false},';
     }
     $categories .= ']';
     /**
      * 	[
      *	{"text":"Data Sources","id":"datasources","iconCls":"folder","draggable":false},
      *	{"text":"Datasets","id":"datasets","iconCls":"folder","draggable":false},
      *	{"text":"Executive Reports","id":"execreports","iconCls":"folder","draggable":false},
      *	{"text":"Reports","id":"reports","iconCls":"folder","draggable":false}
      *	]
      */
     echo utf8_encode($categories);
 }
コード例 #10
0
    /**
     * Main function, returning the HTML content of the module
     *
     * @return	string		HTML
     */
    function main()
    {
        $content = '';
        $content .= '<p>Following functions modify the database which might be needed due to changed default behaviour of content elements.</p>';
        $updateAction = t3lib_div::_GP('updateAction');
        if ($updateAction === 'do_imagecaption_position_hidden') {
            $updateContent = $this->perform_update_tt_content_imagecaption_position('hidden');
        }
        if ($updateAction === 'do_imagecaption_position_default') {
            $updateContent = $this->perform_update_tt_content_imagecaption_position('default');
        }
        if ($updateContent) {
            $content .= '<div class="bgColor5" style="margin:2em 0 1em 0; padding: 0.5em; border:1px solid #aaa">' . $updateContent . '</div>';
        }
        //
        // captions
        //
        $onClickHidden = "document.location.href='" . t3lib_div::linkThisScript(array('updateAction' => 'do_imagecaption_position_hidden')) . "'; return false;";
        $onClickVisible = "document.location.href='" . t3lib_div::linkThisScript(array('updateAction' => 'do_imagecaption_position_default')) . "'; return false;";
        $content .= '<br /><h3>Image caption display</h3>
				<p>When css_styled_content is used for rendering, this extension can change the rendering so captions can be fetched from DAM for the content elements Image and Text w/image (see extension options).</p>
				<p>Captions might be visible now (coming from DAM) where no captions were needed. With the following functions...</p>
				<ul>
				  <li>all unused captions can be set hidden</li>
				  <li>all hidden captions can be set visible again</li>
				</ul>

			<input onclick="' . htmlspecialchars($onClickHidden) . '" type="submit" value="Set unused captions hidden"> ' . '<input onclick="' . htmlspecialchars($onClickVisible) . '" type="submit" value="unhide captions"></form>
		';
        return $content;
    }
コード例 #11
0
	/**
	 * Main function, returning the HTML content of the module
	 *
	 * @return	string		HTML
	 */
	function main()	{

		require_once(t3lib_extMgm::extPath(STATIC_INFO_TABLES_EXTkey).'class.tx_staticinfotables_encoding.php');

		$tableArray = array ('static_countries', 'static_country_zones', 'static_languages', 'static_currencies');

		$content = '';
		$content.= '<br />Convert character encoding of the static info tables.';
		$content.= '<br />The default encoding is UTF-8.';
		$destEncoding = htmlspecialchars(t3lib_div::_GP('dest_encoding'));

		if(t3lib_div::_GP('convert') AND ($destEncoding != '')) {
			foreach ($tableArray as $table) {
				$content .= '<p>'.htmlspecialchars($table.' > '.$destEncoding).'</p>';
				tx_staticinfotables_encoding::convertEncodingTable($table, 'utf-8', $destEncoding);
			}
			$content .= '<p>You must enter the charset \''.$destEncoding.'\' now manually in the EM for static_info_tables!</p>';
			$content .= '<p>Done</p>';
		} else {
			$content .= '<form name="static_info_tables_form" action="'.htmlspecialchars(t3lib_div::linkThisScript()).'" method="post">';
			$linkScript = t3lib_div::slashJS(t3lib_div::linkThisScript());
			$content .= '<br /><br />';
			$content .= 'This conversion works only once. When you converted the tables and you want to do it again to another encoding you have to reinstall the tables with the Extension Manager or select \'UPDATE!\'.';
			$content .= '<br /><br />';
			$content .= 'Destination character encoding:';
			$content .= '<br />'.tx_staticinfotables_encoding::getEncodingSelect('dest_encoding', '', '', $TYPO3_CONF_VARS['EXTCONF'][STATIC_INFO_TABLES_EXTkey]['charset']);
			$content .= '<br /><br />';
			$content .= '<input type="submit" name="convert" value="Convert"  onclick="this.form.action=\''.$linkScript.'\';submit();" />';
			$content .= '</form>';
		}

		return $content;

	}
コード例 #12
0
 /**
  * Main function, returning the HTML content of the module
  *
  * @return	string		HTML
  */
 function main()
 {
     $content = '';
     $content .= '<br />Update the Static Info Tables with new language labels.';
     $content .= '<br />';
     if (t3lib_div::_GP('import')) {
         $destEncoding = t3lib_div::_GP('dest_encoding');
         $extPath = t3lib_extMgm::extPath('static_info_tables_it');
         $fileContent = explode("\n", t3lib_div::getUrl($extPath . 'ext_tables_static_update.sql'));
         foreach ($fileContent as $line) {
             if ($line = trim($line) and preg_match('#^UPDATE#i', $line)) {
                 $query = $this->getUpdateEncoded($line, $destEncoding);
                 $res = $GLOBALS['TYPO3_DB']->admin_query($query);
             }
         }
         $content .= '<br />';
         $content .= '<p>Encoding: ' . htmlspecialchars($destEncoding) . '</p>';
         $content .= '<p>Done.</p>';
     } elseif (t3lib_extMgm::isLoaded('static_info_tables_it')) {
         $content .= '</form>';
         $content .= '<form action="' . htmlspecialchars(t3lib_div::linkThisScript()) . '" method="post">';
         $content .= '<br />Destination character encoding:';
         $content .= '<br />' . tx_staticinfotables_encoding::getEncodingSelect('dest_encoding', '', 'utf-8');
         $content .= '<br />(The character encoding must match the encoding of the existing tables data. By default this is UTF-8.)';
         $content .= '<br /><br />';
         $content .= '<input type="submit" name="import" value="Import" />';
         $content .= '</form>';
     } else {
         $content .= '<br /><strong>The extension needs to be installed first!</strong>';
     }
     return $content;
 }
コード例 #13
0
 /**
  * Don't show powermail form if session is empty
  *
  * @param	string			$content: html content from powermail
  * @param	array			$piVars: piVars from powermail
  * @param	object			$pObj: piVars from powermail
  * @return	void
  */
 public function PM_MainContentAfterHook($content, $piVars, &$pObj)
 {
     $conf = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_wtcart_pi1.'];
     $piVars = t3lib_div::_GP('tx_powermail_pi1');
     if ($piVars['mailID'] > 0 || $piVars['sendNow'] > 0) {
         return false;
         // stop
     }
     if ($conf['powermailContent.']['uid'] > 0 && intval($conf['powermailContent.']['uid']) == $pObj->cObj->data['uid']) {
         // if powermail uid isset and fits to current CE
         $div = t3lib_div::makeInstance('tx_wtcart_div');
         // Create new instance for div functions
         $products = $div->getProductsFromSession();
         // get products from session
         if (!is_array($products) || count($products) == 0) {
             // if there are no products in the session
             $pObj->content = '';
             // clear content
         }
         $sesArray = $GLOBALS['TSFE']->fe_user->getKey('ses', 'wt_cart_cart_' . $GLOBALS["TSFE"]->id);
         $cartmin = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_wtcart_pi1.']['cart.']['cartmin.'];
         if (floatval($sesArray['cart_gross_no_service']) < floatval($cartmin['value']) && $cartmin['hideifnotreached.']['powermail']) {
             $pObj->content = '';
             // clear content
         }
     }
 }
コード例 #14
0
 /**
  * Render javascript in header
  *
  * @return string the rendered page info icon
  * @see template::getPageInfo() Note: can't call this method as it's protected!
  */
 public function render()
 {
     $doc = $this->getDocInstance();
     $id = t3lib_div::_GP('id');
     $pageRecord = t3lib_BEfunc::readPageAccess($id, $GLOBALS['BE_USER']->getPagePermsClause(1));
     // Add icon with clickmenu, etc:
     if ($pageRecord['uid']) {
         // If there IS a real page
         $alttext = t3lib_BEfunc::getRecordIconAltText($pageRecord, 'pages');
         $iconImg = t3lib_iconWorks::getSpriteIconForRecord('pages', $pageRecord, array('title' => htmlspecialchars($alttext)));
         // Make Icon:
         $theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($iconImg, 'pages', $pageRecord['uid']);
     } else {
         // On root-level of page tree
         // Make Icon
         $iconImg = '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/i/_icon_website.gif') . ' alt="' . htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']) . '" />';
         if ($BE_USER->user['admin']) {
             $theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($iconImg, 'pages', 0);
         } else {
             $theIcon = $iconImg;
         }
     }
     // Setting icon with clickmenu + uid
     $pageInfo = $theIcon . '<em>[pid: ' . $pageRecord['uid'] . ']</em>';
     return $pageInfo;
 }
	/**
	 * Initializes the clipboard object. The calling class must make sure that the right locallang files are already loaded.
	 * This method is usually called by the templavoila page module.
	 *
	 * Also takes the GET variable "CB" and submits it to the t3lib clipboard class which handles all
	 * the incoming information and stores it in the user session.
	 *
	 * @param	$pObj:		Reference to the parent object ($this)
	 * @return	void
	 * @access	public
	 */
	function init(&$pObj) {
		global $LANG, $BACK_PATH;

			// Make local reference to some important variables:
		$this->pObj =& $pObj;
		$this->doc =& $this->pObj->doc;
		$this->extKey =& $this->pObj->extKey;
		$this->MOD_SETTINGS =& $this->pObj->MOD_SETTINGS;

			// Initialize the t3lib clipboard:
		$this->t3libClipboardObj = t3lib_div::makeInstance('t3lib_clipboard');
		$this->t3libClipboardObj->backPath = $BACK_PATH;
		$this->t3libClipboardObj->initializeClipboard();
		$this->t3libClipboardObj->lockToNormal();

			// Clipboard actions are handled:
		$CB = t3lib_div::_GP('CB');	// CB is the clipboard command array
		$this->t3libClipboardObj->setCmd($CB);		// Execute commands.

		if (isset ($CB['setFlexMode'])) {
			switch ($CB['setFlexMode']) {
				case 'copy' : $this->t3libClipboardObj->clipData['normal']['flexMode'] = 'copy'; break;
				case 'cut':  $this->t3libClipboardObj->clipData['normal']['flexMode'] = 'cut'; break;
				case 'ref': $this->t3libClipboardObj->clipData['normal']['flexMode'] = 'ref'; break;
				default: unset ($this->t3libClipboardObj->clipData['normal']['flexMode']); break;
			}
		}

		$this->t3libClipboardObj->cleanCurrent();	// Clean up pad
		$this->t3libClipboardObj->endClipboard();	// Save the clipboard content

			// Add a list of non-used elements to the sidebar:
			$this->pObj->sideBarObj->addItem('nonUsedElements', $this, 'sidebar_renderNonUsedElements', $LANG->getLL('nonusedelements'),30);
	}
コード例 #16
0
    /**
     * Main function.
     * Creates the header code in XHTML, the JavaScript, then the frameset for the two frames.
     *
     * @return	void
     */
    function main()
    {
        // Setting GPvars:
        $mode = t3lib_div::_GP('mode');
        $bparams = t3lib_div::_GP('bparams');
        // Set doktype:
        $GLOBALS['TBE_TEMPLATE']->docType = 'xhtml_frames';
        $GLOBALS['TBE_TEMPLATE']->JScode = $GLOBALS['TBE_TEMPLATE']->wrapScriptTags('
				function closing()	{	//
					close();
				}
				function setParams(mode,params)	{	//
					parent.content.location.href = "browse_links.php?mode="+mode+"&bparams="+params;
				}
				if (!window.opener)	{
					alert("ERROR: Sorry, no link to main window... Closing");
					close();
				}
		');
        $this->content .= $GLOBALS['TBE_TEMPLATE']->startPage($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:TYPO3_Element_Browser'));
        // URL for the inner main frame:
        $url = $GLOBALS['BACK_PATH'] . 'browse_links.php?mode=' . rawurlencode($mode) . '&bparams=' . rawurlencode($bparams);
        // Create the frameset for the window:
        // Formerly there were a ' onunload="closing();"' in the <frameset> tag - but it failed on Safari browser on Mac unless the handler was "onUnload"
        $this->content .= '
			<frameset rows="*,1" framespacing="0" frameborder="0" border="0">
				<frame name="content" src="' . htmlspecialchars($url) . '" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" noresize="noresize" />
				<frame name="menu" src="' . $GLOBALS['BACK_PATH'] . 'dummy.php" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" noresize="noresize" />
			</frameset>
		';
        $this->content .= '
</html>';
    }
コード例 #17
0
    /**
     * The main function in the class
     *
     * @return	string		HTML content
     */
    function cacheFiles()
    {
        $content = '';
        // CURRENT:
        $content .= '<strong>1: The current cache files:</strong>' . Tx_Extdeveval_Compatibility::viewArray(t3lib_extMgm::currentCacheFiles());
        // REMOVING?
        if (t3lib_div::_GP('REMOVE_temp_CACHED')) {
            $number = $this->removeCacheFiles();
            $content .= '<hr /><p><strong>2: Tried to remove ' . $number . ' cache files.</strong></p>';
        }
        if (t3lib_div::_GP('REMOVE_temp_CACHED_ALL')) {
            $content .= '<hr /><p><strong>2: Removing ALL "temp_CACHED_*" files:</strong></p>' . $this->removeALLtempCachedFiles();
        }
        $files = t3lib_div::getFilesInDir(PATH_typo3conf, 'php');
        $tRows = array();
        foreach ($files as $f) {
            $tRows[] = '<tr>
				<td>' . htmlspecialchars($f) . '</td>
				<td>' . t3lib_div::formatSize(filesize(PATH_typo3conf . $f)) . '</td>
			</tr>';
        }
        $content .= '<br /><strong>3: PHP files (now) in "' . PATH_typo3conf . '":</strong><br />
		<table border="1">' . implode('', $tRows) . '</table>

		<input type="submit" name="REMOVE_temp_CACHED" value="REMOVE current temp_CACHED files" />
		<input type="submit" name="REMOVE_temp_CACHED_ALL" value="REMOVE ALL temp_CACHED_* files" />
		<input type="submit" name="_" value="Refresh" />
		';
        return $content;
    }
コード例 #18
0
 /**
  * Returns true if the associated action in _GET is allowed.
  *
  * @return boolean
  */
 public function actionIsAllowed()
 {
     if (!in_array(t3lib_div::_GP('action'), array('route', 'getAPI'))) {
         return FALSE;
     }
     return TRUE;
 }
コード例 #19
0
 /**
  * Basically makes sure that the workspace preview is rendered.
  * The preview itself consists of three frames, so there are
  * only the frames-urls we've to generate here
  *
  * @return void
  */
 public function indexAction()
 {
     // @todo language doesn't always come throught the L parameter
     // @todo Evaluate how the intval() call can be used with Extbase validators/filters
     $language = intval(t3lib_div::_GP('L'));
     $controller = t3lib_div::makeInstance('Tx_Workspaces_Controller_ReviewController', TRUE);
     /** @var $uriBuilder Tx_Extbase_MVC_Web_Routing_UriBuilder */
     $uriBuilder = $this->objectManager->create('Tx_Extbase_MVC_Web_Routing_UriBuilder');
     $wsSettingsPath = t3lib_div::getIndpEnv('TYPO3_SITE_URL') . 'typo3/';
     $wsSettingsUri = $uriBuilder->uriFor('singleIndex', array(), 'Tx_Workspaces_Controller_ReviewController', 'workspaces', 'web_workspacesworkspaces');
     $wsSettingsParams = '&tx_workspaces_web_workspacesworkspaces[controller]=Review';
     $wsSettingsUrl = $wsSettingsPath . $wsSettingsUri . $wsSettingsParams;
     $viewDomain = t3lib_BEfunc::getViewDomain($this->pageId);
     $wsBaseUrl = $viewDomain . '/index.php?id=' . $this->pageId . '&L=' . $language;
     // @todo - handle new pages here
     // branchpoints are not handled anymore because this feature is not supposed anymore
     if (tx_Workspaces_Service_Workspaces::isNewPage($this->pageId)) {
         $wsNewPageUri = $uriBuilder->uriFor('newPage', array(), 'Tx_Workspaces_Controller_PreviewController', 'workspaces', 'web_workspacesworkspaces');
         $wsNewPageParams = '&tx_workspaces_web_workspacesworkspaces[controller]=Preview';
         $this->view->assign('liveUrl', $wsSettingsPath . $wsNewPageUri . $wsNewPageParams);
     } else {
         $this->view->assign('liveUrl', $wsBaseUrl . '&ADMCMD_noBeUser=1');
     }
     $this->view->assign('wsUrl', $wsBaseUrl . '&ADMCMD_view=1&ADMCMD_editIcons=1&ADMCMD_previewWS=' . $GLOBALS['BE_USER']->workspace);
     $this->view->assign('wsSettingsUrl', $wsSettingsUrl);
     $this->view->assign('backendDomain', t3lib_div::getIndpEnv('TYPO3_HOST_ONLY'));
     $GLOBALS['BE_USER']->setAndSaveSessionData('workspaces.backend_domain', t3lib_div::getIndpEnv('TYPO3_HOST_ONLY'));
     $this->pageRenderer->addJsInlineCode("workspaces.preview.lll", "TYPO3.LLL.Workspaces = {\n\t\t\tvisualPreview: '" . $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:preview.visualPreview', true) . "',\n\t\t\tlistView: '" . $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:preview.listView', true) . "',\n\t\t\tlivePreview: '" . $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:preview.livePreview', true) . "',\n\t\t\tlivePreviewDetail: '" . $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:preview.livePreviewDetail', true) . "',\n\t\t\tworkspacePreview: '" . $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:preview.workspacePreview', true) . "',\n\t\t\tworkspacePreviewDetail: '" . $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:preview.workspacePreviewDetail', true) . "',\n\t\t\tmodeSlider: '" . $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:preview.modeSlider', true) . "',\n\t\t\tmodeVbox: '" . $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:preview.modeVbox', true) . "',\n\t\t\tmodeHbox: '" . $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:preview.modeHbox', true) . "'\n\t\t};\n");
 }
コード例 #20
0
 /**
  * Main function
  *
  * @return	void
  */
 function main()
 {
     global $LANG, $TCA, $BACK_PATH;
     $content = '';
     $param = t3lib_div::_GP('edit');
     $table = key($param);
     $uid = (string) key($param[$table]);
     $cmd = $param[$table][$uid];
     if (is_array($TCA[$table]) and $cmd == 'new') {
         $this->defaultPid = tx_dam_db::getPid();
         $getArray['edit'][$table][$this->defaultPid] = 'new';
         $getArray['defVals'] = t3lib_div::_GP('defVals');
         $getArray['defVals'][$table]['pid'] = $this->defaultPid;
         $getArray['returnUrl'] = $this->pObj->returnUrl;
         $getArray['redirect'] = $this->pObj->redirect;
         $getArray = t3lib_div::compileSelectedGetVarsFromArray('returnUrl,redirect,edit,defVals,overrideVals,columnsOnly,disHelp,noView,editRegularContentFromId', $getArray);
         $getUrl = t3lib_div::implodeArrayForUrl('', $getArray);
         header('Location: ' . $BACK_PATH . 'alt_doc.php?id=' . $this->defaultPid . $getUrl);
         exit;
     } else {
         $content .= 'wrong comand!';
     }
     #TODO do it always this way (with if)
     if ($this->pObj->returnUrl) {
         $content .= '<br /><br />' . $this->pObj->btn_back('', $this->pObj->returnUrl);
     }
     // todo csh
     #		$content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'file_rename', $GLOBALS['BACK_PATH'],'<br/>');
     return $content;
 }
コード例 #21
0
	/**
	 * Generates the output
	 *
	 * @return string		from action
	 */
	public function main() {
		$lat = t3lib_div::_GP('lat');
		$lng = t3lib_div::_GP('lng');

		$address = $this->getAddressFromGeo($lat, $lng);
		return $address['route'] . ' ' . $address['street_number'];
	}
コード例 #22
0
ファイル: RegistrationsList.php プロジェクト: kurtkk/seminars
 /**
  * Generates and prints out a registrations list.
  *
  * @return string the HTML source code to display
  */
 public function show()
 {
     $content = '';
     $pageData = $this->page->getPageData();
     $this->template->setMarker('label_attendee_full_name', $GLOBALS['LANG']->getLL('registrationlist.feuser.name'));
     $this->template->setMarker('label_event_accreditation_number', $GLOBALS['LANG']->getLL('registrationlist.seminar.accreditation_number'));
     $this->template->setMarker('label_event_title', $GLOBALS['LANG']->getLL('registrationlist.seminar.title'));
     $this->template->setMarker('label_event_date', $GLOBALS['LANG']->getLL('registrationlist.seminar.date'));
     $eventUid = (int) t3lib_div::_GP('eventUid');
     /** @var tx_seminars_Mapper_Event $mapper */
     $mapper = tx_oelib_MapperRegistry::get('tx_seminars_Mapper_Event');
     if ($eventUid > 0 && $mapper->existsModel($eventUid)) {
         $this->eventUid = $eventUid;
         /** @var tx_seminars_Model_Event $event */
         $event = $mapper->find($eventUid);
         $registrationsHeading = sprintf($GLOBALS['LANG']->getLL('registrationlist.label_registrationsHeading'), htmlspecialchars($event->getTitle()), $event->getUid());
         $newButton = '';
     } else {
         $registrationsHeading = '';
         $newButton = $this->getNewIcon($pageData['uid']);
     }
     $areAnyRegularRegistrationsVisible = $this->setRegistrationTableMarkers(self::REGULAR_REGISTRATIONS);
     $registrationTables = $this->template->getSubpart('REGISTRATION_TABLE');
     $this->setRegistrationTableMarkers(self::REGISTRATIONS_ON_QUEUE);
     $registrationTables .= $this->template->getSubpart('REGISTRATION_TABLE');
     $this->template->setOrDeleteMarkerIfNotEmpty('registrations_heading', $registrationsHeading, '', 'wrapper');
     $this->template->setMarker('new_record_button', $newButton);
     $this->template->setMarker('csv_export_button', $areAnyRegularRegistrationsVisible ? $this->getCsvIcon() : '');
     $this->template->setMarker('complete_table', $registrationTables);
     $this->template->setMarker('label_print_button', $GLOBALS['LANG']->getLL('print'));
     $content .= $this->template->getSubpart('SEMINARS_REGISTRATION_LIST');
     $content .= $this->configCheckWarnings;
     return $content;
 }
 /**
  * Returns an URL that switches sorting to the given sorting field
  *
  * @param array $arguments
  * @return	string
  */
 public function execute(array $arguments = array())
 {
     $sortUrl = '';
     $configuredSortingFields = $this->configuration['search.']['sorting.']['fields.'];
     $sortField = $arguments[0];
     $urlParameters = t3lib_div::_GP('tx_solr');
     $urlSortingParameter = $urlParameters['sort'];
     list($currentSortByField, $currentSortDirection) = explode(' ', $urlSortingParameter);
     if (array_key_exists($sortField, $configuredSortingFields) && $configuredSortingFields[$sortField] == 1) {
         $sortDirection = $this->configuration['search.']['sorting.']['defaultOrder'];
         $sortParameter = $sortField . ' ' . $sortDirection;
         // toggle sorting direction for the current sorting field
         if ($currentSortByField == $sortField) {
             switch ($currentSortDirection) {
                 case 'asc':
                     $sortDirection = 'desc';
                     break;
                 case 'desc':
                     $sortDirection = 'asc';
                     break;
             }
             $sortParameter = $sortField . ' ' . $sortDirection;
         }
         $sortUrl = $this->query->getQueryUrl(array('sort' => $sortParameter));
     }
     return $sortUrl;
 }
コード例 #24
0
 /**
  * Get two-letter continent code.
  *
  * @return string|false Continent code or FALSE on failure
  */
 public function getContinentCode()
 {
     $settings = $this->getExtconfSettings();
     if ($continentCode = t3lib_div::_GP($settings['overrideParameters.']['continent'])) {
         return $continentCode;
     }
     return false;
 }
コード例 #25
0
 /**
  * constructor
  *
  * @param	TYPO3backend	TYPO3 backend object reference
  */
 public function __construct(TYPO3backend &$backendReference = null)
 {
     $this->backendReference = $backendReference;
     $this->changeWorkspace = t3lib_div::_GP('changeWorkspace');
     $this->changeWorkspacePreview = t3lib_div::_GP('changeWorkspacePreview');
     $pageRenderer = t3lib_div::makeInstance('t3lib_pageRenderer');
     $this->backendReference->addJavaScript("TYPO3.Workspaces = { workspaceTitle : '" . tx_Workspaces_Service_Workspaces::getWorkspaceTitle($GLOBALS['BE_USER']->workspace) . "'};\n");
 }
コード例 #26
0
 function main()
 {
     // Initialize FE user object
     $this->feUserObj = tslib_eidtools::initFeUser();
     //Connect to database
     tslib_eidtools::connectDB();
     // sanitize params
     // ticket uid
     $this->ticketUid = intval(t3lib_div::_GP('ticketUid'));
     if (!$this->ticketUid) {
         die;
     }
     // cobj id
     $this->cObjId = intval(t3lib_div::_GP('cobjid'));
     if (!$this->cObjId) {
         die;
     }
     // other params
     $this->storagePid = intval(t3lib_div::_GP('storagePid'));
     $toDoUid = intval(t3lib_div::_GP('toDoUid'));
     $progressValue = intval(t3lib_div::_GP('progressValue'));
     $title = t3lib_div::removeXSS(t3lib_div::_GP('title'));
     $doneStatus = intval(t3lib_div::_GP('doneStatus'));
     $sorting = t3lib_div::_GP('sorting');
     // check user's permissions
     // exit if user has no permission for this ticket
     if (!$this->checkPermission()) {
         exit;
     }
     // switch actions
     switch (t3lib_div::_GP('action')) {
         case 'getToDos':
             echo json_encode($this->getToDos());
             break;
         case 'updateProgress':
             $this->setProgress($progressValue);
             break;
         case 'addToDo':
             $result = $this->addToDo($title, $storagePid);
             if ($result) {
                 echo json_encode($result);
             }
             break;
         case 'updateToDoStatus':
             echo json_encode($this->updateToDoStatus($toDoUid, $doneStatus));
             break;
         case 'removeToDo':
             echo json_encode($this->removeToDo($toDoUid));
             break;
         case 'calculateTicketProgress':
             echo json_encode($this->calculateTicketProgress());
             break;
         case 'updateSorting':
             echo json_encode($this->updateSorting($sorting));
             break;
     }
 }
コード例 #27
0
 /**
  * Performs the logout processing
  *
  * @return	void
  */
 function logout()
 {
     global $BE_USER;
     $BE_USER->writelog(255, 2, 0, 1, 'User %s logged out from TYPO3 Backend', array($BE_USER->user['username']));
     // Logout written to log
     $BE_USER->logoff();
     $redirectUrl = t3lib_div::_GP('redirect') ? t3lib_div::_GP('redirect') : 'index.php';
     t3lib_utility_Http::redirect($redirectUrl);
 }
 /**
  * Render the USER_INT cObject
  *
  * @param	array		Array of TypoScript properties
  * @return	string		Output
  */
 public function render($conf = array())
 {
     $content = parent::render($conf);
     if ($conf['no_esi'] == FALSE && t3lib_div::_GP('from_varnish') == FALSE) {
         $substKey = str_replace(array('<!--', '-->'), '', $content);
         $url = t3lib_div::getIndpEnv('TYPO3_SITE_PATH') . '?id=' . $GLOBALS['TSFE']->id . '&type=978&key=' . $substKey . '&identifier=' . $GLOBALS['TSFE']->newHash . '&from_varnish=1';
         $content = '<esi:include src="' . $url . '" />';
     }
     return $content;
 }
コード例 #29
0
	/**
	 * Performs a move action for the requested element
	 *
	 * @param	array		$params
	 * @param	object		$ajaxObj
	 * @return	void
	 */
	public function moveRecord($params, &$ajaxObj) {

		$sourcePointer = $this->apiObj
			->flexform_getPointerFromString(t3lib_div::_GP('source'));

		$destinationPointer = $this->apiObj
			->flexform_getPointerFromString(t3lib_div::_GP('destination'));

		$this->apiObj->moveElement($sourcePointer, $destinationPointer);
	}
コード例 #30
0
 /**
  * Initialization of module
  *
  * @return	void
  */
 function init()
 {
     global $BE_USER;
     $this->MCONF = $GLOBALS['MCONF'];
     $this->id = intval(t3lib_div::_GP('id'));
     $this->perms_clause = $BE_USER->getPagePermsClause(1);
     // page/be_user TSconfig settings and blinding of menu-items
     $this->modTSconfig = t3lib_BEfunc::getModTSconfig($this->id, 'mod.' . $this->MCONF['name']);
     $this->type = intval($this->modTSconfig['properties']['type']);
 }