Ejemplo n.º 1
0
 /**
  *
  * @param string $lang
  * @return string
  */
 public static function getFlagIconForLanguage($flagName, $options = array())
 {
     $flag = null;
     if (!strlen($flagName)) {
         $flagName = 'unknown';
     }
     $flag = t3lib_iconWorks::getSpriteIcon('flags-' . $flagName, $options);
     return $flag;
 }
 /**
  * Renders an icon link as known from the TYPO3 backend
  *
  * @param string $icon Icon to be used
  * @param string $uri the target URI for the link
  * @param string $title Title attribute of the resulting link
  * @param string $onclick onclick setting
  * @return string the rendered icon link
  */
 public function render($icon = 'closedok', $uri = '', $title = '', $onclick = '')
 {
     $icon = t3lib_iconWorks::getSpriteIcon($icon, array('title' => $title));
     $content = '';
     if (empty($uri) && empty($onclick)) {
         $content = $icon;
     } else {
         $content = '<a onclick="' . htmlspecialchars($onclick) . '" href="' . htmlspecialchars($uri) . '">' . $icon . '</a>';
     }
     return $content;
 }
 /**
  * Creates the selector for workspaces
  *
  * @return	string		workspace selector as HTML select
  */
 public function render()
 {
     $title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:toolbarItems.search', true);
     $this->addJavascriptToBackend();
     $searchMenu = array();
     $searchMenu[] = '<a href="#" class="toolbar-item">' . t3lib_iconWorks::getSpriteIcon('apps-toolbar-menu-search', array('title' => $title)) . '</a>';
     $searchMenu[] = '<div class="toolbar-item-menu" style="display: none;">';
     $searchMenu[] = '<input type="text" id="search-query" name="search-query" value="" />';
     $searchMenu[] = '</div>';
     return implode(LF, $searchMenu);
 }
 /**
  * Adding various standard options to the context menu.
  * This includes both first and second level.
  *
  * @param	object		The calling object. Value by reference.
  * @param	array		Array with the currently collected menu items to show.
  * @param	string		Table name of clicked item.
  * @param	integer		UID of clicked item.
  * @return	array		Modified $menuItems array
  */
 function main(&$backRef, $menuItems, $table, $uid)
 {
     global $BE_USER, $TCA, $LANG;
     $localItems = array();
     // Accumulation of local items.
     // Detecting menu level
     if ($BE_USER->isAdmin() && !$backRef->cmLevel && $table == 'be_users') {
         // LEVEL: Primary menu.
         // "SU" element added:
         $url = 'mod.php?M=tools_beuser&SwitchUser='******'&switchBackUser=1';
         $localItems[] = $backRef->linkItem('Switch To User', $backRef->excludeIcon(t3lib_iconWorks::getSpriteIcon('actions-system-backend-user-emulate')), $backRef->urlRefForCM($url, '', 1, 'top'), 1);
         $menuItems = array_merge($menuItems, $localItems);
     }
     return $menuItems;
 }
	/**
	 * Creates the button with link to either forward or reverse
	 *
	 * @param	string		Type: "fwd" or "rwd"
	 * @param	integer		Pointer
	 * @param	string		Table name
	 * @return	string
	 */
	function fwd_rwd_HTML($type,$pointer,$table='')	{
		$content = '';
		switch($type)	{
			case 'fwd':
				$href = $this->returnUrl . '&SET[recordsView_start]='.($pointer-$this->iLimit).'&SET[recordsView_table]='.$table;
				$content = '<a href="'.htmlspecialchars($href).'">'.
						t3lib_iconWorks::getSpriteIcon('actions-move-up').
						'</a> <i>[1 - '.$pointer.']</i>';
			break;
			case 'rwd':
				$href = $this->returnUrl . '&SET[recordsView_start]='.$pointer.'&SET[recordsView_table]='.$table;
				$content = '<a href="'.htmlspecialchars($href).'">'.
						t3lib_iconWorks::getSpriteIcon('actions-move-down').
						'</a> <i>['.($pointer+1).' - '.$this->totalItems.']</i>';
			break;
		}
		return $content;
	}
 /**
  * renders the toolbar menu
  *
  * @return	string	the rendered backend menu
  * @author	Ingo Renner <*****@*****.**>
  */
 public function render()
 {
     $actionMenu = array();
     $actionEntries = $this->getActionEntries();
     if ($actionEntries) {
         $this->addJavascriptToBackend();
         $this->addCssToBackend();
         $title = $GLOBALS['LANG']->getLL('action_toolbaritem', TRUE);
         $actionMenu[] = '<a href="#" class="toolbar-item">' . t3lib_iconWorks::getSpriteIcon('apps-toolbar-menu-actions', array('title' => $title)) . '</a>';
         $actionMenu[] = '<ul class="toolbar-item-menu" style="display: none;">';
         foreach ($actionEntries as $linkConf) {
             $actionMenu[] = '<li><a href="' . htmlspecialchars($linkConf[1]) . '" target="content">' . $linkConf[2] . htmlspecialchars($linkConf[0]) . '</a></li>';
         }
         $actionMenu[] = '</ul>';
         return implode("\n", $actionMenu);
     } else {
         return '';
     }
 }
	/**
	 *
	 * @param string $lang
	 * @return string
	 */
	public static function getFlagIconForLanguage($flagName, $options = array()) {

		$flag = null;
		if (!strlen($flagName)) {
			$flagName = 'unknown';
		}
		if (tx_templavoila_div::convertVersionNumberToInteger(TYPO3_version) < 4005000) {
		   if ($flagName == 'unknown') {
				   $flagName = $flagName . '.gif';
		   } elseif($flagName == 'multiple') {
				   $flagName = 'multi-language.gif';
		   }
		   $alt = isset($options['alt']) ? ' alt="' . $options['alt'] . '"' : ' alt=""';
		   $title = isset($options['title']) ? ' title="' . $options['title'] . '"' : '';
		   $flag = '<img src="' . self::getFlagIconFileForLanguage($flagName) . '"'. $title . $alt .'/>';
		} else {
		   $flag = t3lib_iconWorks::getSpriteIcon('flags-' . $flagName, $options);
		}
		return $flag;

	}
