当前位置: 首页>>代码示例>>PHP>>正文


PHP t3lib_BEfunc::cshItem方法代码示例

本文整理汇总了PHP中t3lib_BEfunc::cshItem方法的典型用法代码示例。如果您正苦于以下问题:PHP t3lib_BEfunc::cshItem方法的具体用法?PHP t3lib_BEfunc::cshItem怎么用?PHP t3lib_BEfunc::cshItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在t3lib_BEfunc的用法示例。


在下文中一共展示了t3lib_BEfunc::cshItem方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: render

 /**
  * Render context sensitive help (CSH) for the given table
  *
  * @param string $table Table name ('_MOD_'+module name). If not set, the current module name will be used
  * @param string $field Field name (CSH locallang main key)
  * @param boolean $iconOnly If set, the full text will never be shown (only icon)
  * @param string $styleAttributes Additional style-attribute content for wrapping table (full text mode only)
  * @return string the rendered CSH icon
  * @see t3lib_BEfunc::cshItem
  */
 public function render($table = NULL, $field = '', $iconOnly = FALSE, $styleAttributes = '')
 {
     if ($table === NULL) {
         $currentRequest = $this->controllerContext->getRequest();
         $moduleName = $currentRequest->getPluginName();
         $table = '_MOD_' . $moduleName;
     }
     $cshButton = t3lib_BEfunc::cshItem($table, $field, $GLOBALS['BACK_PATH'], '', $iconOnly, $styleAttributes);
     return '<div class="docheader-csh">' . $cshButton . '</div>';
 }
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:20,代码来源:CshViewHelper.php

示例2: main

    /**
     * MAIN function for page information of localization
     *
     * @return	string		Output HTML for the module.
     */
    function main()
    {
        global $BACK_PATH, $LANG, $SOBE;
        if ($this->pObj->id) {
            $theOutput = '';
            // Depth selector:
            $h_func = t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[depth]', $this->pObj->MOD_SETTINGS['depth'], $this->pObj->MOD_MENU['depth'], 'index.php');
            $h_func .= t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[lang]', $this->pObj->MOD_SETTINGS['lang'], $this->pObj->MOD_MENU['lang'], 'index.php');
            $theOutput .= $h_func;
            // Add CSH:
            $theOutput .= t3lib_BEfunc::cshItem('_MOD_web_info', 'lang', $GLOBALS['BACK_PATH'], '|<br/>');
            // Showing the tree:
            // Initialize starting point of page tree:
            $treeStartingPoint = intval($this->pObj->id);
            $treeStartingRecord = t3lib_BEfunc::getRecordWSOL('pages', $treeStartingPoint);
            $depth = $this->pObj->MOD_SETTINGS['depth'];
            // Initialize tree object:
            $tree = t3lib_div::makeInstance('t3lib_pageTree');
            $tree->init('AND ' . $GLOBALS['BE_USER']->getPagePermsClause(1));
            $tree->addField('l18n_cfg');
            // Creating top icon; the current page
            $HTML = t3lib_iconWorks::getIconImage('pages', $treeStartingRecord, $GLOBALS['BACK_PATH'], 'align="top"');
            $tree->tree[] = array('row' => $treeStartingRecord, 'HTML' => $HTML);
            // Create the tree from starting point:
            if ($depth) {
                $tree->getTree($treeStartingPoint, $depth, '');
            }
            #debug($tree->tree);
            // Add CSS needed:
            $css_content = '
				TABLE#langTable {
					margin-top: 10px;
				}
				TABLE#langTable TR TD {
					padding-left : 2px;
					padding-right : 2px;
					white-space: nowrap;
				}
				TD.c-notvisible { background-color: red; }
				TD.c-visible { background-color: #669966; }
				TD.c-translated { background-color: #A8E95C; }
				TD.c-nottranslated { background-color: #E9CD5C; }
				TD.c-leftLine {border-left: 2px solid black; }
				.bgColor5 { font-weight: bold; }
			';
            $marker = '/*###POSTCSSMARKER###*/';
            $this->pObj->content = str_replace($marker, $css_content . chr(10) . $marker, $this->pObj->content);
            // Render information table:
            $theOutput .= $this->renderL10nTable($tree);
        }
        return $theOutput;
    }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:57,代码来源:class.tx_languagevisibility_modfunc1.php

示例3: notEdit


//.........这里部分代码省略.........
				</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);
    }
