Index: mod1/index.php
===================================================================
--- mod1/index.php (revision 41571)
+++ mod1/index.php (working copy)
@@ -57,6 +57,9 @@
class tx_damcatedit_module1 extends tx_dam_SCbase {
+ public $moduleContent;
+
+
/**
* Main function of the module. Write the content to $this->content
*/
@@ -76,7 +79,8 @@
if (($this->id && $access) || ($BE_USER->user['admin'] && !$this->id)) {
// Draw the header.
- $this->doc = t3lib_div::makeInstance('noDoc');
+ $this->doc = t3lib_div::makeInstance('template');
+ $this->doc->setModuleTemplate(t3lib_extMgm::extPath('dam_catedit') . 'mod1/mod_template.html');
$this->doc->backPath = $BACK_PATH;
$this->doc->form='
';
+ $this->moduleContent.= $dblist->fieldSelectBox();
+ }
+
+ return $this->moduleContent;
+
+ }
+ /**
+ * Gets the filled markers that are used in the HTML template.
+ *
+ * @return array The filled marker array
+ */
+ protected function getTemplateMarkers() {
+ $markers = array(
+ 'CONTENT' => $this->content,
+ 'TITLE' => $GLOBALS['LANG']->getLL('title'),
+ );
- $content.= '';
- $content.= $dblist->fieldSelectBox();
+ return $markers;
+ }
+
+ /**
+ * Gets the buttons that shall be rendered in the docHeader.
+ *
+ * @return array Available buttons for the docHeader
+ */
+ protected function getDocHeaderButtons() {
+ $buttons = array(
+ 'addcat'=> $this->getAddCategoryButton(),
+ 'shortcut' => $this->getShortcutButton(),
+ );
+
+ return $buttons;
+ }
+
+ /**
+ * Gets the button to add a new category.
+ *
+ * @return string HTML representiation of the add category button
+ */
+ protected function getAddCategoryButton($table='tx_dam_cat') {
+ global $BE_USER,$LANG,$BACK_PATH,$TCA,$TYPO3_CONF_VARS;
+
+ $cmd = t3lib_div::_GPmerged('SLCMD');
+
+ if (is_array($cmd['SELECT']['txdamCat'])) {
+ $uid = intval(key($cmd['SELECT']['txdamCat']));
+ }
+
+ $sysfolder = t3lib_div::makeInstance('tx_dam_sysfolder');
+ $sysfolderUid = $sysfolder->getPidList();
+
+ //$result = '';
+ $result = '';
+
+ if (t3lib_div::int_from_ver(TYPO3_version) < 4004000) {
+ $result .= '';
+ } else {
+ $result .= t3lib_iconWorks::getSpriteIcon('actions-document-new', array('title' => 'Create new record'));
}
- $this->content.= $content;
+ $result .= '';
+ return $result;
+ }
+
+
+ /**
+ * Gets the button to set a new shortcut in the backend (if current user is allowed to).
+ *
+ * @return string HTML representiation of the shortcut button
+ */
+ protected function getShortcutButton() {
+ $result = '';
+ if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
+ $result = $this->doc->makeShortcutIcon('', 'function', $this->MCONF['name']);
+ }
+
+ return $result;
}
+
+
}
-
-
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dam_catedit/mod1/index.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dam_catedit/mod1/index.php']);
}
Index: mod1/mod_template.html
===================================================================
--- mod1/mod_template.html (revision 0)
+++ mod1/mod_template.html (revision 0)
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+ ###BUTTONS###
+
+
+
+###ADDCAT###
+
+
+
+###SHORTCUT###
+
Index: mod1/mod_template_tree.html
===================================================================
--- mod1/mod_template_tree.html (revision 0)
+++ mod1/mod_template_tree.html (revision 0)
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+ ###BUTTONS###
+
+
+
+
+
+
+
+###REFRESH###
+
Index: mod1/tx_dam_catedit_navframe.php
===================================================================
--- mod1/tx_dam_catedit_navframe.php (revision 41571)
+++ mod1/tx_dam_catedit_navframe.php (working copy)
@@ -79,6 +79,8 @@
var $doc;
var $content;
+
+ public $innerContent;
// Internal, static: _GP
var $currentSubScript;
@@ -89,8 +91,8 @@
$this->doc = t3lib_div::makeInstance('template');
$this->doc->backPath = $BACK_PATH;
+ $this->doc->setModuleTemplate(t3lib_extMgm::extRelPath('dam_catedit') . 'mod1/mod_template_tree.html');
-
$this->currentSubScript = t3lib_div::_GP('currentSubScript');
// Setting highlight mode:
@@ -115,14 +117,14 @@
parent.list_frame.location.href=theUrl;
}
- '.($this->doHighlight?'hilight_row("dam_cat",highLightID+"_"+bank);':'').'
+ '.($this->doHighlight?'highlight_row("dam_cat",highLightID+"_"+bank);':'').'
'.(!$GLOBALS['CLIENT']['FORMSTYLE'] ? '' : 'if (linkObj) {linkObj.blur();}').'
return false;
}
// Call this function, refresh_nav(), from another script in the backend if you want to refresh the navigation frame (eg. after having changed a page title or moved pages etc.)
- // See t3lib_BEfunc::getSetUpdateSignal()
+ // See t3lib_BEfunc::setUpdateSignal()
function refresh_nav() {
window.setTimeout("_refresh_nav();",0);
}
@@ -131,7 +133,7 @@
}
// Highlighting rows in the page tree:
- function hilight_row(frameSetModule,highLightID) { //
+ function highlight_row(frameSetModule,highLightID) { //
// Remove old:
theObj = document.getElementById(top.fsMod.navFrameHighlightedID[frameSetModule]);
@@ -181,9 +183,6 @@
}
';
-
-
-
}
@@ -197,10 +196,74 @@
function main() {
global $LANG,$BACK_PATH,$TYPO3_CONF_VARS;
- $this->content = '';
- $this->content.= $this->doc->startPage('Navigation');
+ $this->content .= $this->getInnerContent();
+
+ $page = $this->doc->startPage($LANG->getLL('title'));
+ $page .= $this->doc->moduleBody(
+ array(),
+ $this->getDocHeaderButtons(),
+ $this->getTemplateMarkers()
+ );
+ $page .= $this->doc->endPage();
+ //$this->content .= $this->doc->spacer(10);
+ $this->content = $page;
+
+ }
+ /**
+ * Gets the filled markers that are used in the HTML template.
+ *
+ * @return array The filled marker array
+ */
+ protected function getTemplateMarkers() {
+ $markers = array(
+ 'CONTENT' => $this->content,
+ );
+
+ return $markers;
+ }
+
+ /**
+ * Gets the buttons that shall be rendered in the docHeader.
+ *
+ * @return array Available buttons for the docHeader
+ */
+ protected function getDocHeaderButtons() {
+ $buttons = array(
+ 'refresh' => $this->getRefreshButton(),
+ );
+
+ return $buttons;
+ }
+
+ /**
+ * Gets the button to set a new shortcut in the backend (if current user is allowed to).
+ *
+ * @return string HTML representiation of the shortcut button
+ */
+ protected function getRefreshButton() {
+ global $LANG,$BACK_PATH,$TYPO3_CONF_VARS;
+
+ $result = '';
+
+ $result .= '
+ '.
+ '
+ ';
+
+ return $result;
+ }
+
+ /**
+ * Gets the content that will replace CONTENT marker.
+ *
+ * @return string HTML content
+ */
+ protected function getInnerContent() {
+
+ global $LANG,$BACK_PATH,$TYPO3_CONF_VARS;
+
// the trees
$this->browseTrees = t3lib_div::makeInstance('tx_dam_browseTrees');
// show only categories:
@@ -210,33 +273,27 @@
$this->browseTrees->treeObjArr['txdamCat']->modeSelIcons = false;
$this->browseTrees->treeObjArr['txdamCat']->linkRootCat = true;
- $this->content.= $this->browseTrees->getTrees();
+ $this->innerContent = '';
+ $this->innerContent .= $this->browseTrees->getTrees();
- $this->content.= '
-
- '.
- ''.
- $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.refresh',1).'
-
-
';
-
// Adding highlight - JavaScript
- if ($this->doHighlight) $this->content .=$this->doc->wrapScriptTags('
- hilight_row("",top.fsMod.navFrameHighlightedID["dam_cat"]);
- ');
+ if ($this->doHighlight) $this->innerContent .= $this->doc->wrapScriptTags('
+ highlight_row("",top.fsMod.navFrameHighlightedID["dam_cat"]);
+ ');
+
+ return $this->innerContent;
+
}
-
/**
* Outputting the accumulated content to screen
*
* @return void
*/
function printContent() {
- $this->content.= $this->doc->endPage();
echo $this->content;
}
-
+
}
// Include extension?