Ejemplo n.º 8
0
 /**
  * Processing of clickmenu items
  *
  * @param object $backRef Reference to parent
  * @param array $menuItems Menu items array to modify
  * @param string $table Table name
  * @param integer $uid Uid of the record
  * @return array Menu item array, returned after modification
  * @todo Skinning for icons...
  * @todo Define visibility
  */
 public function main(&$backRef, $menuItems, $table, $uid)
 {
     $localItems = array();
     // Show import/export on second level menu OR root level.
     if ($backRef->cmLevel && \t3lib_div::_GP('subname') == 'moreoptions' || $table === 'pages' && $uid == 0) {
         $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);
 }
    /**
     * Creates the control panel for a single record in the listing.
     *
     * @param	string		The table
     * @param	array		The record for which to make the control panel.
     * @return	string		HTML table with the control panel (unless disabled)
     */
    function makeControl($table, $row)
    {
        global $TCA, $LANG, $BACK_PATH;
        // Return blank, if disabled:
        #		if ($this->dontShowClipControlPanels)	return '';
        // Initialize:
        t3lib_div::loadTCA($table);
        $cells = array();
        $shEl = $this->showElements;
        // If the listed table is 'pages' we have to request the permission settings for each page:
        if ($table == 'pages') {
            $localCalcPerms = $GLOBALS['BE_USER']->calcPerms(t3lib_BEfunc::getRecord('pages', $row['uid']));
        }
        // This expresses the edit permissions for this particular element:
        $permsEdit = $table == 'pages' && $localCalcPerms & 2 || $table != 'pages' && $this->calcPerms & 16;
        // "Edit" link: ( Only if permissions to edit the page-record of the content of the parent page ($this->id)
        if ($permsEdit && in_array('editRec', $shEl)) {
            $params = '&edit[' . $table . '][' . $row['uid'] . ']=edit';
            $icon = '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/edit2' . (!$TCA[$table]['ctrl']['readOnly'] ? '' : '_d') . '.gif', 'width="11" height="12"') . ' title="' . $LANG->getLL('edit', 1) . '" alt="" />';
            $cells[] = $this->wrapEditLink($icon, $params);
        }
        // If the extended control panel is enabled OR if we are seeing a single table:
        if ($GLOBALS['SOBE']->MOD_SETTINGS['bigControlPanel'] || $this->table) {
            // "Info": (All records)
            if (in_array('infoRec', $shEl)) {
                $cells[] = '<a href="#" onclick="' . htmlspecialchars('top.launchView(\'' . $table . '\', \'' . $row['uid'] . '\'); return false;') . '">' . '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/zoom2.gif', 'width="12" height="12"') . ' title="' . $LANG->getLL('showInfo', 1) . '" alt="" />' . '</a>';
            }
            // If the table is NOT a read-only table, then show these links:
            if (!$TCA[$table]['ctrl']['readOnly']) {
                // "Revert" link (history/undo)
                if (in_array('revertRec', $shEl)) {
                    $cells[] = '<a href="#" onclick="' . htmlspecialchars('return jumpExt(\'' . $this->backPath . 'show_rechis.php?element=' . rawurlencode($table . ':' . $row['uid']) . '\',\'#latest\');') . '">' . '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/history2.gif', 'width="13" height="12"') . ' title="' . $LANG->getLL('history', 1) . '" alt="" />' . '</a>';
                }
                // Versioning:
                if (t3lib_extMgm::isLoaded('version')) {
                    $vers = t3lib_BEfunc::selectVersionsOfRecord($table, $row['uid'], $fields = 'uid');
                    if (is_array($vers)) {
                        // If table can be versionized.
                        if (count($vers) > 1) {
                            $st = 'background-color: #FFFF00; font-weight: bold;';
                            $lab = count($vers) - 1;
                        } else {
                            $st = 'background-color: #9999cc; font-weight: bold;';
                            $lab = 'V';
                        }
                        $cells[] = '<a href="' . htmlspecialchars($this->backPath . t3lib_extMgm::extRelPath('version')) . 'cm1/index.php?table=' . rawurlencode($table) . '&uid=' . rawurlencode($row['uid']) . '" class="typo3-ctrl-versioning" style="' . htmlspecialchars($st) . '">' . $lab . '</a>';
                    }
                }
                // "Edit Perms" link:
                if ($table == 'pages' && in_array('permsRec', $shEl) && $GLOBALS['BE_USER']->check('modules', 'web_perm')) {
                    $cells[] = '<a href="' . htmlspecialchars($this->backPath . 'mod/web/perm/index.php?id=' . $row['uid'] . '&return_id=' . $row['uid'] . '&edit=1') . '">' . '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/perm.gif', 'width="7" height="12"') . ' title="' . $LANG->getLL('permissions', 1) . '" alt="" />' . '</a>';
                }
                // "Up/Down" links
                if ($permsEdit && $TCA[$table]['ctrl']['sortby'] && !$this->sortField && in_array('sortRec', $shEl)) {
                    //
                    if (isset($this->currentTable['prev'][$row['uid']])) {
                        // Up
                        $params = '&cmd[' . $table . '][' . $row['uid'] . '][move]=' . $this->currentTable['prev'][$row['uid']];
                        $cells[] = '<a href="#" onclick="' . htmlspecialchars('return jumpToUrl(\'' . $GLOBALS['SOBE']->doc->issueCommand($params, -1) . '\');') . '">' . '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/button_up.gif', 'width="11" height="10"') . ' title="' . $LANG->getLL('moveUp', 1) . '" alt="" />' . '</a>';
                    } else {
                        $cells[] = '<img src="clear.gif" ' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/button_up.gif', 'width="11" height="10"', 2) . ' alt="" />';
                    }
                    if ($this->currentTable['next'][$row['uid']]) {
                        // Down
                        $params = '&cmd[' . $table . '][' . $row['uid'] . '][move]=' . $this->currentTable['next'][$row['uid']];
                        $cells[] = '<a href="#" onclick="' . htmlspecialchars('return jumpToUrl(\'' . $GLOBALS['SOBE']->doc->issueCommand($params, -1) . '\');') . '">' . '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/button_down.gif', 'width="11" height="10"') . ' title="' . $LANG->getLL('moveDown', 1) . '" alt="" />' . '</a>';
                    } else {
                        $cells[] = '<img src="clear.gif" ' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/button_down.gif', 'width="11" height="10"', 2) . ' alt="" />';
                    }
                }
                // "Hide/Unhide" links:
                $hiddenField = $TCA[$table]['ctrl']['enablecolumns']['disabled'];
                if ($permsEdit && $hiddenField && $TCA[$table]['columns'][$hiddenField] && in_array('unHideRec', $shEl) && (!$TCA[$table]['columns'][$hiddenField]['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields', $table . ':' . $hiddenField))) {
                    if ($row[$hiddenField]) {
                        $params = '&data[' . $table . '][' . $row['uid'] . '][' . $hiddenField . ']=0';
                        $cells[] = '<a title="' . $LANG->getLL('unHide' . ($table == 'pages' ? 'Page' : ''), 1) . '" href="#" onclick="' . htmlspecialchars('return jumpToUrl(\'' . $GLOBALS['SOBE']->doc->issueCommand($params, -1) . '\');') . '">' . t3lib_iconWorks::getSpriteIcon('actions-edit-unhide') . '</a>';
                    } else {
                        $params = '&data[' . $table . '][' . $row['uid'] . '][' . $hiddenField . ']=1';
                        $cells[] = '<a title="' . $LANG->getLL('hide' . ($table == 'pages' ? 'Page' : ''), 1) . '" href="#" onclick="' . htmlspecialchars('return jumpToUrl(\'' . $GLOBALS['SOBE']->doc->issueCommand($params, -1) . '\');') . '">' . t3lib_iconWorks::getSpriteIcon('actions-edit-hide') . '</a>';
                    }
                }
                // "Delete" link:
                //				if ( ($table=='pages' && ($localCalcPerms&4)) || ($table!='pages' && ($this->calcPerms&16)) && in_array('delRec',$shEl) )	{
                //					$params='&cmd['.$table.']['.$row['uid'].'][delete]=1';
                //					$title = $row['title'].' ('.$row['file_name'].')';
                //
                //					$cells[]='<a href="#" onclick="if (confirm('.$GLOBALS['LANG']->JScharCode(sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.delete'),$title)).')) {jumpToUrl(\''.$GLOBALS['SOBE']->doc->issueCommand($params,-1).'\');} return false;"><img src="'.$this->backPath.'gfx/delete_record.gif" width="12" height="12" border="0" align="top" title="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:cm.delete',1).'" /></a>';
                //				}
                // ToDo: weird: quickDelete = true means that there is a confirmation message
                // Todo: quickDelete=true is hardcoded
                $quickDelete = true;
                // "Delete" with confirmation (default)
                if ($quickDelete and $table == 'pages' && $localCalcPerms & 4 || $table != 'pages' && $this->calcPerms & 16 && in_array('delRec', $shEl)) {
                    $params = '&cmd[tx_dam_cat][' . $row['uid'] . '][delete]=1';
                    $title = $row['title'] . ' (' . $row['file_name'] . ')';
                    $onClick = 'if (confirm(' . $GLOBALS['LANG']->JScharCode(sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.delete'), $title)) . ')) {jumpToUrl(\'' . $GLOBALS['SOBE']->doc->issueCommand($params, -1) . '\');} return false;';
                    $cells[] = '<a title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:cm.delete', 1) . '" href="#" onclick="' . $onClick . '">' . t3lib_iconWorks::getSpriteIcon('actions-edit-delete') . '</a>';
                }
                // Todo: Quick delete. Works but without redirect back to the overview.
                if (!$quickDelete and $table == 'pages' && $localCalcPerms & 4 || $table != 'pages' && $this->calcPerms & 16 && in_array('delRec', $shEl)) {
                    $cmd = 'tx_dam_cmd_filedelete';
                    $script = $BACK_PATH . PATH_txdam_rel . 'mod_cmd/index.php?CMD=' . $cmd . '&vC=' . $GLOBALS['BE_USER']->veriCode() . '&id=' . rawurlencode($row['uid']) . '&returnUrl=' . t3lib_div::getIndpEnv('TYPO3_REQUEST_URL');
                    $cells[] = '<a href="' . htmlspecialchars($script) . '">' . '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/delete_record.gif', 'width="12" height="12"') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:cm.delete', 1) . '" alt="" />' . '</a>';
                }
            }
        }
        // If the record is edit-locked	by another user, we will show a little warning sign:
        if ($lockInfo = t3lib_BEfunc::isRecordLocked($table, $row['uid'])) {
            $cells[] = '<a href="#" onclick="' . htmlspecialchars('alert(' . $LANG->JScharCode($lockInfo['msg']) . ');return false;') . '">' . '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/recordlock_warning3.gif', 'width="17" height="12"') . ' title="' . htmlspecialchars($lockInfo['msg']) . '" alt="" />' . '</a>';
        }
        // Compile items into a DIV-element:
        return '
											<!-- CONTROL PANEL: ' . $table . ':' . $row['uid'] . ' -->
											<div class="typo3-DBctrl">' . implode('', $cells) . '</div>';
    }