开发者ID:zsolt-molnar,项目名称:TYPO3-4.5-trunk,代码行数:101,代码来源:index.php

示例4: getDocHeaderButtons

	/**
	 * 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_txtemplavoilaM2', '', $this->backPath),
			'shortcut' => $this->getShortcutButton(),
		);
		return $buttons;
	}
开发者ID:rafu1987,项目名称:t3bootstrap-project,代码行数:12,代码来源:index.php

示例5: getButtons

 /**
  * 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;
 }
开发者ID:zsolt-molnar,项目名称:TYPO3-4.5-trunk,代码行数:14,代码来源:alt_file_navframe.php

示例6: getButtons

 /**
  * 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;
 }
开发者ID:zsolt-molnar,项目名称:TYPO3-4.5-trunk,代码行数:17,代码来源:show_rechis.php

示例7: getButtons

 /**
  * 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;
 }
开发者ID:zsolt-molnar,项目名称:TYPO3-4.5-trunk,代码行数:24,代码来源:move_el.php

示例8: getButtons

 /**
  * 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->id && $this->access) {
         // CSH
         $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'new_ce', $GLOBALS['BACK_PATH'], '', TRUE);
         // Back
         if ($this->R_URI) {
             $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;
 }
开发者ID:zsolt-molnar,项目名称:TYPO3-4.5-trunk,代码行数:19,代码来源:db_new_content_el.php

示例9: main

 /**
  * MAIN function for page information display (including hit statistics)
  *
  * @return	string		Output HTML for the module.
  */
 function main()
 {
     global $BACK_PATH, $LANG, $SOBE;
     $dblist = t3lib_div::makeInstance('tx_cms_layout');
     $dblist->descrTable = '_MOD_' . $GLOBALS['MCONF']['name'];
     $dblist->backPath = $BACK_PATH;
     $dblist->thumbs = 0;
     $dblist->script = 'index.php';
     $dblist->showIcon = 0;
     $dblist->setLMargin = 0;
     $dblist->agePrefixes = $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears');
     $dblist->pI_showUser = 1;
     $dblist->pI_showStat = 0;
     // PAGES:
     $this->pObj->MOD_SETTINGS['pages_levels'] = $this->pObj->MOD_SETTINGS['depth'];
     // ONLY for the sake of dblist module which uses this value.
     $h_func = t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[depth]', $this->pObj->MOD_SETTINGS['depth'], $this->pObj->MOD_MENU['depth'], 'index.php');
     if ($this->pObj->MOD_SETTINGS['function'] == 'tx_cms_webinfo_hits') {
         $h_func .= t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[stat_type]', $this->pObj->MOD_SETTINGS['stat_type'], $this->pObj->MOD_MENU['stat_type'], 'index.php');
         if ($this->pObj->MOD_SETTINGS['stat_type'] == 1) {
             $dblist->stat_select_field = 'rl0';
         }
         if ($this->pObj->MOD_SETTINGS['stat_type'] == 2) {
             $dblist->stat_select_field = 'rl1';
         }
         // Timespan
         for ($a = 0; $a < 30; $a++) {
             $dblist->stat_codes[] = 'HITS_days:' . -$a;
         }
         $timespan_b = mktime(0, 0, 0);
         $timespan_e = mktime(0, 0, 0) - (30 - 1) * 3600 * 24 + 1;
         $header = '<br />' . sprintf($LANG->getLL('stat_period'), t3lib_BEfunc::date($timespan_b), t3lib_BEfunc::date($timespan_e)) . '<br />';
         //
         $dblist->start($this->pObj->id, 'pages', 0);
         $dblist->pages_noEditColumns = 1;
         $dblist->generateList();
         $theOutput .= $this->pObj->doc->section($LANG->getLL('hits_title'), t3lib_BEfunc::cshItem($dblist->descrTable, 'stat', $GLOBALS['BACK_PATH'], '|<br />') . $h_func . $header . $dblist->HTMLcode, 0, 1);
     } else {
         $h_func .= t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[pages]', $this->pObj->MOD_SETTINGS['pages'], $this->pObj->MOD_MENU['pages'], 'index.php');
         $dblist->start($this->pObj->id, 'pages', 0);
         $dblist->generateList();
         // CSH
         $theOutput .= $this->pObj->doc->section($LANG->getLL('page_title'), t3lib_BEfunc::cshItem($dblist->descrTable, 'pagetree_overview', $GLOBALS['BACK_PATH'], '|<br />') . $h_func . $dblist->HTMLcode, 0, 1);
         // SYS_NOTES:
         if (t3lib_extMgm::isLoaded('sys_note')) {
             $dblist->start($this->pObj->id, 'sys_note', 0);
             $dblist->generateList();
             if ($dblist->HTMLcode) {
                 $theOutput .= $this->pObj->doc->spacer(10);
                 $theOutput .= $this->pObj->doc->section($LANG->getLL('page_sysnote'), $dblist->HTMLcode, 0, 1);
             }
         }
         // PAGE INFORMATION
         if ($this->pObj->pageinfo['uid']) {
             $theOutput .= $this->pObj->doc->spacer(10);
             $theOutput .= $this->pObj->doc->section($LANG->getLL('pageInformation'), $dblist->getPageInfoBox($this->pObj->pageinfo, $this->pObj->CALC_PERMS & 2), 0, 1);
         }
     }
     return $theOutput;
 }
