/**
     * Main function
     *
     * @return	void
     */
    function main()
    {
        switch ((string) t3lib_div::_GET('cmd')) {
            case 'menuitem':
                echo '
				<img src="gfx/x_t3logo.png" width="61" height="16" hspace="3" alt="" />';
                $menuItems = array(array('title' => 'About TYPO3', 'xurl' => 'http://typo3.com/', 'subitems' => array(array('title' => 'License', 'xurl' => 'http://typo3.com/License.1625.0.html'), array('title' => 'Support', 'subitems' => array(array('title' => 'Mailing lists', 'xurl' => 'http://lists.netfielders.de/cgi-bin/mailman/listinfo'), array('title' => 'Documentation', 'xurl' => 'http://typo3.org/documentation/'), array('title' => 'Find consultancy', 'xurl' => 'http://typo3.com/Consultancies.1248.0.html'))), array('title' => 'Contribute', 'xurl' => 'http://typo3.org/community/participate/'), array('title' => 'Donate', 'xurl' => 'http://typo3.com/Donations.1261.0.html', 'icon' => '1'))), array('title' => 'Extensions', 'url' => 'mod/tools/em/index.php'), array('title' => 'Menu preferences and such things', 'onclick' => 'alert("A dialog is now shown which will allow user configuration of items in the menu");event.stopPropagation();', 'state' => 'checked'), array('title' => '--div--'), array('title' => 'Recent Items', 'id' => $this->id . '_recent', 'subitems' => array(), 'html' => $this->menuItemObject($this->id . '_recent', '
							fetched: false,
							onActivate: function() {
//								if (!this.fetched)	{
									//Element.update("' . $this->id . '_recent-layer","asdfasdf");
									getElementContent("' . $this->id . '_recent-layer", 0, "logomenu.php?cmd=recent")
									this.fetched = true;
//								}
							}
						')), array('title' => '--div--'), array('title' => 'View frontend', 'xurl' => t3lib_div::getIndpEnv('TYPO3_SITE_URL')), array('title' => 'Log out', 'onclick' => "top.document.location='logout.php';"));
                echo $this->menuLayer($menuItems);
                break;
            case 'recent':
                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('sys_log.*, MAX(sys_log.tstamp) AS tstamp_MAX', 'sys_log,pages', 'pages.uid=sys_log.event_pid AND sys_log.userid=' . intval($GLOBALS['BE_USER']->user['uid']) . ' AND sys_log.event_pid>0 AND sys_log.type=1 AND sys_log.action=2 AND sys_log.error=0', 'tablename,recuid', 'tstamp_MAX DESC', 20);
                $items = array();
                while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                    $elRow = t3lib_BEfunc::getRecord($row['tablename'], $row['recuid']);
                    if (is_array($elRow)) {
                        $items[] = array('title' => t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getRecordTitle($row['tablename'], $elRow), $GLOBALS['BE_USER']->uc['titleLen']) . ' - ' . t3lib_BEfunc::calcAge($GLOBALS['EXEC_TIME'] - $row['tstamp_MAX']), 'icon' => array(t3lib_iconworks::getIcon($row['tablename'], $elRow), 'width="18" height="16"'), 'onclick' => 'content.' . t3lib_BEfunc::editOnClick('&edit[' . $row['tablename'] . '][' . $row['recuid'] . ']=edit', '', 'dummy.php'));
                    }
                }
                echo $this->menuItems($items);
                break;
        }
    }
Exemple #2
0
 /**
  * Gets an HTML image tag with the URL of the icon file of the record as
  * configured in TCA.
  *
  * @return string our HTML image tag with the URL of the icon file of
  *                the record or a "not found" icon if there's no icon
  *                for this record
  */
 public function getRecordIcon()
 {
     $iconProperties = array();
     if (t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version) < 6001000) {
         t3lib_div::loadTCA($this->tableName);
     }
     $tableConfiguration =& $GLOBALS['TCA'][$this->tableName]['ctrl'];
     $hiddenColumn = $tableConfiguration['enablecolumns']['disabled'];
     $startTimeColumn = $tableConfiguration['enablecolumns']['starttime'];
     $endTimeColumn = $tableConfiguration['enablecolumns']['endtime'];
     // Checks if there are enable columns configured in TCA and sends them
     // as parameter to t3lib_iconworks::getIcon().
     if ($this->getRecordPropertyBoolean($hiddenColumn)) {
         $iconProperties[$hiddenColumn] = $this->getRecordPropertyInteger($hiddenColumn);
     }
     if ($this->hasRecordPropertyInteger($startTimeColumn)) {
         $iconProperties[$startTimeColumn] = $this->getRecordPropertyInteger($startTimeColumn);
     }
     if ($this->hasRecordPropertyInteger($endTimeColumn)) {
         $iconProperties[$endTimeColumn] = $this->getRecordPropertyInteger($endTimeColumn);
     }
     if (isset($tableConfiguration['typeicon_column'])) {
         $typeIconColumn = $tableConfiguration['typeicon_column'];
         $iconProperties[$typeIconColumn] = $this->getRecordPropertyInteger($typeIconColumn);
     }
     $imageURL = $GLOBALS['BACK_PATH'] . t3lib_iconworks::getIcon($this->tableName, $iconProperties);
     return '<img src="' . $imageURL . '" title="id=' . $this->getUid() . '" alt="' . $this->getUid() . '" />';
 }