Ejemplo n.º 10
0
    /**
     * Create the panel of buttons for submitting the form or otherwise perform operations.
     *
     * @return	array	all available buttons as an assoc. array
     */
    protected function getButtons()
    {
        global $TCA, $LANG, $BACK_PATH, $BE_USER;
        $buttons = array('csh' => '', 'view' => '', 'record_list' => '', 'shortcut' => '');
        // CSH
        $buttons['csh'] = t3lib_BEfunc::cshItem('_MOD_web_func', '', $GLOBALS['BACK_PATH'], '', TRUE);
        if ($this->id && is_array($this->pageinfo)) {
            // View page
            $buttons['view'] = '<a href="#"
					onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($this->pageinfo['uid'], $BACK_PATH, t3lib_BEfunc::BEgetRootLine($this->pageinfo['uid']))) . '"
					title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', 1) . '
				">' . t3lib_iconWorks::getSpriteIcon('actions-document-view') . '</a>';
            // Shortcut
            if ($BE_USER->mayMakeShortcut()) {
                $buttons['shortcut'] = $this->doc->makeShortcutIcon('id, edit_record, pointer, new_unique_uid, search_field, search_levels, showLimit', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']);
            }
            // If access to Web>List for user, then link to that module.
            if ($BE_USER->check('modules', 'web_list')) {
                $href = $BACK_PATH . 'db_list.php?id=' . $this->pageinfo['uid'] . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'));
                $buttons['record_list'] = '<a href="' . htmlspecialchars($href) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList', 1) . '">' . t3lib_iconWorks::getSpriteIcon('actions-system-list-open') . '</a>';
            }
        }
        return $buttons;
    }
Ejemplo n.º 11
0
 /**
  * Create the panel of buttons for submitting the form or otherwise perform operations.
  *
  * @return	array	all available buttons as an assoc. array
  */
 protected function getButtons()
 {
     global $LANG, $BACK_PATH;
     $buttons = array('csh' => '', 'back' => '');
     if ($this->page_id) {
         if ((string) $this->table == 'pages') {
             // CSH
             $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'move_el_pages', $GLOBALS['BACK_PATH'], '', TRUE);
         } elseif ((string) $this->table == 'tt_content') {
             // CSH
             $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'move_el_cs', $GLOBALS['BACK_PATH'], '', TRUE);
         }
         if ($this->R_URI) {
             // Back
             $buttons['back'] = '<a href="' . htmlspecialchars($this->R_URI) . '" class="typo3-goBack" title="' . $LANG->getLL('goBack', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-view-go-back') . '</a>';
         }
     }
     return $buttons;
 }