开发者ID:zsolt-molnar,项目名称:TYPO3-4.5-trunk,代码行数:65,代码来源:class.tx_cms_webinfo.php

示例10: getButtons

 /**
  * 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;
 }
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:20,代码来源:file_list.php

示例11: sidebar_renderItem_renderNewTranslationSelectorbox

    /**
     * Renders the HTML code for a selectorbox for selecting a new translation language for the current
     * page (create a new "Alternative Page Header".
     *
     * @return	mixed		HTML code for the selectorbox or FALSE if no new translation can be created.
     * @access	protected
     */
    function sidebar_renderItem_renderNewTranslationSelectorbox()
    {
        global $LANG, $BE_USER;
        if (!$GLOBALS['BE_USER']->isPSet($this->pObj->calcPerms, 'pages', 'edit')) {
            return false;
        }
        $newLanguagesArr = $this->pObj->getAvailableLanguages(0, true, false);
        if (count($newLanguagesArr) < 1) {
            return FALSE;
        }
        $translatedLanguagesArr = $this->pObj->getAvailableLanguages($this->pObj->id);
        $optionsArr = array('<option value=""></option>');
        foreach ($newLanguagesArr as $language) {
            if ($BE_USER->checkLanguageAccess($language['uid']) && !isset($translatedLanguagesArr[$language['uid']])) {
                $flag = tx_templavoila_icons::getFlagIconFileForLanguage($language['flagIcon']);
                $style = isset($language['flagIcon']) ? 'background-image: url(' . $flag . '); background-repeat: no-repeat; padding-top: 0px; padding-left: 22px;' : '';
                $optionsArr[] = '<option style="' . $style . '" name="createNewPageTranslation" value="' . $language['uid'] . '">' . htmlspecialchars($language['title']) . '</option>';
            }
        }
        if (count($optionsArr) > 1) {
            $linkParam = $this->pObj->rootElementTable == 'pages' ? '&doktype=' . $this->pObj->rootElementRecord['doktype'] : '';
            $link = 'index.php?' . $this->pObj->link_getParameters() . '&createNewPageTranslation=\'+this.options[this.selectedIndex].value+\'&pid=' . $this->pObj->id . $linkParam;
            $output = '
				<tr class="bgColor4">
					<td width="20">
						' . t3lib_BEfunc::cshItem('_MOD_web_txtemplavoilaM1', 'createnewtranslation', $this->doc->backPath) . '
					</td><td width="200" style="vertical-align:middle;">
						' . $LANG->getLL('createnewtranslation', 1) . ':
					</td>
					<td style="vertical-align:middle;"><select onChange="document.location=\'' . htmlspecialchars($link) . '\'">' . implode('', $optionsArr) . '</select></td>
				</tr>
			';
        }
        return $output;
    }
开发者ID:rod86,项目名称:t3sandbox,代码行数:42,代码来源:class.tx_templavoila_mod1_localization.php

