/**
  * Main function
  *
  * @return	string		HTML output
  */
 function main()
 {
     $content = '';
     $content .= $this->pObj->getHeaderBar('', t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[tx_dam_tools_serviceinfo.func]', $this->pObj->MOD_SETTINGS['tx_dam_tools_serviceinfo.func'], $this->pObj->MOD_MENU['tx_dam_tools_serviceinfo.func']));
     $content .= $this->pObj->doc->spacer(10);
     $content .= $this->moduleContent();
     return $content;
 }
 /**
  * Main function
  *
  * @return	string		HTML output
  */
 function main()
 {
     global $LANG;
     $content = '';
     $content .= $this->pObj->getHeaderBar('', $LANG->getLL('tx_dam_tools_config.showConfig') . t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[tx_dam_tools_config.func]', $this->pObj->MOD_SETTINGS['tx_dam_tools_config.func'], $this->pObj->MOD_MENU['tx_dam_tools_config.func']));
     $content .= $this->pObj->doc->spacer(10);
     $content .= $this->moduleContent();
     return $content;
 }
    /**
     * 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;
    }
Example #4
0
    /**
     * Main function of the module. Write the content to $this->content
     *
     * @return	void
     */
    public function main()
    {
        $this->thisScript = 'mod.php?M=' . $this->MCONF['name'];
        // Clean up settings:
        $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name']);
        // Draw the header
        $this->doc = t3lib_div::makeInstance('noDoc');
        $this->doc->backPath = $GLOBALS['BACK_PATH'];
        $this->doc->form = '<form action="" method="post">';
        // JavaScript
        $this->doc->JScode = $this->doc->wrapScriptTags('
				script_ended = 0;
				function jumpToUrl(URL)	{	//
					window.location.href = URL;
				}
			');
        // DBAL page title:
        $this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title'));
        $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title'));
        $this->content .= $this->doc->spacer(5);
        $this->content .= $this->doc->section('', $this->doc->funcMenu('', t3lib_BEfunc::getFuncMenu(0, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function'])));
        // Debug log:
        switch ($this->MOD_SETTINGS['function']) {
            case 'info':
                $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('Cached_info'), $this->printCachedInfo());
                break;
            case 'sqlcheck':
                $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('SQL_check'), $this->printSqlCheck());
                break;
            case 0:
                $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('Debug_log'), $this->printLogMgm());
                break;
        }
        // ShortCut
        if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
            $this->content .= $this->doc->spacer(20) . $this->doc->section('', $this->doc->makeShortcutIcon('id', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']));
        }
        $this->content .= $this->doc->spacer(10);
    }
Example #5
0
    /**
     * Main function of the module. Write the content to $this->content
     */
    function main()
    {
        global $AB, $BE_USER, $LANG, $BACK_PATH, $TCA_DESCR, $TCA, $HTTP_GET_VARS, $HTTP_POST_VARS, $CLIENT, $TYPO3_CONF_VARS;
        // Draw the header.
        $this->doc = t3lib_div::makeInstance("mediumDoc");
        $this->doc->backPath = $BACK_PATH;
        $this->doc->form = '<form action="" method="POST">';
        // JavaScript
        $this->doc->JScode = '
			<script language="javascript">
				script_ended = 0;
				function jumpToUrl(URL)	{
					document.location = URL;
				}
			</script>
		';
        $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause);
        $access = is_array($this->pageinfo) ? 1 : 0;
        if ($this->id && $access || $BE_USER->user["admin"] && !$this->id) {
            if ($BE_USER->user["admin"] && !$this->id) {
                $this->pageinfo = array("title" => "[root-level]", "uid" => 0, "pid" => 0);
            }
            $headerSection = $this->doc->getHeader("pages", $this->pageinfo, $this->pageinfo["_thePath"]) . "<br>" . $LANG->php3Lang["labels"]["path"] . ": " . t3lib_div::fixed_lgd_pre($this->pageinfo["_thePath"], 50);
            $this->content .= $this->doc->startPage($LANG->getLL("title"));
            $this->content .= $this->doc->header($LANG->getLL("title"));
            $this->content .= $this->doc->spacer(5);
            $this->content .= $this->doc->section("", $this->doc->funcMenu($headerSection, t3lib_BEfunc::getFuncMenu($this->id, "SET[function]", $this->MOD_SETTINGS["function"], $this->MOD_MENU["function"])));
            $this->content .= $this->doc->divider(5);
            // Render content:
            $this->moduleContent();
            // ShortCut
            if ($BE_USER->mayMakeShortcut()) {
                $this->content .= $this->doc->spacer(20) . $this->doc->section("", $this->doc->makeShortcutIcon("id", implode(",", array_keys($this->MOD_MENU)), $this->MCONF["name"]));
            }
        }
        $this->content .= $this->doc->spacer(10);
    }
Example #6
0
    /**
     * Main function of the module. Write the content to $this->content
     *
     * @return void
     */
    public function main()
    {
        // Draw the header.
        $this->doc = t3lib_div::makeInstance('mediumDoc');
        $this->doc->backPath = $GLOBALS['BACK_PATH'];
        $this->doc->form = '<form action="" method="post">';
        // JavaScript
        $this->doc->JScode = '
			<script language="javascript" type="text/javascript">
				script_ended = 0;
				function jumpToUrl(URL)	{
					document.location = URL;
				}
			</script>
		';
        $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause);
        $access = is_array($this->pageinfo) ? 1 : 0;
        if ($this->id && $access || $GLOBALS['BE_USER']->user['admin'] && !$this->id) {
            if ($GLOBALS['BE_USER']->user['admin'] && !$this->id) {
                $this->pageinfo = array('title' => '[root-level]', 'uid' => 0, 'pid' => 0);
            }
            $headerSection = $this->doc->getHeader('pages', $this->pageinfo, $this->pageinfo['_thePath']) . '<br />' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.path') . ': ' . t3lib_div::fixed_lgd_cs($this->pageinfo['_thePath'], -50);
            $this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title'));
            $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title'));
            $this->content .= $this->doc->spacer(5);
            $this->content .= $this->doc->section('', $this->doc->funcMenu($headerSection, t3lib_BEfunc::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function'])));
            $this->content .= $this->doc->divider(5);
            // Render content
            $this->moduleContent();
            // Shortcut
            if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
                $this->content .= $this->doc->spacer(20) . $this->doc->section('', $this->doc->makeShortcutIcon('id', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']));
            }
        }
        $this->content .= $this->doc->spacer(10);
    }
Example #7
0
 /**
  * Gets the function menu selector for this backend module.
  *
  * @return	string		The HTML representation of the function menu selector
  */
 protected function getFunctionMenu()
 {
     return t3lib_BEfunc::getFuncMenu(0, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']);
 }
Example #8
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);
    }
Example #9
0
    /**
     * Main function of the module. Write the content to $this->content
     * If you chose "web" as main module, you will need to consider the $this->id parameter which will contain the uid-number of the page clicked in the page tree
     *
     * @return	[type]		...
     */
    public function main()
    {
        global $BE_USER, $LANG, $BACK_PATH, $TCA_DESCR, $TCA, $CLIENT, $TYPO3_CONF_VARS;
        // Access check!
        // The page will show only if there is a valid page and if this page may be viewed by the user
        $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause);
        $access = is_array($this->pageinfo) ? 1 : 0;
        $docHeaderButtons = $this->getButtons();
        if ($this->id && $access || $BE_USER->user['admin'] && !$this->id) {
            // Draw the form
            $this->doc->form = '<form action="" method="post" enctype="multipart/form-data">';
            // JavaScript
            $this->doc->JScode = '
				<script language="javascript" type="text/javascript">
					script_ended = 0;
					function jumpToUrl(URL)	{
						document.location = URL;
					}
				</script>
			';
            $this->doc->postCode = '
				<script language="javascript" type="text/javascript">
					script_ended = 1;
					if (top.fsMod) top.fsMod.recentIds["web"] = 0;
				</script>
			';
            // Render content:
            $this->getModuleContent();
        } else {
            // If no access or if ID == zero
            $docHeaderButtons['save'] = '';
            $this->content .= $this->doc->spacer(10);
        }
        // compile document
        $markers['FUNC_MENU'] = t3lib_BEfunc::getFuncMenu(0, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']);
        $markers['CONTENT'] = $this->content;
        // Build the <body> for the module
        $this->content = $this->doc->startPage($LANG->getLL('title'));
        $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
        $this->content .= $this->doc->endPage();
        $this->content = $this->doc->insertStylesAndJS($this->content);
    }
Example #10
0
 /**
  * This functions builds the content of the page
  *
  * @return	void
  */
 function main()
 {
     $this->content = '';
     $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('backendUserAdministration', true));
     $this->content .= $this->doc->spacer(5);
     switch ($this->MOD_SETTINGS['function']) {
         case 'compare':
             if (t3lib_div::_GP('ads')) {
                 $compareFlags = t3lib_div::_GP('compareFlags');
                 $GLOBALS['BE_USER']->pushModuleData('tools_beuser/index.php/compare', $compareFlags);
             } else {
                 $compareFlags = $GLOBALS['BE_USER']->getModuleData('tools_beuser/index.php/compare', 'ses');
             }
             $this->content .= $this->compareUsers($compareFlags);
             break;
         case 'whoisonline':
             $this->content .= $this->whoIsOnline();
             break;
     }
     // Setting up the buttons and markers for docheader
     $docHeaderButtons = $this->getButtons();
     //$markers['CSH'] = $docHeaderButtons['csh'];
     $markers['FUNC_MENU'] = t3lib_BEfunc::getFuncMenu(0, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']);
     $markers['CONTENT'] = $this->content;
     // Build the <body> for the module
     $this->content = $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
     // Renders the module page
     $this->content = $this->doc->render('Backend User Administration', $this->content);
 }
Example #11
0
 protected function getFunctionMenu()
 {
     $functionMenu = 'No sites configured for Solr yet.';
     if ($this->site) {
         $functionMenu = t3lib_BEfunc::getFuncMenu(0, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']);
     }
     return $functionMenu;
 }
    /**
     * Main function, rendering the content of the rename form
     *
     * @return	void
     */
    function main()
    {
        //TODO remove global, change $LANG into $GLOBALS['LANG'], change locallang*.php to locallang*.xml
        global $LANG;
        // Make page header:
        $this->content = $this->doc->startPage($LANG->sL('LLL:EXT:lang/locallang_core.php:file_rename.php.pagetitle'));
        $pageContent = $this->doc->header($LANG->sL('LLL:EXT:lang/locallang_core.php:file_rename.php.pagetitle'));
        $pageContent .= $this->doc->spacer(5);
        $pageContent .= $this->doc->divider(5);
        $code = '<form action="tce_file.php" method="post" name="editform">';
        // Making the formfields for renaming:
        $code .= '

			<div id="c-rename">
				<input type="text" name="file[rename][0][data]" value="' . htmlspecialchars(basename($this->shortPath)) . '"' . $GLOBALS['TBE_TEMPLATE']->formWidth(20) . ' />
				<input type="hidden" name="file[rename][0][target]" value="' . htmlspecialchars($this->target) . '" />
			</div>
		';
        // Making submit button:
        $code .= '
			<div id="c-submit">
				<input type="submit" value="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:file_rename.php.submit', 1) . '" />
				<input type="submit" value="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.cancel', 1) . '" onclick="backToList(); return false;" />
				<input type="hidden" name="redirect" value="' . htmlspecialchars($this->returnUrl) . '" />
			</div>
		';
        $code .= '</form>';
        // Add the HTML as a section:
        $pageContent .= $code;
        $docHeaderButtons = array();
        $docHeaderButtons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'file_rename', $GLOBALS['BACK_PATH']);
        // Add the HTML as a section:
        $markerArray = array('CSH' => $docHeaderButtons['csh'], 'FUNC_MENU' => t3lib_BEfunc::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']), 'CONTENT' => $pageContent, 'PATH' => $this->title);
        $this->content .= $this->doc->moduleBody(array(), $docHeaderButtons, $markerArray);
        $this->content .= $this->doc->endPage();
        $this->content = $this->doc->insertStylesAndJS($this->content);
    }
    /**
     * 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;
    }
Example #14
0
    /**
     * Main function, creating the listing
     *
     * @return	void
     */
    function main()
    {
        global $BE_USER, $LANG, $BACK_PATH, $TYPO3_CONF_VARS, $FILEMOUNTS;
        // Initialize the template object
        $this->doc = t3lib_div::makeInstance('template');
        $this->doc->backPath = $BACK_PATH;
        $this->doc->setModuleTemplate('templates/file_list.html');
        $this->doc->getPageRenderer()->loadPrototype();
        // Validating the input "id" (the path, directory!) and checking it against the mounts of the user.
        $this->id = $this->basicFF->is_directory($this->id);
        $access = $this->id && $this->basicFF->checkPathAgainstMounts($this->id . '/');
        // There there was access to this file path, continue, make the list
        if ($access) {
            // include the initialization for the flash uploader
            if ($GLOBALS['BE_USER']->uc['enableFlashUploader']) {
                $this->doc->JScodeArray['flashUploader'] = '
					if (top.TYPO3.FileUploadWindow.isFlashAvailable()) {
						document.observe("dom:loaded", function() {
								// monitor the button
							$("button-upload").observe("click", initFlashUploader);

							function initFlashUploader(event) {
									// set the page specific options for the flashUploader
								var flashUploadOptions = {
									uploadURL:           top.TS.PATH_typo3 + "ajax.php",
									uploadFileSizeLimit: "' . t3lib_div::getMaxUploadFileSize() . '",
									uploadFileTypes: {
										allow:  "' . $GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions']['webspace']['allow'] . '",
										deny: "' . $GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions']['webspace']['deny'] . '"
									},
									uploadFilePostName:  "upload_1",
									uploadPostParams: {
										"file[upload][1][target]": "' . $this->id . '",
										"file[upload][1][data]": 1,
										"file[upload][1][charset]": "utf-8",
										"ajaxID": "TYPO3_tcefile::process"
									}
								};

									// get the flashUploaderWindow instance from the parent frame
								var flashUploader = top.TYPO3.FileUploadWindow.getInstance(flashUploadOptions);
								// add an additional function inside the container to show the checkbox option
								var infoComponent = new top.Ext.Panel({
									autoEl: { tag: "div" },
									height: "auto",
									bodyBorder: false,
									border: false,
									hideBorders: true,
									cls: "t3-upload-window-infopanel",
									id: "t3-upload-window-infopanel-addition",
									html: \'<label for="overrideExistingFilesCheckbox"><input id="overrideExistingFilesCheckbox" type="checkbox" onclick="setFlashPostOptionOverwriteExistingFiles(this);" />\' + top.String.format(top.TYPO3.LLL.fileUpload.infoComponentOverrideFiles) + \'</label>\'
								});
								flashUploader.add(infoComponent);

									// do a reload of this frame once all uploads are done
								flashUploader.on("totalcomplete", function() {
									window.location.reload();
								});

									// this is the callback function that delivers the additional post parameter to the flash application
								top.setFlashPostOptionOverwriteExistingFiles = function(checkbox) {
									var uploader = top.TYPO3.getInstance("FileUploadWindow");
									if (uploader.isVisible()) {
										uploader.swf.addPostParam("overwriteExistingFiles", (checkbox.checked == true ? 1 : 0));
									}
								};

								event.stop();
							};
						});
					}
				';
            }
            // Create filelisting object
            $this->filelist = t3lib_div::makeInstance('fileList');
            $this->filelist->backPath = $BACK_PATH;
            // Apply predefined values for hidden checkboxes
            // Set predefined value for DisplayBigControlPanel:
            if ($GLOBALS['BE_USER']->getTSConfigVal('options.file_list.enableDisplayBigControlPanel') === 'activated') {
                $this->MOD_SETTINGS['bigControlPanel'] = TRUE;
            } elseif ($GLOBALS['BE_USER']->getTSConfigVal('options.file_list.enableDisplayBigControlPanel') === 'deactivated') {
                $this->MOD_SETTINGS['bigControlPanel'] = FALSE;
            }
            // Set predefined value for DisplayThumbnails:
            if ($GLOBALS['BE_USER']->getTSConfigVal('options.file_list.enableDisplayThumbnails') === 'activated') {
                $this->MOD_SETTINGS['displayThumbs'] = TRUE;
            } elseif ($GLOBALS['BE_USER']->getTSConfigVal('options.file_list.enableDisplayThumbnails') === 'deactivated') {
                $this->MOD_SETTINGS['displayThumbs'] = FALSE;
            }
            // Set predefined value for Clipboard:
            if ($GLOBALS['BE_USER']->getTSConfigVal('options.file_list.enableClipBoard') === 'activated') {
                $this->MOD_SETTINGS['clipBoard'] = TRUE;
            } elseif ($GLOBALS['BE_USER']->getTSConfigVal('options.file_list.enableClipBoard') === 'deactivated') {
                $this->MOD_SETTINGS['clipBoard'] = FALSE;
            }
            // if user never opened the list module, set the value for displayThumbs
            if (!isset($this->MOD_SETTINGS['displayThumbs'])) {
                $this->MOD_SETTINGS['displayThumbs'] = $BE_USER->uc['thumbnailsByDefault'];
            }
            $this->filelist->thumbs = $this->MOD_SETTINGS['displayThumbs'];
            // Create clipboard object and initialize that
            $this->filelist->clipObj = t3lib_div::makeInstance('t3lib_clipboard');
            $this->filelist->clipObj->fileMode = 1;
            $this->filelist->clipObj->initializeClipboard();
            $CB = t3lib_div::_GET('CB');
            if ($this->cmd == 'setCB') {
                $CB['el'] = $this->filelist->clipObj->cleanUpCBC(array_merge(t3lib_div::_POST('CBH'), t3lib_div::_POST('CBC')), '_FILE');
            }
            if (!$this->MOD_SETTINGS['clipBoard']) {
                $CB['setP'] = 'normal';
            }
            $this->filelist->clipObj->setCmd($CB);
            $this->filelist->clipObj->cleanCurrent();
            $this->filelist->clipObj->endClipboard();
            // Saves
            // If the "cmd" was to delete files from the list (clipboard thing), do that:
            if ($this->cmd == 'delete') {
                $items = $this->filelist->clipObj->cleanUpCBC(t3lib_div::_POST('CBC'), '_FILE', 1);
                if (count($items)) {
                    // Make command array:
                    $FILE = array();
                    foreach ($items as $v) {
                        $FILE['delete'][] = array('data' => $v);
                    }
                    // Init file processing object for deleting and pass the cmd array.
                    $fileProcessor = t3lib_div::makeInstance('t3lib_extFileFunctions');
                    $fileProcessor->init($FILEMOUNTS, $TYPO3_CONF_VARS['BE']['fileExtensions']);
                    $fileProcessor->init_actionPerms($GLOBALS['BE_USER']->getFileoperationPermissions());
                    $fileProcessor->dontCheckForUnique = $this->overwriteExistingFiles ? 1 : 0;
                    $fileProcessor->start($FILE);
                    $fileProcessor->processData();
                    $fileProcessor->printLogErrorMessages();
                }
            }
            if (!isset($this->MOD_SETTINGS['sort'])) {
                // Set default sorting
                $this->MOD_SETTINGS['sort'] = 'file';
                $this->MOD_SETTINGS['reverse'] = 0;
            }
            // Start up filelisting object, include settings.
            $this->pointer = t3lib_div::intInRange($this->pointer, 0, 100000);
            $this->filelist->start($this->id, $this->pointer, $this->MOD_SETTINGS['sort'], $this->MOD_SETTINGS['reverse'], $this->MOD_SETTINGS['clipBoard'], $this->MOD_SETTINGS['bigControlPanel']);
            // Generate the list
            $this->filelist->generateList();
            // Write the footer
            $this->filelist->writeBottom();
            // Set top JavaScript:
            $this->doc->JScode = $this->doc->wrapScriptTags('

			if (top.fsMod) top.fsMod.recentIds["file"] = unescape("' . rawurlencode($this->id) . '");
			function jumpToUrl(URL)	{	//
				window.location.href = URL;
			}

			' . $this->filelist->CBfunctions());
            // This will return content necessary for the context sensitive clickmenus to work: bodytag events, JavaScript functions and DIV-layers.
            $this->doc->getContextMenuCode();
            // Setting up the buttons and markers for docheader
            list($buttons, $otherMarkers) = $this->filelist->getButtonsAndOtherMarkers($this->id);
            // add the folder info to the marker array
            $otherMarkers['FOLDER_INFO'] = $this->filelist->getFolderInfo();
            $docHeaderButtons = array_merge($this->getButtons(), $buttons);
            // Build the <body> for the module
            // Create output
            $pageContent = '';
            $pageContent .= '<form action="' . htmlspecialchars($this->filelist->listURL()) . '" method="post" name="dblistForm">';
            $pageContent .= $this->filelist->HTMLcode;
            $pageContent .= '<input type="hidden" name="cmd" /></form>';
            if ($this->filelist->HTMLcode) {
                // Making listing options:
                $pageContent .= '

					<!--
						Listing options for extended view, clipboard and thumbnails
					-->
					<div id="typo3-listOptions">
				';
                // Add "display bigControlPanel" checkbox:
                if ($GLOBALS['BE_USER']->getTSConfigVal('options.file_list.enableDisplayBigControlPanel') === 'selectable') {
                    $pageContent .= t3lib_BEfunc::getFuncCheck($this->id, 'SET[bigControlPanel]', $this->MOD_SETTINGS['bigControlPanel'], 'file_list.php', '', 'id="bigControlPanel"') . '<label for="bigControlPanel"> ' . $GLOBALS['LANG']->getLL('bigControlPanel', TRUE) . '</label><br />';
                }
                // Add "display thumbnails" checkbox:
                if ($GLOBALS['BE_USER']->getTSConfigVal('options.file_list.enableDisplayThumbnails') === 'selectable') {
                    $pageContent .= t3lib_BEfunc::getFuncCheck($this->id, 'SET[displayThumbs]', $this->MOD_SETTINGS['displayThumbs'], 'file_list.php', '', 'id="checkDisplayThumbs"') . ' <label for="checkDisplayThumbs">' . $GLOBALS['LANG']->getLL('displayThumbs', TRUE) . '</label><br />';
                }
                // Add "clipboard" checkbox:
                if ($GLOBALS['BE_USER']->getTSConfigVal('options.file_list.enableClipBoard') === 'selectable') {
                    $pageContent .= t3lib_BEfunc::getFuncCheck($this->id, 'SET[clipBoard]', $this->MOD_SETTINGS['clipBoard'], 'file_list.php', '', 'id="checkClipBoard"') . ' <label for="checkClipBoard">' . $GLOBALS['LANG']->getLL('clipBoard', TRUE) . '</label>';
                }
                $pageContent .= '
					</div>
				';
                // Set clipboard:
                if ($this->MOD_SETTINGS['clipBoard']) {
                    $pageContent .= $this->filelist->clipObj->printClipboard();
                    $pageContent .= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'filelist_clipboard', $GLOBALS['BACK_PATH']);
                }
            }
            $markerArray = array('CSH' => $docHeaderButtons['csh'], 'FUNC_MENU' => t3lib_BEfunc::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']), 'CONTENT' => $pageContent);
            $this->content = $this->doc->moduleBody(array(), $docHeaderButtons, array_merge($markerArray, $otherMarkers));
            // Renders the module page
            $this->content = $this->doc->render($LANG->getLL('files'), $this->content);
        } else {
            // Create output - no access (no warning though)
            $this->content = $this->doc->render($LANG->getLL('files'), '');
        }
    }
 /**
  * Main function, rendering the upload file form fields
  *
  * @return	void
  */
 function main()
 {
     // Make page header:
     $this->content = $this->doc->startPage($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:file_upload.php.pagetitle'));
     $form = $this->renderUploadForm();
     $pageContent = $this->doc->header($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:file_upload.php.pagetitle')) . $this->doc->section('', $form);
     // Header Buttons
     $docHeaderButtons = array('csh' => t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'file_upload', $GLOBALS['BACK_PATH']));
     $markerArray = array('CSH' => $docHeaderButtons['csh'], 'FUNC_MENU' => t3lib_BEfunc::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']), 'CONTENT' => $pageContent, 'PATH' => $this->title);
     $this->content .= $this->doc->moduleBody(array(), $docHeaderButtons, $markerArray);
     $this->content .= $this->doc->endPage();
     $this->content = $this->doc->insertStylesAndJS($this->content);
 }
 function main()
 {
     global $SOBE, $BE_USER, $LANG, $BACK_PATH, $TCA_DESCR, $TCA, $CLIENT, $TYPO3_CONF_VARS;
     global $tmpl, $tplRow, $theConstants;
     // **************************
     // Create extension template
     // **************************
     $this->pObj->createTemplate($this->pObj->id);
     // **************************
     // Checking for more than one template an if, set a menu...
     // **************************
     $manyTemplatesMenu = $this->pObj->templateMenu();
     $template_uid = 0;
     if ($manyTemplatesMenu) {
         $template_uid = $this->pObj->MOD_SETTINGS["templatesOnPage"];
     }
     // **************************
     // Main
     // **************************
     // BUGBUG: Should we check if the uset may at all read and write template-records???
     $existTemplate = $this->initialize_editor($this->pObj->id, $template_uid);
     // initialize
     if ($existTemplate) {
         $saveId = $tplRow['_ORIG_uid'] ? $tplRow['_ORIG_uid'] : $tplRow['uid'];
         // Update template ?
         if (t3lib_div::_POST('submit') || t3lib_div::testInt(t3lib_div::_POST('submit_x')) && t3lib_div::testInt(t3lib_div::_POST('submit_y'))) {
             $tmpl->changed = 0;
             $tmpl->ext_procesInput(t3lib_div::_POST(), $_FILES, $theConstants, $tplRow);
             //		debug($tmpl->changed);
             //		debug($tmpl->raw);
             //		$tmpl->changed=0;
             if ($tmpl->changed) {
                 // Set the data to be saved
                 $recData = array();
                 $recData["sys_template"][$saveId]["constants"] = implode($tmpl->raw, LF);
                 // Create new  tce-object
                 $tce = t3lib_div::makeInstance("t3lib_TCEmain");
                 $tce->stripslashes_values = 0;
                 // Initialize
                 $tce->start($recData, array());
                 // Saved the stuff
                 $tce->process_datamap();
                 // Clear the cache (note: currently only admin-users can clear the cache in tce_main.php)
                 $tce->clear_cacheCmd("all");
                 // re-read the template ...
                 $this->initialize_editor($this->pObj->id, $template_uid);
             }
         }
         // Output edit form
         $tmpl->ext_readDirResources($TYPO3_CONF_VARS["MODS"]["web_ts"]["onlineResourceDir"]);
         $tmpl->ext_resourceDims();
         // Resetting the menu (start). I wonder if this in any way is a violation of the menu-system. Haven't checked. But need to do it here, because the menu is dependent on the categories available.
         $this->pObj->MOD_MENU["constant_editor_cat"] = $tmpl->ext_getCategoryLabelArray();
         $this->pObj->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->pObj->MOD_MENU, t3lib_div::_GP("SET"), $this->pObj->MCONF["name"]);
         // Resetting the menu (stop)
         $theOutput .= $this->pObj->doc->spacer(5);
         $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('editConstants', true), t3lib_iconWorks::getSpriteIconForRecord('sys_template', $tplRow) . '<strong>' . $this->pObj->linkWrapTemplateTitle($tplRow["title"], "constants") . '</strong>' . htmlspecialchars(trim($tplRow["sitetitle"]) ? ' - (' . $tplRow["sitetitle"] . ')' : ''), 0, 1);
         if ($manyTemplatesMenu) {
             $theOutput .= $this->pObj->doc->section("", $manyTemplatesMenu);
             $theOutput .= $this->pObj->doc->divider(5);
         }
         $theOutput .= $this->pObj->doc->spacer(5);
         if (count($this->pObj->MOD_MENU["constant_editor_cat"])) {
             $menu = $GLOBALS['LANG']->getLL('category', true) . " " . t3lib_BEfunc::getFuncMenu($this->pObj->id, "SET[constant_editor_cat]", $this->pObj->MOD_SETTINGS["constant_editor_cat"], $this->pObj->MOD_MENU["constant_editor_cat"]);
             $theOutput .= $this->pObj->doc->section("", '<NOBR>' . $menu . '</NOBR>');
         } else {
             $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('noConstants', true), $GLOBALS['LANG']->getLL('noConstantsDescription', true), 1, 0, 1);
         }
         // Category and constant editor config:
         $category = $this->pObj->MOD_SETTINGS["constant_editor_cat"];
         /*	$TSCE_tmpl = t3lib_div::makeInstance("t3lib_tsparser_ext");	// Defined global here!
         			$TSCE_tmpl->tt_track = 0;	// Do not log time-performance information
         			$TSCE_tmpl->init();
         			$TSCE_tmpl->constants=array($tplRow["constants"]);
         			debug($tplRow);
         			$TSCE_tmpl->generateConfig_constants();
         			debug($TSCE_tmpl->setup);
         			*/
         $tmpl->ext_getTSCE_config($category);
         # NOT WORKING:
         if ($BE_USER_modOptions["properties"]["constantEditor."]["example"] == "top") {
             $theOutput = $this->displayExample($theOutput);
         }
         $printFields = trim($tmpl->ext_printFields($theConstants, $category));
         if ($printFields) {
             $theOutput .= $this->pObj->doc->spacer(20);
             $theOutput .= $this->pObj->doc->section("", $printFields);
         }
         if ($BE_USER_modOptions["properties"]["constantEditor."]["example"] != "top") {
             $theOutput = $this->displayExample($theOutput);
         }
     } else {
         $theOutput .= $this->pObj->noTemplate(1);
     }
     return $theOutput;
 }
 /**
  * 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;
 }
Example #18
0
    /**
     * Creates the template mapper table + form for either direct file mapping or Template Object
     *
     * @param	string		The abs file name to read
     * @param	string		The HTML-path to follow. Eg. 'td#content table[1] tr[1] / INNER | img[0]' or so. Normally comes from clicking a tag-image in the display frame.
     * @param	array		The data Structure to map to
     * @param	array		The current mapping information
     * @param	string		HTML content to show after the Data Structure table.
     * @return	string		HTML table.
     */
    function renderTemplateMapper($displayFile, $path, $dataStruct = array(), $currentMappingInfo = array(), $htmlAfterDSTable = '')
    {
        // Get file content
        $this->markupFile = $displayFile;
        $fileContent = t3lib_div::getUrl($this->markupFile);
        // Init mark up object.
        $this->markupObj = t3lib_div::makeInstance('tx_templavoila_htmlmarkup');
        // Load splitted content from currentMappingInfo array (used to show us which elements maps to some real content).
        $contentSplittedByMapping = $this->markupObj->splitContentToMappingInfo($fileContent, $currentMappingInfo);
        // Show path:
        $pathRendered = t3lib_div::trimExplode('|', $path, 1);
        $acc = array();
        foreach ($pathRendered as $k => $v) {
            $acc[] = $v;
            $pathRendered[$k] = $this->linkForDisplayOfPath($v, implode('|', $acc));
        }
        array_unshift($pathRendered, $this->linkForDisplayOfPath('[ROOT]', ''));
        // Get attributes of the extracted content:
        $attrDat = array();
        $contentFromPath = $this->markupObj->splitByPath($fileContent, $path);
        // ,'td#content table[1] tr[1]','td#content table[1]','map#cdf / INNER','td#content table[2] tr[1] td[1] table[1] tr[4] td.bckgd1[2] table[1] tr[1] td[1] table[1] tr[1] td.bold1px[1] img[1] / RANGE:img[2]'
        $firstTag = $this->markupObj->htmlParse->getFirstTag($contentFromPath[1]);
        list($attrDat) = $this->markupObj->htmlParse->get_tag_attributes($firstTag, 1);
        // Make options:
        $pathLevels = $this->markupObj->splitPath($path);
        $lastEl = end($pathLevels);
        $optDat = array();
        $optDat[$lastEl['path']] = 'OUTER (Include tag)';
        $optDat[$lastEl['path'] . '/INNER'] = 'INNER (Exclude tag)';
        // Tags, which will trigger "INNER" to be listed on top (because it is almost always INNER-mapping that is needed)
        if (t3lib_div::inList('body,span,h1,h2,h3,h4,h5,h6,div,td,p,b,i,u,a', $lastEl['el'])) {
            $optDat = array_reverse($optDat);
        }
        // Add options for "samelevel" elements:
        $sameLevelElements = $this->markupObj->elParentLevel[$lastEl['parent']];
        if (is_array($sameLevelElements)) {
            $startFound = 0;
            foreach ($sameLevelElements as $rEl) {
                if ($startFound) {
                    $optDat[$lastEl['path'] . '/RANGE:' . $rEl] = 'RANGE to "' . $rEl . '"';
                }
                if (trim($lastEl['parent'] . ' ' . $rEl) == $lastEl['path']) {
                    $startFound = 1;
                }
            }
        }
        // Add options for attributes:
        if (is_array($attrDat)) {
            foreach ($attrDat as $attrK => $v) {
                $optDat[$lastEl['path'] . '/ATTR:' . $attrK] = 'ATTRIBUTE "' . $attrK . '" (= ' . t3lib_div::fixed_lgd_cs($v, 15) . ')';
            }
        }
        // Create Data Structure table:
        $content .= '

			<!--
				Data Structure table:
			-->
			<table border="0" cellspacing="2" cellpadding="2">
			<tr class="bgColor5">
				<td nowrap="nowrap"><strong>Data Element:</strong>' . $this->cshItem('xMOD_tx_templavoila', 'mapping_head_dataElement', $this->doc->backPath, '', TRUE) . '</td>
				' . ($this->editDataStruct ? '<td nowrap="nowrap"><strong>Field:</strong>' . $this->cshItem('xMOD_tx_templavoila', 'mapping_head_Field', $this->doc->backPath, '', TRUE) . '</td>' : '') . '
				<td nowrap="nowrap"><strong>' . (!$this->_preview ? 'Mapping instructions:' : 'Sample Data:') . '</strong>' . $this->cshItem('xMOD_tx_templavoila', 'mapping_head_' . (!$this->_preview ? 'mapping_instructions' : 'sample_data'), $this->doc->backPath, '', TRUE) . '<br /><img src="clear.gif" width="200" height="1" alt="" /></td>
				<td nowrap="nowrap"><strong>HTML-path:</strong>' . $this->cshItem('xMOD_tx_templavoila', 'mapping_head_HTMLpath', $this->doc->backPath, '', TRUE) . '</td>
				<td nowrap="nowrap"><strong>Action:</strong>' . $this->cshItem('xMOD_tx_templavoila', 'mapping_head_Action', $this->doc->backPath, '', TRUE) . '</td>
				<td nowrap="nowrap"><strong>Rules:</strong>' . $this->cshItem('xMOD_tx_templavoila', 'mapping_head_Rules', $this->doc->backPath, '', TRUE) . '</td>
				' . ($this->editDataStruct ? '<td nowrap="nowrap"><strong>Edit:</strong>' . $this->cshItem('xMOD_tx_templavoila', 'mapping_head_Edit', $this->doc->backPath, '', TRUE) . '</td>' : '') . '
			</tr>
			' . implode('', $this->drawDataStructureMap($dataStruct, 1, $currentMappingInfo, $pathLevels, $optDat, $contentSplittedByMapping)) . '</table>
			' . $htmlAfterDSTable . $this->cshItem('xMOD_tx_templavoila', 'mapping_basics', $this->doc->backPath, '');
        // Make mapping window:
        $limitTags = implode(',', array_keys($this->explodeMappingToTagsStr($this->mappingToTags, 1)));
        if ($this->mapElPath && !$this->doMappingOfPath || $this->showPathOnly || $this->_preview) {
            $content .= '

			<!--
				Visual Mapping Window (Iframe)
			-->
			<h3>Mapping Window:</h3>
			<!-- <p><strong>File:</strong> ' . htmlspecialchars($displayFile) . '</p> -->
			<p>' . t3lib_BEfunc::getFuncMenu('', 'SET[displayMode]', $this->MOD_SETTINGS['displayMode'], $this->MOD_MENU['displayMode'], '', t3lib_div::implodeArrayForUrl('', $_GET, '', 1, 1)) . $this->cshItem('xMOD_tx_templavoila', 'mapping_window_modes', $this->doc->backPath, '') . '</p>';
            if ($this->_preview) {
                $content .= '

					<!--
						Preview information table
					-->
					<table border="0" cellpadding="4" cellspacing="2" id="c-mapInfo">
						<tr class="bgColor5"><td><strong>Preview of Data Structure sample data merged into the mapped tags:</strong>' . $this->cshItem('xMOD_tx_templavoila', 'mapping_window_help', $this->doc->backPath, '') . '</td></tr>
					</table>
				';
                // Add the Iframe:
                $content .= $this->makeIframeForVisual($displayFile, '', '', 0, 1);
            } else {
                $tRows = array();
                if ($this->showPathOnly) {
                    $tRows[] = '
						<tr class="bgColor4">
							<td class="bgColor5"><strong>HTML path:</strong></td>
							<td>' . htmlspecialchars($this->displayPath) . '</td>
						</tr>
					';
                } else {
                    $tRows[] = '
						<tr class="bgColor4">
							<td class="bgColor5"><strong>Mapping DS element:</strong></td>
							<td>' . $this->elNames[$this->mapElPath]['tx_templavoila']['title'] . '</td>
						</tr>
						<tr class="bgColor4">
							<td class="bgColor5"><strong>Limiting to tags:</strong></td>
							<td>' . htmlspecialchars($limitTags ? strtoupper($limitTags) : '(ALL TAGS)') . '</td>
						</tr>
						<tr class="bgColor4">
							<td class="bgColor5"><strong>Instructions:</strong></td>
							<td>' . htmlspecialchars($this->elNames[$this->mapElPath]['tx_templavoila']['description']) . '</td>
						</tr>
					';
                }
                $content .= '

					<!--
						Mapping information table
					-->
					<table border="0" cellpadding="2" cellspacing="2" id="c-mapInfo">
						' . implode('', $tRows) . '
					</table>
				';
                // Add the Iframe:
                $content .= $this->makeIframeForVisual($displayFile, $this->displayPath, $limitTags, $this->doMappingOfPath);
            }
        }
        return $content;
    }
 /**
  * Creates a tab menu from an array definition
  *
  * Returns a tab menu for a module
  * Requires the JS function jumpToUrl() to be available
  *
  * @param	mixed		$id is the "&id=" parameter value to be sent to the module, but it can be also a parameter array which will be passed instead of the &id=...
  * @param	string		$elementName it the form elements name, probably something like "SET[...]"
  * @param	string		$currentValue is the value to be selected currently.
  * @param	array		$menuItems is an array with the menu items for the selector box
  * @param	string		$script is the script to send the &id to, if empty it's automatically found
  * @param	string		$addParams is additional parameters to pass to the script.
  * @return	string		HTML code for tab menu
  */
 function getTabMenu($mainParams, $elementName, $currentValue, $menuItems, $script = '', $addparams = '')
 {
     // read page TSconfig
     $useTabs = tx_dam::config_checkValueEnabled('mod.txdamM1_SHARED.useTabs');
     if ($useTabs && is_array($menuItems)) {
         if (!is_array($mainParams)) {
             $mainParams = array('id' => $mainParams);
         }
         $mainParams = t3lib_div::implodeArrayForUrl('', $mainParams);
         if (!$script) {
             $script = basename(PATH_thisScript);
         }
         $menuDef = array();
         foreach ($menuItems as $value => $label) {
             $menuDef[$value]['isActive'] = !strcmp($currentValue, $value);
             $menuDef[$value]['label'] = t3lib_div::deHSCentities(htmlspecialchars($label));
             // original: $menuDef[$value]['url'] = htmlspecialchars($script.'?'.$mainParams.$addparams.'&'.$elementName.'='.$value);
             $menuDef[$value]['url'] = $script . '?' . $mainParams . $addparams . '&' . $elementName . '=' . $value;
         }
         $this->content .= $this->doc->getTabMenuRaw($menuDef);
         return '';
     } else {
         return t3lib_BEfunc::getFuncMenu($this->id, $elementName, $currentValue, $menuItems);
     }
 }
Example #20
0
    /**
     * Main function
     *
     * @return	string		HTML output
     */
    function main()
    {
        global $LANG, $BACK_PATH;
        $this->incLocalLang();
        $this->loadExtensionSettings();
        if (empty($this->pObj->MOD_SETTINGS['processListMode'])) {
            $this->pObj->MOD_SETTINGS['processListMode'] = 'simple';
        }
        // Set CSS styles specific for this document:
        $this->pObj->content = str_replace('/*###POSTCSSMARKER###*/', '
			TABLE.c-list TR TD { white-space: nowrap; vertical-align: top; }
		', $this->pObj->content);
        $this->pObj->content .= '<style type="text/css"><!--
			table.url-table,
			table.param-expanded,
			table.crawlerlog {
				border-bottom: 1px solid grey;
				border-spacing: 0;
				border-collapse: collapse;
			}
			table.crawlerlog td,
			table.url-table td {
				border: 1px solid lightgrey;
				border-bottom: 1px solid grey;
				 white-space: nowrap; vertical-align: top;
			}
		--></style>
		<link rel="stylesheet" type="text/css" href="' . $BACK_PATH . '../typo3conf/ext/crawler/template/res.css" />
		';
        // Type function menu:
        $h_func = t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[crawlaction]', $this->pObj->MOD_SETTINGS['crawlaction'], $this->pObj->MOD_MENU['crawlaction'], 'index.php');
        /*
        	// Showing depth-menu in certain cases:
        if ($this->pObj->MOD_SETTINGS['crawlaction']!=='cli' && $this->pObj->MOD_SETTINGS['crawlaction']!== 'multiprocess' && ($this->pObj->MOD_SETTINGS['crawlaction']!=='log' || $this->pObj->id))	{
        	$h_func .= t3lib_BEfunc::getFuncMenu(
        		$this->pObj->id,
        		'SET[depth]',
        		$this->pObj->MOD_SETTINGS['depth'],
        		$this->pObj->MOD_MENU['depth'],
        		'index.php'
        	);
        }
        */
        // Additional menus for the log type:
        if ($this->pObj->MOD_SETTINGS['crawlaction'] === 'log') {
            $h_func .= t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[depth]', $this->pObj->MOD_SETTINGS['depth'], $this->pObj->MOD_MENU['depth'], 'index.php');
            $quiPart = t3lib_div::_GP('qid_details') ? '&qid_details=' . intval(t3lib_div::_GP('qid_details')) : '';
            $setId = intval(t3lib_div::_GP('setID'));
            $h_func .= '<hr/>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.display') . ': ' . t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[log_display]', $this->pObj->MOD_SETTINGS['log_display'], $this->pObj->MOD_MENU['log_display'], 'index.php', '&setID=' . $setId) . ' - ' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.showresultlog') . ': ' . t3lib_BEfunc::getFuncCheck($this->pObj->id, 'SET[log_resultLog]', $this->pObj->MOD_SETTINGS['log_resultLog'], 'index.php', '&setID=' . $setId . $quiPart) . ' - ' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.showfevars') . ': ' . t3lib_BEfunc::getFuncCheck($this->pObj->id, 'SET[log_feVars]', $this->pObj->MOD_SETTINGS['log_feVars'], 'index.php', '&setID=' . $setId . $quiPart) . ' - ' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage') . ': ' . t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[itemsPerPage]', $this->pObj->MOD_SETTINGS['itemsPerPage'], $this->pObj->MOD_MENU['itemsPerPage'], 'index.php');
        }
        $theOutput = $this->pObj->doc->spacer(5);
        $theOutput .= $this->pObj->doc->section($LANG->getLL('title'), $h_func, 0, 1);
        // Branch based on type:
        switch ((string) $this->pObj->MOD_SETTINGS['crawlaction']) {
            case 'start':
                if (empty($this->pObj->id)) {
                    $theOutput .= '<br />' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noPageSelected');
                } else {
                    $theOutput .= $this->pObj->doc->section('', $this->drawURLs(), 0, 1);
                }
                break;
            case 'log':
                $theOutput .= $this->pObj->doc->section('', $this->drawLog(), 0, 1);
                break;
            case 'cli':
                $theOutput .= $this->pObj->doc->section('', $this->drawCLIstatus(), 0, 1);
                break;
            case 'multiprocess':
                $theOutput .= $this->pObj->doc->section('', $this->drawProcessOverviewAction(), 0, 1);
                break;
        }
        return $theOutput;
    }
    /**
     * Showing the permissions in a tree ($this->edit = false)
     * (Adding content to internal content variable)
     *
     * @return	void
     */
    function notEdit()
    {
        global $BE_USER, $LANG, $BACK_PATH;
        // get ACL configuration
        $beAclConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['be_acl']);
        if ($beAclConfig['disableOldPermissionSystem']) {
            $disableOldPermissionSystem = 1;
        } else {
            $disableOldPermissionSystem = 0;
        }
        $LANG->includeLLFile('EXT:be_acl/res/locallang_perm.php');
        // 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
        $groupArray = $BE_USER->userGroupsUID;
        $be_user_Array = t3lib_BEfunc::getUserNames();
        if (!$GLOBALS['BE_USER']->isAdmin()) {
            $be_user_Array = t3lib_BEfunc::blindUserNames($be_user_Array, $groupArray, 0);
        }
        $be_group_Array = t3lib_BEfunc::getGroupNames();
        if (!$GLOBALS['BE_USER']->isAdmin()) {
            $be_group_Array = t3lib_BEfunc::blindGroupNames($be_group_Array, $groupArray, 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::getIconImage('pages', $this->pageinfo, $BACK_PATH, 'align="top"');
        $tree->tree[] = array('row' => $this->pageinfo, 'HTML' => $HTML);
        // Create the tree from $this->id:
        $tree->getTree($this->id, $this->MOD_SETTINGS['depth'], '');
        // get list of ACL users and groups, and initialize ACLs
        $aclUsers = $this->acl_objectSelector(0, $displayUserSelector, $beAclConfig);
        $aclGroups = $this->acl_objectSelector(1, $displayGroupSelector, $beAclConfig);
        $this->buildACLtree($aclUsers, $aclGroups);
        $this->content .= $displayUserSelector;
        $this->content .= $displayGroupSelector;
        // Make header of table:
        $code = '';
        if ($this->MOD_SETTINGS['mode'] == 'perms') {
            $code .= '
				<tr>
					<td class="bgColor2" colspan="2">&nbsp;</td>';
            $code .= '
					<td class="bgColor2"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>';
            $tableCells = array();
            if (!$disableOldPermissionSystem) {
                $tableCells[] = '<b>' . $LANG->getLL('Owner', 1) . '</b>';
                $tableCells[] = '<b>' . $LANG->getLL('Group', 1) . '</b>';
                $tableCells[] = '<b>' . $LANG->getLL('Everybody', 1) . '</b>';
            }
            // $tableCells[] = '<b>'.$LANG->getLL('EditLock',1).'</b>'; // TODO: Editlock
            // ACL headers
            if (!empty($aclUsers)) {
                $tableCells[] = '<b>' . $GLOBALS['LANG']->getLL('aclUser') . '</b>';
                foreach ($aclUsers as $uid) {
                    $tableCells[] = $be_user_Array[$uid]['username'];
                }
            }
            if (!empty($aclGroups)) {
                $tableCells[] = '<b>' . $GLOBALS['LANG']->getLL('aclGroup') . '</b>';
                foreach ($aclGroups as $uid) {
                    $tableCells[] = $be_group_Array[$uid]['title'];
                }
            }
            $code .= $this->printTableHeader($tableCells);
            $code .= '</tr>';
        } else {
            $code .= '
				<tr>
					<td class="bgColor2" colspan="2">&nbsp;</td>
					<td class="bgColor2"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td class="bgColor2" align="center" nowrap="nowrap"><b>' . $LANG->getLL('User', 1) . ':</b> ' . $BE_USER->user['username'] . '</td>
					' . (!$BE_USER->isAdmin() ? '<td class="bgColor2"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td class="bgColor2" align="center"><b>' . $LANG->getLL('EditLock', 1) . '</b></td>' : '') . '
				</tr>';
        }
        // Traverse tree:
        foreach ($tree->tree as $data) {
            $cells = array();
            // Background colors:
            //if ($this->lastEdited==$data['row']['uid'])	{$bgCol = ' class="bgColor-20"';} else {$bgCol = '';}
            $bgCol = '';
            $lE_bgCol = $bgCol;
            // User/Group names:
            $userN = $be_user_Array[$data['row']['perms_userid']] ? $be_user_Array[$data['row']['perms_userid']]['username'] : ($data['row']['perms_userid'] ? '<i>[' . $data['row']['perms_userid'] . ']!</i>' : '');
            $groupN = $be_group_Array[$data['row']['perms_groupid']] ? $be_group_Array[$data['row']['perms_groupid']]['title'] : ($data['row']['perms_groupid'] ? '<i>[' . $data['row']['perms_groupid'] . ']!</i>' : '');
            $groupN = t3lib_div::fixed_lgd_cs($groupN, 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:
            $cells[] = '
					<td align="left" nowrap="nowrap"' . $bgCol . $this->generateTitleAttribute($data['row']['uid'], $be_user_Array, $be_group_Array) . '>' . $data['HTML'] . htmlspecialchars(t3lib_div::fixed_lgd_cs($data['row']['title'], $tLen)) . '&nbsp;</td>';
            // "Edit permissions" -icon
            if ($editPermsAllowed && $data['row']['uid']) {
                $aHref = 'index.php?mode=' . $this->MOD_SETTINGS['mode'] . '&depth=' . $this->MOD_SETTINGS['depth'] . '&id=' . $data['row']['uid'] . '&return_id=' . $this->id . '&edit=1';
                $cells[] = '
					<td' . $bgCol . '><a href="' . htmlspecialchars($aHref) . '"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/edit2.gif', 'width="11" height="12"') . ' border="0" title="' . $LANG->getLL('ch_permissions', 1) . '" align="top" alt="" /></a></td>';
            } else {
                $cells[] = '
					<td' . $bgCol . '></td>';
            }
            // Rest of columns (depending on mode)
            if ($this->MOD_SETTINGS['mode'] == 'perms') {
                if (!$disableOldPermissionSystem) {
                    $cells[] = '
						<td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
						<td' . $bgCol . ' nowrap="nowrap">' . ($data['row']['uid'] ? $this->printPerms($data['row']['perms_user']) . ' ' . $userN : '') . '</td>

						<td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
						<td' . $bgCol . ' nowrap="nowrap">' . ($data['row']['uid'] ? $this->printPerms($data['row']['perms_group']) . ' ' . $groupN : '') . '</td>

						<td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
						<td' . $bgCol . ' nowrap="nowrap">' . ($data['row']['uid'] ? ' ' . $this->printPerms($data['row']['perms_everybody']) : '') . '</td>';
                }
                /*$cells[] ='
                			<td'.$bgCol.'><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/line.gif','width="5" height="16"').' alt="" /></td>
                			<td'.$bgCol.' nowrap="nowrap">'.($data['row']['editlock']?'<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/recordlock_warning2.gif','width="22" height="16"').' title="'.$LANG->getLL('EditLock_descr',1).'" alt="" />':'').'</td>
                		';*/
                // TODO: Editlock
                // ACL rows
                if (!empty($aclUsers)) {
                    $cells[] = '<td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td><td' . $bgCol . '>' . $this->countAcls($this->aclList[$data['row']['uid']][0]) . '</td>';
                    foreach ($aclUsers as $uid) {
                        $tmpBg = $bgCol;
                        if (isset($this->aclList[$data['row']['uid']][0][$uid]['newAcl'])) {
                            if ($this->aclList[$data['row']['uid']][0][$uid]['recursive']) {
                                $tmpBg = ' class="bgColor5"';
                            } else {
                                $tmpBg = ' class="bgColor6"';
                            }
                        }
                        $cells[] = '<td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
						<td' . $tmpBg . ' nowrap="nowrap">' . ($data['row']['uid'] ? ' ' . $this->printPerms($this->aclList[$data['row']['uid']][0][$uid]['permissions']) : '') . '</td>';
                    }
                }
                if (!empty($aclGroups)) {
                    $cells[] = '<td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td><td' . $bgCol . '>' . $this->countAcls($this->aclList[$data['row']['uid']][1]) . '</td>';
                    foreach ($aclGroups as $uid) {
                        $tmpBg = $bgCol;
                        if (isset($this->aclList[$data['row']['uid']][1][$uid]['newAcl'])) {
                            if ($this->aclList[$data['row']['uid']][1][$uid]['recursive']) {
                                $tmpBg = ' class="bgColor5"';
                            } else {
                                $tmpBg = ' class="bgColor6"';
                            }
                        }
                        $cells[] = '<td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
						<td' . $tmpBg . ' nowrap="nowrap">' . ($data['row']['uid'] ? ' ' . $this->printPerms($this->aclList[$data['row']['uid']][1][$uid]['permissions']) : '') . '</td>';
                    }
                }
            } else {
                $cells[] = '
					<td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>';
                if ($BE_USER->user['uid'] == $data['row']['perms_userid']) {
                    $bgCol = ' class="bgColor-20"';
                } else {
                    $bgCol = $lE_bgCol;
                }
                $cells[] = '
					<td' . $bgCol . ' nowrap="nowrap" align="center">' . ($data['row']['uid'] ? $owner . $this->printPerms($BE_USER->calcPerms($data['row'])) : '') . '</td>
					' . (!$BE_USER->isAdmin() ? '
					<td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td' . $bgCol . ' nowrap="nowrap">' . ($data['row']['editlock'] ? '<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/recordlock_warning2.gif', 'width="22" height="16"') . ' title="' . $LANG->getLL('EditLock_descr', 1) . '" alt="" />' : '') . '</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 = '<b>' . $LANG->getLL('1', 1) . '</b>: ' . $LANG->getLL('1_t', 1);
        $legendText .= '<br /><b>' . $LANG->getLL('16', 1) . '</b>: ' . $LANG->getLL('16_t', 1);
        $legendText .= '<br /><b>' . $LANG->getLL('2', 1) . '</b>: ' . $LANG->getLL('2_t', 1);
        $legendText .= '<br /><b>' . $LANG->getLL('4', 1) . '</b>: ' . $LANG->getLL('4_t', 1);
        $legendText .= '<br /><b>' . $LANG->getLL('8', 1) . '</b>: ' . $LANG->getLL('8_t', 1);
        if (t3lib_div::int_from_ver(TYPO3_version) >= 4004000) {
            $icon = '<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/legend.gif', 'width="86" height="75"') . ' alt="" />';
        } else {
            $icon = '<img src="legend.gif" width="86" height="75" alt="" />';
        }
        $code = '<table border="0" id="typo3-legendTable">
			<tr>
				<td valign="top">' . $icon . '</td>
				<td valign="top" nowrap="nowrap">' . $legendText . '</td>
			</tr>
		</table>';
        $code .= '<br />' . $LANG->getLL('def', 1);
        if (t3lib_div::int_from_ver(TYPO3_version) >= 4004000) {
            // use sprites for Typo3 V4.4 or later
            $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);
        } else {
            $code .= '<br /><br /><span class="perm-allowed">*</span>: ' . $LANG->getLL('A_Granted', 1);
            $code .= '<br />      <span class="perm-denied" >x</span>: ' . $LANG->getLL('A_Denied', 1);
        }
        // Adding section with legend code:
        $this->content .= $this->doc->spacer(20);
        $this->content .= $this->doc->section($LANG->getLL('Legend') . ':', $code, 0, 1);
    }
 /**
  * @param mixed $mainParams The "&id=" parameter value to be sent to the module, but it can be also a parameter array which will be passed instead of the &id=...
  * @param string $elementName The form elements name, probably something like "SET[...]
  * @param string $currentValue The value to be selected currently.
  * @param array	 $menuItems An array with the menu items for the selector box
  * @param string $script The script to send the &id to, if empty it's automatically found
  * @param string $addParams Additional parameters to pass to the script.
  * @return string HTML code for selector box
  */
 public function getFuncMenu($mainParams, $elementName, $currentValue, $menuItems, $script = '', $addParams = '')
 {
     /** @noinspection PhpDeprecationInspection PhpUndefinedClassInspection */
     return t3lib_BEfunc::getFuncMenu($mainParams, $elementName, $currentValue, $menuItems, $script, $addParams);
 }
Example #23
0
    /**
     * Creates the module's content. In this case it rather acts as a kind of #
     * dispatcher redirecting requests to specific tasks.
     *
     * @return	void
     */
    public function main()
    {
        $docHeaderButtons = $this->getButtons();
        $markers = array();
        $this->doc->JScodeArray[] = '
			script_ended = 0;
			function jumpToUrl(URL) {
				document.location = URL;
			}

			Event.observe(document, "dom:loaded", function(){
				var changeEffect;
				Sortable.create("task-list", { handles:$$("#task-list .drag"), tag: "li", ghosting:false, overlap:"vertical", constraint:false,
				 onChange: function(item) {
					 var list = Sortable.options(item).element;
					 // deactivate link
					$$("#task-list a").each(function(link) {
						link.writeAttribute("onclick","return false;");
					});

				 },

				 onUpdate: function(list) {
					 new Ajax.Request("ajax.php", {
						 method: "post",
						 parameters: { ajaxID :"Taskcenter::saveSortingState", data:  Sortable.serialize(list)}
					 });
						// activate link
					 Event.observe(window,"mouseup",function(){
						$$("#task-list a").each(function(link) {
							link.writeAttribute("onclick","");
						});
					});

				 }
				});

				$$("#taskcenter-menu .down").invoke("observe", "click", function(event){
					var item = Event.element(event);
					var itemParent = item.up();
					item = item.next("div").next("div").next("div").next("div");

					if (itemParent.hasClassName("expanded")) {
						itemParent.removeClassName("expanded").addClassName("collapsed");
						Effect.BlindUp(item, {duration : 0.5});
						state = 1;
					} else {
						itemParent.removeClassName("collapsed").addClassName("expanded");
						Effect.BlindDown(item, {duration : 0.5});
						state = 0;
					}
					new Ajax.Request("ajax.php", {
						parameters : "ajaxID=Taskcenter::saveCollapseState&item=" + itemParent.id + "&state=" + state
					});
				});
			});
		';
        $this->doc->postCode = '
			<script language="javascript" type="text/javascript">
				script_ended = 1;
				if (top.fsMod) {
					top.fsMod.recentIds["web"] = 0;
				}
			</script>
		';
        // Render content depending on the mode
        $mode = (string) $this->MOD_SETTINGS['mode'];
        if ($mode == 'information') {
            $this->renderInformationContent();
        } else {
            $this->renderModuleContent();
        }
        // compile document
        $markers['FUNC_MENU'] = t3lib_BEfunc::getFuncMenu(0, 'SET[mode]', $this->MOD_SETTINGS['mode'], $this->MOD_MENU['mode']);
        $markers['CONTENT'] = $this->content;
        // Build the <body> for the module
        $this->content = $this->doc->startPage($GLOBALS['LANG']->getLL('title'));
        $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
        $this->content .= $this->doc->endPage();
        $this->content = $this->doc->insertStylesAndJS($this->content);
    }
	/**
	 * Creates depth selector HTML for the page tree.
	 *
	 * @return string
	 */
	protected function getDepthSelector() {
		return $GLOBALS['LANG']->getLL('depth') .
			t3lib_BEfunc::getFuncMenu($this->pObj->id,'SET[depth]',$this->pObj->MOD_SETTINGS['depth'],$this->pObj->MOD_MENU['depth'],'index.php');
	}
    /**
     * Generates the module content
     *
     * @return	string		HTML content
     */
    function moduleContent()
    {
        global $BE_USER, $LANG, $BACK_PATH, $TYPO3_CONF_VARS;
        $content = '';
        $func = $this->pObj->MOD_SETTINGS['tx_dam_tools_indexupdate.func'];
        if (t3lib_div::_GP('start')) {
            $func .= '.start';
        }
        if (t3lib_div::_GP('process')) {
            $func .= '.process';
        }
        // reload at this time
        $max_execution_time = ini_get('max_execution_time');
        $max_execution_time = intval($max_execution_time / 3 * 2);
        $this->indexEndtime = time() + $max_execution_time;
        switch ($func) {
            case 'lost_records':
                $content .= $this->pObj->doc->section($LANG->getLL('tx_dam_tools_indexupdate.lost_records_check'), $LANG->getLL('tx_dam_tools_indexupdate.lost_records_description', 1), 0, 1);
                $content .= $this->pObj->doc->spacer(10);
                if (t3lib_div::_GP('collect_lost_records')) {
                    $values = array('pid' => $this->pObj->defaultPid);
                    $mediaTables = tx_dam::register_getEntries('mediaTable');
                    foreach ($mediaTables as $table) {
                        $res = $GLOBALS['TYPO3_DB']->exec_UPDATEquery($table, $table . '.pid NOT IN (' . tx_dam_db::getPidList() . ')', $values);
                    }
                }
                list($lostRecordsFound, $statisticsLostRecords) = $this->statisticsLostRecords();
                if ($lostRecordsFound) {
                    $content .= $statisticsLostRecords;
                    $content .= $this->pObj->doc->spacer(10);
                    $content .= '<p><input type="submit" name="collect_lost_records" value="' . $LANG->getLL('tx_dam_tools_indexupdate.lost_records_collect') . '" /></p>';
                } else {
                    $content .= '<p><strong>' . $LANG->getLL('tx_dam_tools_indexupdate.lost_records_all_fine') . '</strong></p>';
                    $content .= $statisticsLostRecords;
                    $content .= $this->pObj->doc->spacer(10);
                    $content .= '<p><input type="submit" name="" value="' . $LANG->getLL('tx_dam_tools_indexupdate.lost_records_check_again') . '" /></p>';
                }
                break;
            case 'cleanup_meta':
                $content .= $this->pObj->doc->section($LANG->getLL('tx_dam_tools_indexupdate.cleanup_meta'), $LANG->getLL('tx_dam_tools_indexupdate.cleanup_meta_description', 1), 0, 1);
                $content .= $this->pObj->doc->spacer(10);
                if (t3lib_div::_GP('cleanup_meta')) {
                    $countTotal = 0;
                    $res = $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_dam', 'color_space=' . $GLOBALS['TYPO3_DB']->fullQuoteStr('sRGB', 'tx_dam'), array('color_space' => 'RGB'));
                    $countTotal += $GLOBALS['TYPO3_DB']->sql_affected_rows();
                    $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,title,file_name', 'tx_dam', 'title=\'\'');
                    foreach ($rows as $row) {
                        $title = tx_dam_indexing::makeTitleFromFilename($row['file_name']);
                        $values = array('title' => $title);
                        $res = $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_dam', 'uid=' . $row['uid'], $values);
                        $countTotal++;
                    }
                    $content .= '<h4>Processing: ' . $countTotal . ' changes made</h4>';
                }
                $content .= '<h4>Available functions:</h4>';
                $content .= '<ul>';
                $content .= '<li>Create title for empty titles</li>';
                $content .= '<li>Change unused color space \'sRGB\' to \'RGB\'</li>';
                $content .= '</ul>';
                $content .= $this->pObj->doc->spacer(10);
                $content .= '<p><input type="submit" name="cleanup_meta" value="' . $LANG->getLL('tx_dam_tools_indexupdate.cleanup_meta') . '" /></p>';
                break;
            case 'statistics':
                $content .= $this->pObj->doc->section($LANG->getLL('tx_dam_tools_indexupdate.statistics'), $LANG->getLL('tx_dam_tools_indexupdate.statistics_description', 1), 0, 1);
                $content .= $this->pObj->doc->spacer(10);
                $content .= $this->statisticsMediaType();
                $content .= $this->pObj->doc->spacer(10);
                $content .= '<p><input type="submit" name="update" value="' . $LANG->getLL('tx_dam_tools_indexupdate.update') . '" /></p>';
                break;
            case 'index':
                $content .= $this->pObj->doc->section($LANG->getLL('tx_dam_tools_indexupdate.index_check'), $LANG->getLL('tx_dam_tools_indexupdate.index_description', 1), 0, 1);
                $content .= $this->pObj->doc->spacer(10);
                $code = '';
                $ageMenu = t3lib_BEfunc::getFuncMenu('', 'SET[tx_dam_tools_indexupdate.age]', $this->pObj->MOD_SETTINGS['tx_dam_tools_indexupdate.age'], $this->pObj->MOD_MENU['tx_dam_tools_indexupdate.age']);
                $ageMenu = preg_replace('#onchange="[^"]*"#', '', $ageMenu);
                $code .= '<p>' . $LANG->getLL('tx_dam_tools_indexupdate.age') . ': ' . $ageMenu . '<br /><span class="typo3-dimmed">' . $LANG->getLL('tx_dam_tools_indexupdate.age_descr') . '</span></p>';
                $code .= '<p><br /></p>';
                $code .= '<p>';
                $code .= '<input type="hidden" name="SET[tx_dam_tools_indexupdate.deleteMissing]" value="0">';
                $code .= '<input type="checkbox" ' . ($this->pObj->MOD_SETTINGS['tx_dam_tools_indexupdate.deleteMissing'] ? 'checked="checked"' : '') . ' name="SET[tx_dam_tools_indexupdate.deleteMissing]" id="SET.tx_dam_tools_indexupdate.deleteMissing" value="1"> ' . '<label for="SET.tx_dam_tools_indexupdate.deleteMissing">' . $LANG->getLL('tx_dam_tools_indexupdate.deleteMissing', 1) . '</label>';
                $code .= '<br /><span class="typo3-dimmed">' . $LANG->getLL('tx_dam_tools_indexupdate.deleteMissing_descr') . '</span></p>';
                $code .= '</p>';
                $code .= '<p><br /></p>';
                $code .= '<p><input type="submit" name="start" /></p>';
                $content .= $code;
                $code = '';
                $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('COUNT(uid) as count', 'tx_dam', $where_clause = '');
                reset($rows);
                $row = current($rows);
                $countTotal = $row['count'];
                $code = sprintf($LANG->getLL('tx_dam_tools_indexupdate.count_elements', 1), $countTotal);
                $content .= $this->pObj->doc->spacer(10);
                $content .= $this->pObj->doc->section($LANG->getLL('tx_dam_tools_indexupdate.statistics'), $code, 0, 1);
                break;
            case 'index.start':
                $code = '';
                $this->pObj->addParams['process'] = 1;
                $content .= $this->pObj->doc->section($LANG->getLL('tx_dam_tools_indexupdate.updatedFiles'), '', 0, 1);
                $content .= $this->pObj->doc->spacer(10);
                $code .= $this->indexing_getProgessTable();
                $content .= $this->pObj->doc->section('', $code, 0, 1);
                break;
            case 'index.process':
                $this->pObj->addParams['process'] = 1;
                echo '<head>
					<title>indexing</title>
					<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
					</head>
					<body>';
                $this->checkIndex(t3lib_div::_GP('indexSessionID'));
                echo '</body>
					</html>';
                exit;
                break;
            case 'uploads':
                $content .= $this->pObj->doc->spacer(10);
                $content .= $LANG->getLL('tx_dam_tools_indexupdate.description', 1);
                $code = '';
                $code .= $LANG->getLL('tx_dam_tools_indexupdate.uploads_description', 1);
                $code .= $this->pObj->doc->spacer(10);
                $code .= '<p><input type="submit" name="start" /></p>';
                $content .= $this->pObj->doc->section($LANG->getLL('tx_dam_tools_indexupdate.uploads_check'), $code, 0, 1);
                $code = '';
                $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('COUNT(uid) as count', 'tx_dam_file_tracking', $where_clause = '');
                reset($rows);
                $row = current($rows);
                $countTotal = $row['count'];
                $code .= sprintf($LANG->getLL('tx_dam_tools_indexupdate.count_elements', 1), $countTotal);
                $content .= $this->pObj->doc->spacer(10);
                $content .= $this->pObj->doc->section($LANG->getLL('tx_dam_tools_indexupdate.statistics'), $code, 0, 1);
                break;
            case 'uploads.start':
                $code = '';
                $this->pObj->addParams['process'] = 1;
                $content .= $this->pObj->doc->section($LANG->getLL('tx_dam_tools_indexupdate.updatedFiles'), '', 0, 1);
                $content .= $this->pObj->doc->spacer(10);
                $code .= $this->indexing_getProgessTable();
                $content .= $this->pObj->doc->section('', $code, 0, 1);
                break;
            case 'uploads.process':
                $this->pObj->addParams['process'] = 1;
                echo '<head>
					<title>indexing</title>
					<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
					</head>
					<body>';
                $this->checkUploads(t3lib_div::_GP('indexSessionID'));
                echo '</body>
					</html>';
                exit;
                break;
        }
        return $content;
    }
Example #26
0
    /**
     * Initialize module header etc and call extObjContent function
     *
     * @return	void
     */
    function main()
    {
        global $BE_USER, $LANG, $BACK_PATH;
        // Access check...
        // The page will show only if there is a valid page and if this page may be viewed by the user
        $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause);
        $access = is_array($this->pageinfo) ? 1 : 0;
        // Template markers
        $markers = array('CSH' => '', 'FUNC_MENU' => '', 'CONTENT' => '');
        $this->doc = t3lib_div::makeInstance('template');
        $this->doc->backPath = $BACK_PATH;
        $this->doc->setModuleTemplate('templates/func.html');
        // **************************
        // Main
        // **************************
        if ($this->id && $access) {
            // JavaScript
            $this->doc->JScode = $this->doc->wrapScriptTags('
				script_ended = 0;
				function jumpToUrl(URL)	{	//
					window.location.href = URL;
				}
			');
            $this->doc->postCode = $this->doc->wrapScriptTags('
				script_ended = 1;
				if (top.fsMod) top.fsMod.recentIds["web"] = ' . intval($this->id) . ';
			');
            // Setting up the context sensitive menu:
            $this->doc->getContextMenuCode();
            $this->doc->form = '<form action="index.php" method="post"><input type="hidden" name="id" value="' . $this->id . '" />';
            $vContent = $this->doc->getVersionSelector($this->id, 1);
            if ($vContent) {
                $this->content .= $this->doc->section('', $vContent);
            }
            $this->extObjContent();
            // Setting up the buttons and markers for docheader
            $docHeaderButtons = $this->getButtons();
            $markers['CSH'] = $docHeaderButtons['csh'];
            $markers['FUNC_MENU'] = t3lib_BEfunc::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']);
            $markers['CONTENT'] = $this->content;
        } else {
            // If no access or if ID == zero
            $flashMessage = t3lib_div::makeInstance('t3lib_FlashMessage', $LANG->getLL('clickAPage_content'), $LANG->getLL('title'), t3lib_FlashMessage::INFO);
            $this->content = $flashMessage->render();
            // Setting up the buttons and markers for docheader
            $docHeaderButtons = $this->getButtons();
            $markers['CSH'] = $docHeaderButtons['csh'];
            $markers['CONTENT'] = $this->content;
        }
        // Build the <body> for the module
        $this->content = $this->doc->startPage($LANG->getLL('title'));
        $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
        $this->content .= $this->doc->endPage();
        $this->content = $this->doc->insertStylesAndJS($this->content);
    }
 /**
  * Creation of the main content. Calling extObjContent() to trigger content generation from the sub-sub modules
  *
  * @return	string		The content
  * @see t3lib_extobjbase::extObjContent()
  */
 function main()
 {
     global $SOBE, $LANG;
     $menu = $LANG->getLL('wiz_lWizards', 1) . ': ' . t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[wiz]', $this->pObj->MOD_SETTINGS['wiz'], $this->pObj->MOD_MENU['wiz']);
     $theOutput .= $this->pObj->doc->section('', '<span class="nobr">' . $menu . '</span>');
     $content = '';
     $content .= $theOutput;
     $content .= $this->pObj->doc->spacer(5);
     $content .= $this->extObjContent();
     return $content;
 }
    /**
     * Main function
     *
     * @return	string		Output HTML for the module.
     * @access	public
     */
    function main()
    {
        global $BACK_PATH, $LANG, $SOBE, $BE_USER, $TYPO3_DB;
        $this->modSharedTSconfig = t3lib_BEfunc::getModTSconfig($this->pObj->id, 'mod.SHARED');
        $this->allAvailableLanguages = $this->getAvailableLanguages(0, true, true, true);
        $output = '';
        $this->templavoilaAPIObj = t3lib_div::makeInstance('tx_templavoila_api');
        // Showing the tree:
        // Initialize starting point of page tree:
        $treeStartingPoint = intval($this->pObj->id);
        $treeStartingRecord = t3lib_BEfunc::getRecord('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));
        // Creating top icon; the current page
        $HTML = t3lib_iconWorks::getSpriteIconForRecord('pages', $treeStartingRecord);
        $tree->tree[] = array('row' => $treeStartingRecord, 'HTML' => $HTML);
        // Create the tree from starting point:
        if ($depth > 0) {
            $tree->getTree($treeStartingPoint, $depth, '');
        }
        // Set CSS styles specific for this document:
        $this->pObj->content = str_replace('/*###POSTCSSMARKER###*/', '
			TABLE.c-list TR TD { white-space: nowrap; vertical-align: top; }
		', $this->pObj->content);
        // Process commands:
        if (t3lib_div::_GP('createReferencesForPage')) {
            $this->createReferencesForPage(t3lib_div::_GP('createReferencesForPage'));
        }
        if (t3lib_div::_GP('createReferencesForTree')) {
            $this->createReferencesForTree($tree);
        }
        // Traverse tree:
        $output = '';
        $counter = 0;
        foreach ($tree->tree as $row) {
            $unreferencedElementRecordsArr = $this->getUnreferencedElementsRecords($row['row']['uid']);
            if (count($unreferencedElementRecordsArr)) {
                $createReferencesLink = '<a href="index.php?id=' . $this->pObj->id . '&createReferencesForPage=' . $row['row']['uid'] . '">Reference elements</a>';
            } else {
                $createReferencesLink = '';
            }
            $rowTitle = $row['HTML'] . t3lib_BEfunc::getRecordTitle('pages', $row['row'], TRUE);
            $cellAttrib = $row['row']['_CSSCLASS'] ? ' class="' . $row['row']['_CSSCLASS'] . '"' : '';
            $tCells = array();
            $tCells[] = '<td nowrap="nowrap"' . $cellAttrib . '>' . $rowTitle . '</td>';
            $tCells[] = '<td>' . count($unreferencedElementRecordsArr) . '</td>';
            $tCells[] = '<td nowrap="nowrap">' . $createReferencesLink . '</td>';
            $output .= '
				<tr class="bgColor' . ($counter % 2 ? '-20' : '-10') . '">
					' . implode('
					', $tCells) . '
				</tr>';
            $counter++;
        }
        // Create header:
        $tCells = array();
        $tCells[] = '<td>Page:</td>';
        $tCells[] = '<td>No. of unreferenced elements:</td>';
        $tCells[] = '<td>&nbsp;</td>';
        // Depth selector:
        $depthSelectorBox = t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[depth]', $this->pObj->MOD_SETTINGS['depth'], $this->pObj->MOD_MENU['depth'], 'index.php');
        $finalOutput = '
			<br />
			' . $depthSelectorBox . '
			<a href="index.php?id=' . $this->pObj->id . '&createReferencesForTree=1">Reference elements for whole tree</a><br />
			<br />
			<table border="0" cellspacing="1" cellpadding="0" class="lrPadding c-list">
				<tr class="bgColor5 tableheader">
					' . implode('
					', $tCells) . '
				</tr>' . $output . '
			</table>
		';
        return $finalOutput;
    }
Example #29
0
 /**
  * Main function to generate the content
  *
  * @return	void
  */
 function main()
 {
     $this->content = $this->doc->header('Indexing Engine Statistics');
     $this->content .= $this->doc->spacer(5);
     switch ($this->MOD_SETTINGS['function']) {
         case 'stat':
             $this->content .= $this->doc->section('Records', $this->doc->table($this->getRecordsNumbers()), 0, 1);
             $this->content .= $this->doc->spacer(15);
             $this->content .= $this->doc->section('index_phash TYPES', $this->doc->table($this->getPhashTypes()), 1);
             $this->content .= $this->doc->spacer(15);
             break;
         case 'externalDocs':
             $this->content .= $this->doc->section('External documents', $this->doc->table($this->getPhashExternalDocs()), 0, 1);
             $this->content .= $this->doc->spacer(15);
             break;
         case 'typo3pages':
             $this->content .= $this->doc->section('TYPO3 Pages', $this->doc->table($this->getPhashT3pages()), 0, 1);
             $this->content .= $this->doc->spacer(15);
             break;
     }
     $docHeaderButtons = $this->getButtons();
     $markers = array('CSH' => $docHeaderButtons['csh'], 'FUNC_MENU' => t3lib_BEfunc::getFuncMenu(0, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']), 'CONTENT' => $this->content);
     $this->content = $this->doc->startPage('Indexing Engine Statistics');
     $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
     $this->content .= $this->doc->endPage();
     $this->content = $this->doc->insertStylesAndJS($this->content);
 }
Example #30
0
 function workspaceMenu()
 {
     if ($this->id) {
         $menu = '';
         if ($GLOBALS['BE_USER']->workspace === 0) {
             $menu .= t3lib_BEfunc::getFuncMenu($this->id, 'SET[filter]', $this->MOD_SETTINGS['filter'], $this->MOD_MENU['filter']);
             $menu .= t3lib_BEfunc::getFuncMenu($this->id, 'SET[display]', $this->MOD_SETTINGS['display'], $this->MOD_MENU['display']);
         }
         if (!$this->details && $GLOBALS['BE_USER']->workspace && !$this->diffOnly) {
             $menu .= t3lib_BEfunc::getFuncCheck($this->id, 'SET[diff]', $this->MOD_SETTINGS['diff'], '', '', 'id="checkDiff"') . ' <label for="checkDiff">' . $GLOBALS['LANG']->getLL('showDiffView') . '</label>';
         }
         if ($menu) {
             return $menu;
         }
     }
 }