Ejemplo n.º 12
0
    /**
     * Showing the permissions in a tree ($this->edit = false)
     * (Adding content to internal content variable)
     *
     * @return	void
     */
    public function notEdit()
    {
        global $BE_USER, $LANG, $BACK_PATH;
        // Get usernames and groupnames: The arrays we get in return contains only 1) users which are members of the groups of the current user, 2) groups that the current user is member of
        $beGroupKeys = $BE_USER->userGroupsUID;
        $beUserArray = t3lib_BEfunc::getUserNames();
        if (!$GLOBALS['BE_USER']->isAdmin()) {
            $beUserArray = t3lib_BEfunc::blindUserNames($beUserArray, $beGroupKeys, 0);
        }
        $beGroupArray = t3lib_BEfunc::getGroupNames();
        if (!$GLOBALS['BE_USER']->isAdmin()) {
            $beGroupArray = t3lib_BEfunc::blindGroupNames($beGroupArray, $beGroupKeys, 0);
        }
        // Length of strings:
        $tLen = $this->MOD_SETTINGS['mode'] == 'perms' ? 20 : 30;
        // Selector for depth:
        $code .= $LANG->getLL('Depth') . ': ';
        $code .= t3lib_BEfunc::getFuncMenu($this->id, 'SET[depth]', $this->MOD_SETTINGS['depth'], $this->MOD_MENU['depth']);
        $this->content .= $this->doc->section('', $code);
        $this->content .= $this->doc->spacer(5);
        // Initialize tree object:
        $tree = t3lib_div::makeInstance('t3lib_pageTree');
        $tree->init('AND ' . $this->perms_clause);
        $tree->addField('perms_user', 1);
        $tree->addField('perms_group', 1);
        $tree->addField('perms_everybody', 1);
        $tree->addField('perms_userid', 1);
        $tree->addField('perms_groupid', 1);
        $tree->addField('hidden');
        $tree->addField('fe_group');
        $tree->addField('starttime');
        $tree->addField('endtime');
        $tree->addField('editlock');
        // Creating top icon; the current page
        $HTML = t3lib_iconWorks::getSpriteIconForRecord('pages', $this->pageinfo);
        $tree->tree[] = array('row' => $this->pageinfo, 'HTML' => $HTML);
        // Create the tree from $this->id:
        $tree->getTree($this->id, $this->MOD_SETTINGS['depth'], '');
        // Make header of table:
        $code = '';
        if ($this->MOD_SETTINGS['mode'] == 'perms') {
            $code .= '
				<tr class="t3-row-header">
					<td colspan="2">&nbsp;</td>
					<td><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td>' . $LANG->getLL('Owner', TRUE) . '</td>
					<td><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td align="center">' . $LANG->getLL('Group', TRUE) . '</td>
					<td><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td align="center">' . $LANG->getLL('Everybody', TRUE) . '</td>
					<td><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td align="center">' . $LANG->getLL('EditLock', TRUE) . '</td>
				</tr>
			';
        } else {
            $code .= '
				<tr class="t3-row-header">
					<td colspan="2">&nbsp;</td>
					<td><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td align="center" nowrap="nowrap">' . $LANG->getLL('User', TRUE) . ': ' . htmlspecialchars($BE_USER->user['username']) . '</td>
					' . (!$BE_USER->isAdmin() ? '<td><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td align="center">' . $LANG->getLL('EditLock', TRUE) . '</td>' : '') . '
				</tr>';
        }
        // Traverse tree:
        foreach ($tree->tree as $data) {
            $cells = array();
            $pageId = $data['row']['uid'];
            // Background colors:
            $bgCol = $this->lastEdited == $pageId ? ' class="bgColor-20"' : '';
            $lE_bgCol = $bgCol;
            // User/Group names:
            $userName = $beUserArray[$data['row']['perms_userid']] ? $beUserArray[$data['row']['perms_userid']]['username'] : ($data['row']['perms_userid'] ? $data['row']['perms_userid'] : '');
            if ($data['row']['perms_userid'] && !$beUserArray[$data['row']['perms_userid']]) {
                $userName = SC_mod_web_perm_ajax::renderOwnername($pageId, $data['row']['perms_userid'], htmlspecialchars(t3lib_div::fixed_lgd_cs($userName, 20)), false);
            } else {
                $userName = SC_mod_web_perm_ajax::renderOwnername($pageId, $data['row']['perms_userid'], htmlspecialchars(t3lib_div::fixed_lgd_cs($userName, 20)));
            }
            $groupName = $beGroupArray[$data['row']['perms_groupid']] ? $beGroupArray[$data['row']['perms_groupid']]['title'] : ($data['row']['perms_groupid'] ? $data['row']['perms_groupid'] : '');
            if ($data['row']['perms_groupid'] && !$beGroupArray[$data['row']['perms_groupid']]) {
                $groupName = SC_mod_web_perm_ajax::renderGroupname($pageId, $data['row']['perms_groupid'], htmlspecialchars(t3lib_div::fixed_lgd_cs($groupName, 20)), false);
            } else {
                $groupName = SC_mod_web_perm_ajax::renderGroupname($pageId, $data['row']['perms_groupid'], htmlspecialchars(t3lib_div::fixed_lgd_cs($groupName, 20)));
            }
            // Seeing if editing of permissions are allowed for that page:
            $editPermsAllowed = $data['row']['perms_userid'] == $BE_USER->user['uid'] || $BE_USER->isAdmin();
            // First column:
            $cellAttrib = $data['row']['_CSSCLASS'] ? ' class="' . $data['row']['_CSSCLASS'] . '"' : '';
            $cells[] = '
					<td align="left" nowrap="nowrap"' . ($cellAttrib ? $cellAttrib : $bgCol) . '>' . $data['HTML'] . htmlspecialchars(t3lib_div::fixed_lgd_cs($data['row']['title'], $tLen)) . '&nbsp;</td>';
            // "Edit permissions" -icon
            if ($editPermsAllowed && $pageId) {
                $aHref = 'index.php?mode=' . $this->MOD_SETTINGS['mode'] . '&depth=' . $this->MOD_SETTINGS['depth'] . '&id=' . ($data['row']['_ORIG_uid'] ? $data['row']['_ORIG_uid'] : $pageId) . '&return_id=' . $this->id . '&edit=1';
                $cells[] = '
					<td' . $bgCol . '><a href="' . htmlspecialchars($aHref) . '" title="' . $LANG->getLL('ch_permissions', 1) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a></td>';
            } else {
                $cells[] = '
					<td' . $bgCol . '></td>';
            }
            // Rest of columns (depending on mode)
            if ($this->MOD_SETTINGS['mode'] == 'perms') {
                $cells[] = '
					<td' . $bgCol . ' class="center"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td' . $bgCol . ' nowrap="nowrap">' . ($pageId ? SC_mod_web_perm_ajax::renderPermissions($data['row']['perms_user'], $pageId, 'user') . ' ' . $userName : '') . '</td>

					<td' . $bgCol . ' class="center"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td' . $bgCol . ' nowrap="nowrap">' . ($pageId ? SC_mod_web_perm_ajax::renderPermissions($data['row']['perms_group'], $pageId, 'group') . ' ' . $groupName : '') . '</td>

					<td' . $bgCol . ' class="center"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td' . $bgCol . ' nowrap="nowrap">' . ($pageId ? ' ' . SC_mod_web_perm_ajax::renderPermissions($data['row']['perms_everybody'], $pageId, 'everybody') : '') . '</td>

					<td' . $bgCol . ' class="center"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td' . $bgCol . ' nowrap="nowrap">' . ($data['row']['editlock'] ? '<span id="el_' . $pageId . '" class="editlock"><a class="editlock" onclick="WebPermissions.toggleEditLock(\'' . $pageId . '\', \'1\');" title="' . $LANG->getLL('EditLock_descr', 1) . '">' . t3lib_iconWorks::getSpriteIcon('status-warning-lock') . '</a></span>' : ($pageId === 0 ? '' : '<span id="el_' . $pageId . '" class="editlock"><a class="editlock" onclick="WebPermissions.toggleEditLock(\'' . $pageId . '\', \'0\');" title="Enable the &raquo;Admin-only&laquo; edit lock for this page">[+]</a></span>')) . '</td>
				';
            } else {
                $cells[] = '
					<td' . $bgCol . ' class="center"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>';
                $bgCol = $BE_USER->user['uid'] == $data['row']['perms_userid'] ? ' class="bgColor-20"' : $lE_bgCol;
                // FIXME $owner undefined
                $cells[] = '
					<td' . $bgCol . ' nowrap="nowrap" align="center">' . ($pageId ? $owner . SC_mod_web_perm_ajax::renderPermissions($BE_USER->calcPerms($data['row']), $pageId, 'user') : '') . '</td>
					' . (!$BE_USER->isAdmin() ? '
					<td' . $bgCol . ' class="center"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td' . $bgCol . ' nowrap="nowrap">' . ($data['row']['editlock'] ? t3lib_iconWorks::getSpriteIcon('status-warning-lock', array('title' => $LANG->getLL('EditLock_descr', TRUE))) : '') . '</td>
					' : '');
                $bgCol = $lE_bgCol;
            }
            // Compile table row:
            $code .= '
				<tr>
					' . implode('
					', $cells) . '
				</tr>';
        }
        // Wrap rows in table tags:
        $code = '<table border="0" cellspacing="0" cellpadding="0" id="typo3-permissionList">' . $code . '</table>';
        // Adding the content as a section:
        $this->content .= $this->doc->section('', $code);
        // CSH for permissions setting
        $this->content .= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'perm_module', $GLOBALS['BACK_PATH'], '<br />|');
        // Creating legend table:
        $legendText = '<strong>' . $LANG->getLL('1', 1) . '</strong>: ' . $LANG->getLL('1_t', 1);
        $legendText .= '<br /><strong>' . $LANG->getLL('16', 1) . '</strong>: ' . $LANG->getLL('16_t', 1);
        $legendText .= '<br /><strong>' . $LANG->getLL('2', 1) . '</strong>: ' . $LANG->getLL('2_t', 1);
        $legendText .= '<br /><strong>' . $LANG->getLL('4', 1) . '</strong>: ' . $LANG->getLL('4_t', 1);
        $legendText .= '<br /><strong>' . $LANG->getLL('8', 1) . '</strong>: ' . $LANG->getLL('8_t', 1);
        $code = '<table border="0" id="typo3-legendTable">
			<tr>
				<td valign="top">
					<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/legend.gif', 'width="86" height="75"') . ' alt="" />
				</td>
				<td valign="top" nowrap="nowrap">' . $legendText . '</td>
			</tr>
		</table>';
        $code .= '<div id="perm-legend">' . $LANG->getLL('def', 1);
        $code .= '<br /><br />' . t3lib_iconWorks::getSpriteIcon('status-status-permission-granted') . ': ' . $LANG->getLL('A_Granted', 1);
        $code .= '<br />' . t3lib_iconWorks::getSpriteIcon('status-status-permission-denied') . ': ' . $LANG->getLL('A_Denied', 1);
        $code .= '</div>';
        // Adding section with legend code:
        $this->content .= $this->doc->spacer(20);
        $this->content .= $this->doc->section($LANG->getLL('Legend') . ':', $code, 0, 1);
    }
    /**
     * returns the recent documents list as an array
     *
     * @return	array	all recent documents as list-items
     */
    public function renderMenuEntry($document, $md5sum, $isRecentDoc = false, $isFirstDoc = false)
    {
        $table = $document[3]['table'];
        $uid = $document[3]['uid'];
        $record = t3lib_BEfunc::getRecordWSOL($table, $uid);
        if (!is_array($record)) {
            // record seems to be deleted
            return '';
        }
        $label = htmlspecialchars(strip_tags(t3lib_div::htmlspecialchars_decode($document[0])));
        $icon = t3lib_iconWorks::getSpriteIconForRecord($table, $record);
        $link = $GLOBALS['BACK_PATH'] . 'alt_doc.php?' . $document[2];
        $firstRow = '';
        if ($isFirstDoc) {
            $firstRow = ' first-row';
        }
        if (!$isRecentDoc) {
            $title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:rm.closeDoc', true);
            // open document
            $closeIcon = t3lib_iconWorks::getSpriteIcon('actions-document-close');
            $entry = '
				<tr class="opendoc' . $firstRow . '">
					<td class="icon">' . $icon . '</td>
					<td class="label"><a href="#" onclick="jump(unescape(\'' . htmlspecialchars($link) . '\'), \'web_list\', \'web\'); TYPO3BackendOpenDocs.toggleMenu(); return false;" target="content">' . $label . '</a></td>
					<td class="close" onclick="return TYPO3BackendOpenDocs.closeDocument(\'' . $md5sum . '\');">' . $closeIcon . '</td>
				</tr>';
        } else {
            // recently used document
            $entry = '
				<tr class="recentdoc' . $firstRow . '">
					<td class="icon">' . $icon . '</td>
					<td class="label" colspan="2"><a href="#" onclick="jump(unescape(\'' . htmlspecialchars($link) . '\'), \'web_list\', \'web\'); TYPO3BackendOpenDocs.toggleMenu(); return false;" target="content">' . $label . '</a></td>
				</tr>';
        }
        return $entry;
    }