示例12: render_outline

    /**
     * Rendering the outline display of the page structure
     *
     * @param	array		$contentTreeArr: DataStructure info array (the whole tree)
     * @return	string		HTML
     */
    function render_outline($contentTreeArr)
    {
        global $LANG;
        // Load possible website languages:
        $this->translatedLanguagesArr_isoCodes = array();
        foreach ($this->translatedLanguagesArr as $langInfo) {
            if ($langInfo['ISOcode']) {
                $this->translatedLanguagesArr_isoCodes['all_lKeys'][] = 'l' . $langInfo['ISOcode'];
                $this->translatedLanguagesArr_isoCodes['all_vKeys'][] = 'v' . $langInfo['ISOcode'];
            }
        }
        // Rendering the entries:
        $entries = array();
        $this->render_outline_element($contentTreeArr, $entries);
        // Header of table:
        $output = '';
        $output .= '<tr class="bgColor5 tableheader">
				<td class="nobr">' . $LANG->getLL('outline_header_title', 1) . '</td>
				<td class="nobr">' . $LANG->getLL('outline_header_controls', 1) . '</td>
				<td class="nobr">' . $LANG->getLL('outline_header_status', 1) . '</td>
				<td class="nobr">' . $LANG->getLL('outline_header_element', 1) . '</td>
			</tr>';
        // Render all entries:
        $xmlCleanCandidates = FALSE;
        foreach ($entries as $entry) {
            // Create indentation code:
            $indent = '';
            for ($a = 0; $a < $entry['indentLevel']; $a++) {
                $indent .= '&nbsp;&nbsp;&nbsp;&nbsp;';
            }
            // Create status for FlexForm XML:
            // WARNING: Also this section contains cleaning of XML which is sort of mixing functionality but a quick and easy solution for now.
            // @Robert: How would you like this implementation better? Please advice and I will change it according to your wish!
            $status = '';
            if ($entry['table'] && $entry['uid']) {
                $flexObj = t3lib_div::makeInstance('t3lib_flexformtools');
                $recRow = t3lib_BEfunc::getRecordWSOL($entry['table'], $entry['uid']);
                if ($recRow['tx_templavoila_flex']) {
                    // Clean XML:
                    $newXML = $flexObj->cleanFlexFormXML($entry['table'], 'tx_templavoila_flex', $recRow);
                    // If the clean-all command is sent AND there is a difference in current/clean XML, save the clean:
                    if (t3lib_div::_POST('_CLEAN_XML_ALL') && md5($recRow['tx_templavoila_flex']) != md5($newXML)) {
                        $dataArr = array();
                        $dataArr[$entry['table']][$entry['uid']]['tx_templavoila_flex'] = $newXML;
                        // Init TCEmain object and store:
                        $tce = t3lib_div::makeInstance('t3lib_TCEmain');
                        $tce->stripslashes_values = 0;
                        $tce->start($dataArr, array());
                        $tce->process_datamap();
                        // Re-fetch record:
                        $recRow = t3lib_BEfunc::getRecordWSOL($entry['table'], $entry['uid']);
                    }
                    // Render status:
                    $xmlUrl = '../cm2/index.php?viewRec[table]=' . $entry['table'] . '&viewRec[uid]=' . $entry['uid'] . '&viewRec[field_flex]=tx_templavoila_flex';
                    if (md5($recRow['tx_templavoila_flex']) != md5($newXML)) {
                        $status = $this->doc->icons(1) . '<a href="' . htmlspecialchars($xmlUrl) . '">' . $LANG->getLL('outline_status_dirty', 1) . '</a><br/>';
                        $xmlCleanCandidates = TRUE;
                    } else {
                        $status = $this->doc->icons(-1) . '<a href="' . htmlspecialchars($xmlUrl) . '">' . $LANG->getLL('outline_status_clean', 1) . '</a><br/>';
                    }
                }
            }
            // Compile table row:
            $class = ($entry['isNewVersion'] ? 'bgColor5' : 'bgColor4') . ' ' . $entry['elementTitlebarClass'];
            $output .= '<tr class="' . $class . '">
					<td class="nobr">' . $indent . $entry['icon'] . $entry['flag'] . $entry['title'] . '</td>
					<td class="nobr">' . $entry['controls'] . '</td>
					<td>' . $status . $entry['warnings'] . ($entry['isNewVersion'] ? $this->doc->icons(1) . 'New version!' : '') . '</td>
					<td class="nobr">' . htmlspecialchars($entry['id'] ? $entry['id'] : $entry['table'] . ':' . $entry['uid']) . '</td>
				</tr>';
        }
        $output = '<table border="0" cellpadding="1" cellspacing="1" class="tpm-outline-table">' . $output . '</table>';
        // Show link for cleaning all XML structures:
        if ($xmlCleanCandidates) {
            $output .= '<br/>
				' . t3lib_BEfunc::cshItem('_MOD_web_txtemplavoilaM1', 'outline_status_cleanall', $this->doc->backPath) . '
				<input type="submit" value="' . $LANG->getLL('outline_status_cleanAll', 1) . '" name="_CLEAN_XML_ALL" /><br/><br/>
			';
        }
        return $output;
    }