Ejemplo n.º 14
0
 /**
  * Render the bottom controls which (might) contain the new, browse and paste-buttons
  * which sit below each content element
  *
  * @param array $elementPointer
  * @param boolean $canCreateNew
  * @return string
  */
 protected function link_bottomControls($elementPointer, $canCreateNew)
 {
     $output = '<span class="tpm-bottom-controls">';
     // "New" icon:
     if ($canCreateNew && !in_array('new', $this->blindIcons)) {
         $iconOptions = array('title' => $GLOBALS['LANG']->getLL('createnewrecord'));
         $newIcon = t3lib_iconWorks::getSpriteIcon('actions-document-new', $iconOptions);
         $output .= $this->link_new($newIcon, $elementPointer);
     }
     // "Browse Record" icon
     if ($canCreateNew && !in_array('browse', $this->blindIcons)) {
         $iconOptions = array('title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.browse_db'), 'class' => 'browse');
         $newIcon = t3lib_iconWorks::getSpriteIcon('actions-insert-record', $iconOptions);
         $output .= $this->link_browse($newIcon, $elementPointer);
     }
     // "Paste" icon
     if ($canCreateNew) {
         $output .= '<span class="sortablePaste">' . $this->clipboardObj->element_getPasteButtons($elementPointer) . '&nbsp;</span>';
     }
     $output .= '</span>';
     return $output;
 }
Ejemplo n.º 15
0
 function Typo3Icon($class, $label = '')
 {
     if ($this->iconWorks) {
         return t3lib_iconWorks::getSpriteIcon($class);
     } else {
         return $label ? '[' . $label . ']' : '';
     }
 }
Ejemplo n.º 16
0
 /**
  * Returns the Datepicker img
  *
  * @param event Tx_WoehrlSeminare_Domain_Model_Event
  * @return string html output
  */
 protected function getDatePickerIcon()
 {
     return t3lib_iconWorks::getSpriteIcon('actions-edit-pick-date', array('style' => 'cursor:pointer;', 'id' => 'picker-tceforms-datefield-1'));
     return '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/datepicker.gif', '', 0) . ' style="cursor:pointer; vertical-align:middle;" alt=""' . ' id="picker-tceforms-datetimefield-1" />';
 }
Ejemplo n.º 17
0
 /**
  * Creates a link on a property.
  *
  * @param	string		String to link
  * @param	string		Property value.
  * @param	string		Object path prefix to value
  * @param	string		Data type
  * @return	string		Linked $str
  */
 function linkProperty($str, $propertyName, $prefix, $datatype)
 {
     $out = '';
     // Setting preset value:
     if (strstr($datatype, 'boolean')) {
         $propertyVal = '1';
         // preset "1" to boolean values.
     }
     // Adding mixer features; The plus icon:
     if (!$this->onlyProperty) {
         $aOnClick = 'document.editform.mixer.value=unescape(\'  ' . rawurlencode($propertyName . '=' . $propertyVal) . '\')+\'\\n\'+document.editform.mixer.value; return false;';
         $out .= '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . t3lib_iconWorks::getSpriteIcon('actions-edit-add', array('title' => $GLOBALS['LANG']->getLL('tsprop_addToList', TRUE))) . '</a>';
         $propertyName = $prefix . '.' . $propertyName;
     }
     // Wrap string:
     $aOnClick = 'setValue(unescape(\'' . rawurlencode($propertyName) . '\'),unescape(\'' . rawurlencode($propertyVal) . '\')); return false;';
     $out .= '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $str . '</a>';
     // Return link:
     return $out;
 }
Ejemplo n.º 18
0
 /**
  * Create the panel of buttons for submitting the form or otherwise perform operations.
  *
  * @return array all available buttons as an associated array
  */
 protected function getButtons()
 {
     $buttons = array('view' => '', 'record_list' => '', 'shortcut' => '');
     if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
         $buttons['shortcut'] = $this->doc->makeShortcutIcon('tx_impexp', '', $this->MCONF['name']);
     }
     // Input data grabbed:
     $inData = t3lib_div::_GP('tx_impexp');
     if ((string) $inData['action'] == 'import') {
         if ($this->id && is_array($this->pageinfo) || $GLOBALS['BE_USER']->user['admin'] && !$this->id) {
             if (is_array($this->pageinfo) && $this->pageinfo['uid']) {
                 // View
                 $buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($this->pageinfo['uid'], $this->doc->backPath, t3lib_BEfunc::BEgetRootLine($this->pageinfo['uid']))) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-view') . '</a>';
                 // Record list
                 if ($GLOBALS['BE_USER']->check('modules', 'web_list')) {
                     $href = $this->doc->backPath . 'db_list.php?id=' . $this->pageinfo['uid'] . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'));
                     $buttons['record_list'] = '<a href="' . htmlspecialchars($href) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-system-list-open') . '</a>';
                 }
             }
         }
     }
     return $buttons;
 }
 /**
  * Create the panel of buttons for submitting the form or otherwise perform operations.
  *
  * @return	array	all available buttons as an assoc. array
  */
 protected function getButtons()
 {
     $buttons = array('csh' => '', 'refresh' => '');
     // Refresh
     $buttons['refresh'] = '<a href="' . htmlspecialchars(t3lib_div::getIndpEnv('REQUEST_URI')) . '">' . t3lib_iconWorks::getSpriteIcon('actions-system-refresh') . '</a>';
     // CSH
     $buttons['csh'] = str_replace('typo3-csh-inline', 'typo3-csh-inline show-right', t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'filetree', $GLOBALS['BACK_PATH']));
     return $buttons;
 }
Ejemplo n.º 20
0
 /**
  * Setting page icon with clickmenu + uid for docheader
  *
  * @param 	array	Current page
  * @return	string	Page info
  */
 protected function getPageInfo($pageRecord)
 {
     global $BE_USER;
     // 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' => $alttext));
         // Make Icon:
         $theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($iconImg, 'pages', $pageRecord['uid']);
         $uid = $pageRecord['uid'];
         $title = t3lib_BEfunc::getRecordTitle('pages', $pageRecord);
     } else {
         // On root-level of page tree
         // Make Icon
         $iconImg = t3lib_iconWorks::getSpriteIcon('apps-pagetree-root', array('title' => $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']));
         if ($BE_USER->user['admin']) {
             $theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($iconImg, 'pages', 0);
         } else {
             $theIcon = $iconImg;
         }
         $uid = '0';
         $title = $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
     }
     // Setting icon with clickmenu + uid
     $pageInfo = $theIcon . '<strong>' . htmlspecialchars($title) . '&nbsp;[' . $uid . ']</strong>';
     return $pageInfo;
 }
    /**
     * [Describe function...]
     *
     * @param	[type]		$row: ...
     * @param	[type]		$conf: ...
     * @param	[type]		$table: ...
     * @return	[type]		...
     */
    function resultRowDisplay($row, $conf, $table)
    {
        static $even = FALSE;
        $tce = t3lib_div::makeInstance('t3lib_TCEmain');
        $SET = $GLOBALS['SOBE']->MOD_SETTINGS;
        $out = '<tr class="bgColor' . ($even ? '6' : '4') . '">';
        $even = !$even;
        foreach ($row as $fN => $fV) {
            if (t3lib_div::inList($SET['queryFields'], $fN) || !$SET['queryFields'] && $fN != 'pid' && $fN != 'deleted') {
                if ($SET['search_result_labels']) {
                    $fVnew = $this->getProcessedValueExtra($table, $fN, $fV, $conf, '<br />');
                } else {
                    $fVnew = htmlspecialchars($fV);
                }
                $out .= '<td>' . $fVnew . '</td>';
            }
        }
        $params = '&edit[' . $table . '][' . $row['uid'] . ']=edit';
        $out .= '<td nowrap>';
        if (!$row['deleted']) {
            $out .= '<a href="#" onClick="top.launchView(\'' . $table . '\',' . $row['uid'] . ',\'' . $GLOBALS['BACK_PATH'] . '\');return false;">' . t3lib_iconWorks::getSpriteIcon('status-dialog-information') . '</a>';
            $out .= '<a href="#" onClick="' . t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'], t3lib_div::getIndpEnv('REQUEST_URI') . t3lib_div::implodeArrayForUrl('SET', (array) t3lib_div::_POST('SET'))) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a>';
        } else {
            $out .= '<a href="' . t3lib_div::linkThisUrl($GLOBALS['BACK_PATH'] . 'tce_db.php', array('cmd[' . $table . '][' . $row['uid'] . '][undelete]' => '1', 'redirect' => t3lib_div::linkThisScript(array()))) . t3lib_BEfunc::getUrlToken('tceAction') . '">';
            $out .= t3lib_iconWorks::getSpriteIcon('actions-edit-restore', array('title' => 'undelete only')) . '</a>';
            $out .= '<a href="' . t3lib_div::linkThisUrl($GLOBALS['BACK_PATH'] . 'tce_db.php', array('cmd[' . $table . '][' . $row['uid'] . '][undelete]' => '1', 'redirect' => t3lib_div::linkThisUrl('alt_doc.php', array('edit[' . $table . '][' . $row['uid'] . ']' => 'edit', 'returnUrl' => t3lib_div::linkThisScript(array()))))) . t3lib_BEfunc::getUrlToken('tceAction') . '">';
            $out .= t3lib_iconWorks::getSpriteIcon('actions-edit-restore-edit', array('title' => 'undelete and edit')) . '</a>';
        }
        $_params = array($table => $row);
        if (is_array($this->hookArray['additionalButtons'])) {
            foreach ($this->hookArray['additionalButtons'] as $_funcRef) {
                $out .= t3lib_div::callUserFunction($_funcRef, $_params, $this);
            }
        }
        $out .= '</td>
		</tr>
		';
        return $out;
    }
 /**
  * Print a set of permissions
  *
  * @param	integer		Permission integer (bits)
  * @return	string		HTML marked up x/* indications.
  */
 function printPerms($int)
 {
     if (t3lib_div::int_from_ver(TYPO3_version) >= 4004000) {
         // use sprites for Typo3 V4.4 or later
         global $LANG;
         $permissions = array(1, 16, 2, 4, 8);
         foreach ($permissions as $permission) {
             if ($int & $permission) {
                 $str .= t3lib_iconWorks::getSpriteIcon('status-status-permission-granted', array('tag' => 'a', 'title' => $LANG->getLL($permission, 1), 'onclick' => 'WebPermissions.setPermissions(' . $pageId . ', ' . $permission . ', \'delete\', \'' . $who . '\', ' . $int . ');'));
             } else {
                 $str .= t3lib_iconWorks::getSpriteIcon('status-status-permission-denied', array('tag' => 'a', 'title' => $LANG->getLL($permission, 1), 'onclick' => 'WebPermissions.setPermissions(' . $pageId . ', ' . $permission . ', \'add\', \'' . $who . '\', ' . $int . ');'));
             }
         }
         return $str;
     } else {
         $str = '';
         $str .= $int & 1 ? '*' : '<span class="perm-denied">x</span>';
         $str .= $int & 16 ? '*' : '<span class="perm-denied">x</span>';
         $str .= $int & 2 ? '*' : '<span class="perm-denied">x</span>';
         $str .= $int & 4 ? '*' : '<span class="perm-denied">x</span>';
         $str .= $int & 8 ? '*' : '<span class="perm-denied">x</span>';
         return '<span class="perm-allowed">' . $str . '</span>';
     }
 }
    /**
     * Displays the edit page screen if the currently selected page is of the doktype "Sysfolder"
     *
     * @param	array		$pageRecord: The current page record
     * @return	mixed		HTML output from this submodule or FALSE if this submodule doesn't feel responsible
     * @access	public
     */
    function renderDoktype_254($pageRecord)
    {
        global $LANG, $BE_USER, $TYPO3_CONF_VARS;
        // Prepare the record icon including a content sensitive menu link wrapped around it:
        $pageTitle = htmlspecialchars(t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getRecordTitle('pages', $pageRecord), 50));
        $recordIcon = t3lib_iconWorks::getSpriteIconForRecord('pages', $pageRecord);
        $iconEdit = t3lib_iconWorks::getSpriteIcon('actions-document-open', array('title' => htmlspecialchars($LANG->sL('LLL:EXT:lang/locallang_mod_web_list.xml:editPage'))));
        $editButton = $this->pObj->link_edit($iconEdit, 'pages', $pageRecord['uid']);
        if ($this->userHasAccessToListModule()) {
            if (tx_templavoila_div::convertVersionNumberToInteger(TYPO3_version) < 4005000) {
                $listModuleURL = t3lib_div::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir . 'db_list.php?id=' . intval($this->pObj->id);
            } else {
                $listModuleURL = t3lib_BEfunc::getModuleUrl('web_list', array('id' => intval($this->pObj->id)), '');
            }
            $onClick = "top.nextLoadModuleUrl='" . $listModuleURL . "';top.fsMod.recentIds['web']=" . intval($this->pObj->id) . ";top.goToModule('web_list',1);";
            $listModuleLink = '<br /><br />' . t3lib_iconWorks::getSpriteIcon('actions-system-list-open') . '<strong><a href="#" onClick="' . $onClick . '">' . $LANG->getLL('editpage_sysfolder_switchtolistview', '', 1) . '</a></strong>
			';
        } else {
            $listModuleLink = $LANG->getLL('editpage_sysfolder_listview_noaccess', '', 1);
        }
        $flashMessage = t3lib_div::makeInstance('t3lib_FlashMessage', $LANG->getLL('editpage_sysfolder_intro', '', 1), '', t3lib_FlashMessage::INFO);
        $content = $flashMessage->render() . $listModuleLink;
        return $content;
    }