开发者ID:rod86,项目名称:t3sandbox,代码行数:87,代码来源:index.php

示例13: cshItem

 /**
  * Wrapper function for context sensitive help - for downwards compatibility with TYPO3 prior 3.7.x
  *
  * @param	string		Table name ('_MOD_'+module name)
  * @param	string		Field name (CSH locallang main key)
  * @param	string		Back path
  * @param	string		Wrap code for icon-mode, splitted by "|". Not used for full-text mode.
  * @param	boolean		If set, the full text will never be shown (only icon). Useful for places where it will break the page if the table with full text is shown.
  * @param	string		Additional style-attribute content for wrapping table (full text mode only)
  * @return	string		HTML content for help text
  */
 function cshItem($table, $field, $BACK_PATH, $wrap = '', $onlyIconMode = FALSE, $styleAttrib = '')
 {
     if (is_callable(array('t3lib_BEfunc', 'cshItem'))) {
         return t3lib_BEfunc::cshItem($table, $field, $BACK_PATH, $wrap, $onlyIconMode, $styleAttrib);
     }
     return '';
 }
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:18,代码来源:index.php

示例14: main

    /**
     * Main function creating the content for the module.
     *
     * @return	string		HTML content for the module, actually a "section" made through the parent object in $this->pObj
     */
    function main()
    {
        global $SOBE, $LANG;
        $theCode = '';
        $m_perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(8);
        // create new pages here?
        $pRec = t3lib_BEfunc::getRecord('pages', $this->pObj->id, 'uid', ' AND ' . $m_perms_clause);
        $sys_pages = t3lib_div::makeInstance('t3lib_pageSelect');
        $menuItems = $sys_pages->getMenu($this->pObj->id, '*', 'sorting', '', 0);
        if (is_array($pRec)) {
            $data = t3lib_div::_GP('data');
            if (is_array($data['pages'])) {
                if (t3lib_div::_GP('createInListEnd')) {
                    $endI = end($menuItems);
                    $thePid = -intval($endI['uid']);
                    if (!$thePid) {
                        $thePid = $this->pObj->id;
                    }
                } else {
                    $thePid = $this->pObj->id;
                }
                $firstRecord = true;
                foreach ($data['pages'] as $identifier => $dat) {
                    if (!trim($dat['title'])) {
                        unset($data['pages'][$identifier]);
                    } else {
                        $data['pages'][$identifier]['hidden'] = t3lib_div::_GP('hidePages') ? 1 : 0;
                        if ($firstRecord) {
                            $firstRecord = false;
                            $data['pages'][$identifier]['pid'] = $thePid;
                        } else {
                            $data['pages'][$identifier]['pid'] = '-' . $previousIdentifier;
                        }
                        $previousIdentifier = $identifier;
                    }
                }
                if (count($data['pages'])) {
                    reset($data);
                    $tce = t3lib_div::makeInstance('t3lib_TCEmain');
                    $tce->stripslashes_values = 0;
                    // set default TCA values specific for the user
                    $TCAdefaultOverride = $GLOBALS['BE_USER']->getTSConfigProp('TCAdefaults');
                    if (is_array($TCAdefaultOverride)) {
                        $tce->setDefaultsFromUserTS($TCAdefaultOverride);
                    }
                    $tce->start($data, array());
                    $tce->process_datamap();
                    t3lib_BEfunc::setUpdateSignal('updatePageTree');
                    $flashMessage = t3lib_div::makeInstance('t3lib_FlashMessage', '', $GLOBALS['LANG']->getLL('wiz_newPages_create'));
                } else {
                    $flashMessage = t3lib_div::makeInstance('t3lib_FlashMessage', '', $GLOBALS['LANG']->getLL('wiz_newPages_noCreate'), t3lib_FlashMessage::ERROR);
                }
                $theCode .= $flashMessage->render();
                // Display result:
                $menuItems = $sys_pages->getMenu($this->pObj->id, '*', 'sorting', '', 0);
                $lines = array();
                foreach ($menuItems as $rec) {
                    t3lib_BEfunc::workspaceOL('pages', $rec);
                    if (is_array($rec)) {
                        $lines[] = '<nobr>' . t3lib_iconWorks::getSpriteIconForRecord('pages', $rec, array('title' => t3lib_BEfunc::titleAttribForPages($rec, '', FALSE))) . htmlspecialchars(t3lib_div::fixed_lgd_cs($rec['title'], $GLOBALS['BE_USER']->uc['titleLen'])) . '</nobr>';
                    }
                }
                $theCode .= '<h4>' . $LANG->getLL('wiz_newPages_currentMenu') . '</h4>' . implode('<br />', $lines);
            } else {
                // Create loremIpsum code:
                if (t3lib_extMgm::isLoaded('lorem_ipsum')) {
                    $loremIpsumObj = t3lib_div::getUserObj('EXT:lorem_ipsum/class.tx_loremipsum_wiz.php:tx_loremipsum_wiz');
                }
                // Display create form
                $lines = array();
                for ($a = 0; $a < 9; $a++) {
                    $lines[] = '<label for="page_new_' . $a . '"> ' . $LANG->getLL('wiz_newPages_page') . ' ' . ($a + 1) . ':&nbsp;</label><input type="text" id="page_new_' . $a . '" name="data[pages][NEW' . $a . '][title]"' . $this->pObj->doc->formWidth(35) . ' />' . (is_object($loremIpsumObj) ? '<a href="#" onclick="' . htmlspecialchars($loremIpsumObj->getHeaderTitleJS('document.forms[0][\'data[pages][NEW' . $a . '][title]\'].value', 'title')) . '">' . $loremIpsumObj->getIcon('', $this->pObj->doc->backPath) . '</a>' : '');
                }
                $theCode .= '<h4>' . $LANG->getLL('wiz_newPages') . ':</h4>' . implode('<br />', $lines) . '<br /><br />
				<input type="checkbox" name="createInListEnd" id="createInListEnd" value="1" /> <label for="createInListEnd">' . $LANG->getLL('wiz_newPages_listEnd') . '</label><br />
				<input type="checkbox" name="hidePages" id="hidePages" value="1" /> <label for="hidePages">' . $LANG->getLL('wiz_newPages_hidePages') . '</label><br /><br />
				<input type="submit" name="create" value="' . $LANG->getLL('wiz_newPages_lCreate') . '" onclick="return confirm(' . $GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->getLL('wiz_newPages_lCreate_msg1')) . ')" />&nbsp;<input type="reset" value="' . $LANG->getLL('wiz_newPages_lReset') . '" /><br />';
            }
        } else {
            $theCode .= $GLOBALS['TBE_TEMPLATE']->rfw($LANG->getLL('wiz_newPages_errorMsg1'));
        }
        // CSH
        $theCode .= t3lib_BEfunc::cshItem('_MOD_web_func', 'tx_wizardcrpages', $GLOBALS['BACK_PATH'], '<br />|');
        $out = $this->pObj->doc->section($LANG->getLL('wiz_crMany'), $theCode, 0, 1);
        return $out;
    }