Ejemplo n.º 24
0
 /**
  * Create the panel of buttons for submitting the form or otherwise perform operations.
  *
  * @return	array	all available buttons as an assoc. array
  */
 protected function getButtons()
 {
     $buttons = array('csh' => '', 'back' => '');
     // CSH
     $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'history_log', $GLOBALS['BACK_PATH'], '', TRUE);
     // Start history object
     $historyObj = t3lib_div::makeInstance('recordHistory');
     if ($historyObj->returnUrl) {
         $buttons['back'] = '<a href="' . htmlspecialchars($historyObj->returnUrl) . '" class="typo3-goBack">' . t3lib_iconWorks::getSpriteIcon('actions-view-go-back') . '</a>';
     }
     return $buttons;
 }
Ejemplo n.º 25
0
    /**
     * Creates the HTML content for the palette
     * (Horizontally, for display in the top frame)
     * (Used if GET var "backRef" IS set)
     *
     * @param	array		Array of information from which the fields are built.
     * @return	string		HTML output
     */
    function printPalette($palArr)
    {
        $out = '';
        // For each element on the palette, write a few table cells with the field name, content and control images:
        foreach ($palArr as $content) {
            $iRow[] = '
				<td>' . '<img name="req_' . $content['TABLE'] . '_' . $content['ID'] . '_' . $content['FIELD'] . '" class="c-reqIcon" src="clear.gif" width="10" height="10" alt="" />' . '<img name="cm_' . $content['TABLE'] . '_' . $content['ID'] . '_' . $content['FIELD'] . '" class="c-cmIcon" src="clear.gif" width="7" height="10" alt="" />' . '</td>
				<td class="c-label">' . $content['NAME'] . '&nbsp;' . '</td>
				<td class="c-csh">' . $content['ITEM'] . $content['HELP_ICON'] . '</td>';
        }
        // Finally, wrap it all in a table:
        $out = '



			<!--
				TCEforms palette, rendered in top frame.
			-->
			<table border="0" cellpadding="0" cellspacing="0" id="typo3-TCEforms-palette">
				<tr>
					<td class="c-close">' . '<a href="#" onclick="closePal();return false;">' . t3lib_iconWorks::getSpriteIcon('actions-document-close', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.close', TRUE))) . '</a>' . '</td>' . implode('', $iRow) . '
				</tr>
			</table>

			';
        // Return the result:
        return $out;
    }
Ejemplo n.º 26
0
 /**
  * Create the panel of buttons for submitting the form or otherwise perform operations.
  *
  * @return	array	all available buttons as an assoc. array
  */
 function getButtons()
 {
     global $TCA, $LANG, $BACK_PATH, $BE_USER;
     $buttons = array('csh' => '', 'shortcut' => '', 'upload' => '', 'new' => '');
     // Add shortcut
     if ($BE_USER->mayMakeShortcut()) {
         $buttons['shortcut'] = $this->doc->makeShortcutIcon('pointer,id,target,table', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']);
     }
     // FileList Module CSH:
     $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'filelist_module', $GLOBALS['BACK_PATH'], '', TRUE);
     // upload button
     $buttons['upload'] = '<a href="' . $BACK_PATH . 'file_upload.php?target=' . rawurlencode($this->id) . '&amp;returnUrl=' . rawurlencode($this->filelist->listURL()) . '" id="button-upload" title="' . $GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:cm.upload', 1)) . '">' . t3lib_iconWorks::getSpriteIcon('actions-edit-upload') . '</a>';
     $buttons['new'] = '<a href="' . $BACK_PATH . 'file_newfolder.php?target=' . rawurlencode($this->id) . '&amp;returnUrl=' . rawurlencode($this->filelist->listURL()) . '" title="' . $GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:cm.new', 1)) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-new') . '</a>';
     return $buttons;
 }
    /**
     * Main function of class
     *
     * @return	string		HTML output
     */
    function main()
    {
        global $LANG;
        $menu = t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[tsconf_parts]', $this->pObj->MOD_SETTINGS['tsconf_parts'], $this->pObj->MOD_MENU['tsconf_parts']);
        $menu .= '<br /><label for="checkTsconf_alphaSort">' . $GLOBALS['LANG']->getLL('sort_alphabetic', true) . '</label> ' . t3lib_BEfunc::getFuncCheck($this->pObj->id, 'SET[tsconf_alphaSort]', $this->pObj->MOD_SETTINGS['tsconf_alphaSort'], '', '', 'id="checkTsconf_alphaSort"');
        $menu .= '<br /><br />';
        if ($this->pObj->MOD_SETTINGS['tsconf_parts'] == 99) {
            $TSparts = t3lib_BEfunc::getPagesTSconfig($this->pObj->id, '', 1);
            $lines = array();
            $pUids = array();
            foreach ($TSparts as $k => $v) {
                if ($k != 'uid_0') {
                    if ($k == 'defaultPageTSconfig') {
                        $pTitle = '<strong>' . $GLOBALS['LANG']->getLL('editTSconfig_default', 1) . '</strong>';
                        $editIcon = '';
                    } else {
                        $pUids[] = substr($k, 4);
                        $row = t3lib_BEfunc::getRecordWSOL('pages', substr($k, 4));
                        $pTitle = $this->pObj->doc->getHeader('pages', $row, '', 0);
                        $editIdList = substr($k, 4);
                        $params = '&edit[pages][' . $editIdList . ']=edit&columnsOnly=TSconfig';
                        $onclickUrl = t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'], '');
                        $editIcon = '<a href="#" onclick="' . htmlspecialchars($onclickUrl) . '" title="' . $GLOBALS['LANG']->getLL('editTSconfig', 1) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a>';
                    }
                    $TScontent = nl2br(htmlspecialchars(trim($v) . chr(10)));
                    $tsparser = t3lib_div::makeInstance('t3lib_TSparser');
                    $tsparser->lineNumberOffset = 0;
                    $TScontent = $tsparser->doSyntaxHighlight(trim($v) . LF, '', 0);
                    $lines[] = '
						<tr><td nowrap="nowrap" class="bgColor5">' . $pTitle . '</td></tr>
						<tr><td nowrap="nowrap" class="bgColor4">' . $TScontent . $editIcon . '</td></tr>
						<tr><td>&nbsp;</td></tr>
					';
                }
            }
            if (count($pUids)) {
                $params = '&edit[pages][' . implode(',', $pUids) . ']=edit&columnsOnly=TSconfig';
                $onclickUrl = t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'], '');
                $editIcon = '<a href="#" onclick="' . htmlspecialchars($onclickUrl) . '" title="' . $GLOBALS['LANG']->getLL('editTSconfig_all', 1) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open') . '<strong>' . $GLOBALS['LANG']->getLL('editTSconfig_all', 1) . '</strong>' . '</a>';
            } else {
                $editIcon = '';
            }
            $theOutput .= $this->pObj->doc->section($LANG->getLL('tsconf_title'), t3lib_BEfunc::cshItem('_MOD_' . $GLOBALS['MCONF']['name'], 'tsconfig_edit', $GLOBALS['BACK_PATH'], '|<br />') . $menu . '
					<br /><br />

					<!-- Edit fields: -->
					<table border="0" cellpadding="0" cellspacing="1">' . implode('', $lines) . '</table><br />' . $editIcon, 0, 1);
        } else {
            $tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext');
            // Defined global here!
            $tmpl->tt_track = 0;
            // Do not log time-performance information
            $tmpl->fixedLgd = 0;
            $tmpl->linkObjects = 0;
            $tmpl->bType = '';
            $tmpl->ext_expandAllNotes = 1;
            $tmpl->ext_noPMicons = 1;
            switch ($this->pObj->MOD_SETTINGS['tsconf_parts']) {
                case '1':
                    $modTSconfig = t3lib_BEfunc::getModTSconfig($this->pObj->id, 'mod');
                    break;
                case '1a':
                    $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_layout', t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
                    break;
                case '1b':
                    $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_view', t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
                    break;
                case '1c':
                    $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_modules', t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
                    break;
                case '1d':
                    $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_list', t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
                    break;
                case '1e':
                    $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_info', t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
                    break;
                case '1f':
                    $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_func', t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
                    break;
                case '1g':
                    $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_ts', t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
                    break;
                case '2':
                    $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('RTE', t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
                    break;
                case '5':
                    $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('TCEFORM', t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
                    break;
                case '6':
                    $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('TCEMAIN', t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
                    break;
                case '3':
                    $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('TSFE', t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
                    break;
                case '4':
                    $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('user', t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
                    break;
                default:
                    $modTSconfig['properties'] = t3lib_BEfunc::getPagesTSconfig($this->pObj->id);
                    break;
            }
            $modTSconfig = $modTSconfig['properties'];
            if (!is_array($modTSconfig)) {
                $modTSconfig = array();
            }
            $theOutput .= $this->pObj->doc->section($LANG->getLL('tsconf_title'), t3lib_BEfunc::cshItem('_MOD_' . $GLOBALS['MCONF']['name'], 'tsconfig_hierarchy', $GLOBALS['BACK_PATH'], '|<br />') . $menu . '

					<!-- Page TSconfig Tree: -->
					<table border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td nowrap="nowrap">' . $tmpl->ext_getObjTree($modTSconfig, '', '', '', '', $this->pObj->MOD_SETTINGS['tsconf_alphaSort']) . '</td>
						</tr>
					</table>', 0, 1);
        }
        // Return output:
        return $theOutput;
    }
 /**
  * Creates the selector for workspaces
  *
  * @return	string		workspace selector as HTML select
  */
 public function render()
 {
     $title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:toolbarItems.workspace', true);
     $this->addJavascriptToBackend();
     $this->changeWorkspace();
     $availableWorkspaces = $this->getAvailableWorkspaces();
     $workspaceMenu = array();
     $stateCheckedIcon = t3lib_iconWorks::getSpriteIcon('status-status-checked');
     $stateUncheckedIcon = t3lib_iconWorks::getSpriteIcon('empty-empty', array('title' => $GLOBALS['LANG']->getLL('shortcut_inactive')));
     $workspaceMenu[] = '<a href="#" class="toolbar-item">' . t3lib_iconWorks::getSpriteIcon('apps-toolbar-menu-workspace', array('title' => $title)) . '</a>';
     $workspaceMenu[] = '<ul class="toolbar-item-menu" style="display: none;">';
     if (count($availableWorkspaces)) {
         foreach ($availableWorkspaces as $workspaceId => $label) {
             $selected = '';
             $icon = $stateUncheckedIcon;
             if ((int) $GLOBALS['BE_USER']->workspace === $workspaceId) {
                 $selected = ' class="selected"';
                 $icon = $stateCheckedIcon;
             }
             $workspaceMenu[] = '<li' . $selected . '>' . $icon . ' <a href="backend.php?changeWorkspace=' . intval($workspaceId) . '" id="ws-' . intval($workspaceId) . '" class="ws">' . $label . '</a></li>';
         }
     } else {
         $workspaceMenu[] = '<li>' . $stateUncheckedIcon . ' ' . $GLOBALS['LANG']->getLL('shortcut_noWSfound', true) . '</li>';
     }
     // frontend preview toggle
     $frontendPreviewActiveIcon = $stateUncheckedIcon;
     if ($GLOBALS['BE_USER']->user['workspace_preview']) {
         $frontendPreviewActiveIcon = $stateCheckedIcon;
     }
     $workspaceMenu[] = '<li class="divider">' . $frontendPreviewActiveIcon . '<a href="backend.php?changeWorkspacePreview=' . ($GLOBALS['BE_USER']->user['workspace_preview'] ? '0' : '1') . '" id="frontendPreviewToggle">' . $GLOBALS['LANG']->getLL('shortcut_FEPreview', true) . '</a></li>';
     // go to workspace module link
     $workspaceMenu[] = '<li>' . $stateUncheckedIcon . ' ' . '<a href="mod/user/ws/index.php" target="content" id="goToWsModule">' . ' ' . $GLOBALS['LANG']->getLL('shortcut_workspace', true) . '</a></li>';
     $workspaceMenu[] = '</ul>';
     return implode(LF, $workspaceMenu);
 }
Ejemplo n.º 29
0
	/**
	 * Gets the buttons that shall be rendered in the docHeader.
	 *
	 * @return	array		Available buttons for the docHeader
	 */
	protected function getDocHeaderButtons() {
		$buttons = array(
			'csh'		=> t3lib_BEfunc::cshItem('_MOD_web_txtemplavoilaCM1', '', $this->backPath),
			'back'		=> '',
			'shortcut'	=> $this->getShortcutButton(),
		);

			// Back
		if ($this->returnUrl) {
			$backIcon = t3lib_iconWorks::getSpriteIcon('actions-view-go-back');
			$buttons['back'] = '<a href="' . htmlspecialchars(t3lib_div::linkThisUrl($this->returnUrl)) . '" class="typo3-goBack" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.goBack', TRUE) . '">' .
								$backIcon .
							   '</a>';
		}
		return $buttons;
	}
Ejemplo n.º 30
0
 /**
  * Links to publishing etc of a version
  *
  * @param	string		Table name
  * @param	array		Record
  * @param	integer		The uid of the online version of $uid. If zero it means we are drawing a row for the online version itself while a value means we are drawing display for an offline version.
  * @return	string		HTML content, mainly link tags and images.
  */
 function displayWorkspaceOverview_commandLinksSub($table, $rec, $origId)
 {
     $uid = $rec['uid'];
     if ($origId || $GLOBALS['BE_USER']->workspace === 0) {
         if (!$GLOBALS['BE_USER']->workspaceCannotEditRecord($table, $rec)) {
             // Edit
             if ($table === 'pages') {
                 $actionLinks .= '<a href="#" onclick="top.loadEditId(' . $uid . ');top.goToModule(\'' . $this->pageModule . '\'); return false;" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_user_ws.xml:img_title_edit_page', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('apps-version-page-open') . '</a>';
             } else {
                 $params = '&edit[' . $table . '][' . $uid . ']=edit';
                 $actionLinks .= '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $this->doc->backPath)) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_user_ws.xml:img_title_edit_element', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a>';
             }
         }
         // History/Log
         $actionLinks .= '<a href="' . htmlspecialchars($this->doc->backPath . 'show_rechis.php?element=' . rawurlencode($table . ':' . $uid) . '&returnUrl=' . rawurlencode($this->REQUEST_URI)) . '" title="' . $GLOBALS['LANG']->getLL('showLog', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-history-open') . '</a>';
     }
     // View
     if ($table === 'pages') {
         $actionLinks .= '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($uid, $this->doc->backPath, t3lib_BEfunc::BEgetRootLine($uid))) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-view') . '</a>';
     }
     return $actionLinks;
 }