开发者ID:zsolt-molnar,项目名称:TYPO3-4.5-trunk,代码行数:91,代码来源:class.tx_wizardcrpages_webfunc_2.php

示例15: getButtons

 /**
  * 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;
     $buttons = array('save' => '', 'save_view' => '', 'save_new' => '', 'save_close' => '', 'close' => '', 'delete' => '', 'undo' => '', 'history' => '', 'columns_only' => '', 'csh' => '', 'translation_save' => '', 'translation_saveclear' => '');
     // Render SAVE type buttons:
     // The action of each button is decided by its name attribute. (See doProcessData())
     if (!$this->errorC && !$TCA[$this->firstEl['table']]['ctrl']['readOnly']) {
         // SAVE button:
         $buttons['save'] = t3lib_iconWorks::getSpriteIcon('actions-document-save', array('html' => '<input type="image" name="_savedok" class="c-inputButton" src="clear.gif" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', 1) . '" />'));
         // SAVE / VIEW button:
         if ($this->viewId && !$this->noView && t3lib_extMgm::isLoaded('cms') && $this->getNewIconMode($this->firstEl['table'], 'saveDocView')) {
             $buttons['save_view'] = t3lib_iconWorks::getSpriteIcon('actions-document-save-view', array('html' => '<input type="image" class="c-inputButton" name="_savedokview" src="clear.gif" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveDocShow', 1) . '" />'));
         }
         // SAVE / NEW button:
         if (count($this->elementsData) == 1 && $this->getNewIconMode($this->firstEl['table'])) {
             $buttons['save_new'] = t3lib_iconWorks::getSpriteIcon('actions-document-save-new', array('html' => '<input type="image" class="c-inputButton" name="_savedoknew" src="clear.gif" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveNewDoc', 1) . '" />'));
         }
         // SAVE / CLOSE
         $buttons['save_close'] = t3lib_iconWorks::getSpriteIcon('actions-document-save-close', array('html' => '<input type="image" class="c-inputButton" name="_saveandclosedok" src="clear.gif" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveCloseDoc', 1) . '" />'));
         // FINISH TRANSLATION / SAVE / CLOSE
         if ($GLOBALS['TYPO3_CONF_VARS']['BE']['explicitConfirmationOfTranslation']) {
             $buttons['translation_save'] = '<input type="image" class="c-inputButton" name="_translation_savedok" src="' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/translationsavedok.gif', '', 1) . '" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.translationSaveDoc', 1) . '" />';
             $buttons['translation_saveclear'] = '<input type="image" class="c-inputButton" name="_translation_savedokclear" src="' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/translationsavedok_clear.gif', '', 1) . '" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.translationSaveDocClear', 1) . '" />';
         }
     }
     // CLOSE button:
     $buttons['close'] = '<a href="#" onclick="document.editform.closeDoc.value=1; document.editform.submit(); return false;" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-close') . '</a>';
     // DELETE + UNDO buttons:
     if (!$this->errorC && !$TCA[$this->firstEl['table']]['ctrl']['readOnly'] && count($this->elementsData) == 1) {
         if ($this->firstEl['cmd'] != 'new' && t3lib_div::testInt($this->firstEl['uid'])) {
             // Delete:
             if ($this->firstEl['deleteAccess'] && !$TCA[$this->firstEl['table']]['ctrl']['readOnly'] && !$this->getNewIconMode($this->firstEl['table'], 'disableDelete')) {
                 $aOnClick = 'return deleteRecord(\'' . $this->firstEl['table'] . '\',\'' . $this->firstEl['uid'] . '\',unescape(\'' . rawurlencode($this->retUrl) . '\'));';
                 $buttons['delete'] = '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '" title="' . $LANG->getLL('deleteItem', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-edit-delete') . '</a>';
             }
             // Undo:
             $undoRes = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tstamp', 'sys_history', 'tablename=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this->firstEl['table'], 'sys_history') . ' AND recuid=' . intval($this->firstEl['uid']), '', 'tstamp DESC', '1');
             if ($undoButtonR = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($undoRes)) {
                 $aOnClick = 'window.location.href=\'show_rechis.php?element=' . rawurlencode($this->firstEl['table'] . ':' . $this->firstEl['uid']) . '&revert=ALL_FIELDS&sumUp=-1&returnUrl=' . rawurlencode($this->R_URI) . '\'; return false;';
                 $buttons['undo'] = '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '"' . ' title="' . htmlspecialchars(sprintf($LANG->getLL('undoLastChange'), t3lib_BEfunc::calcAge($GLOBALS['EXEC_TIME'] - $undoButtonR['tstamp'], $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')))) . '">' . t3lib_iconWorks::getSpriteIcon('actions-edit-undo') . '</a>';
             }
             if ($this->getNewIconMode($this->firstEl['table'], 'showHistory')) {
                 $aOnClick = 'window.location.href=\'show_rechis.php?element=' . rawurlencode($this->firstEl['table'] . ':' . $this->firstEl['uid']) . '&returnUrl=' . rawurlencode($this->R_URI) . '\'; return false;';
                 $buttons['history'] = '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-history-open') . '</a>';
             }
             // If only SOME fields are shown in the form, this will link the user to the FULL form:
             if ($this->columnsOnly) {
                 $buttons['columns_only'] = '<a href="' . htmlspecialchars($this->R_URI . '&columnsOnly=') . '" title="' . $LANG->getLL('editWholeRecord', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a>';
             }
         }
     }
     // add the CSH icon
     $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'TCEforms', $GLOBALS['BACK_PATH'], '', TRUE);
     $buttons['shortcut'] = $this->shortCutLink();
     $buttons['open_in_new_window'] = $this->openInNewWindowLink();
     return $buttons;
 }
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:62,代码来源:alt_doc.php


注:本文中的t3lib_BEfunc::cshItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。