-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
372 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
<?php | ||
|
||
/** | ||
* Table tl_cds_song | ||
*/ | ||
$GLOBALS['TL_DCA']['tl_cds_song'] = array | ||
( | ||
|
||
// Config | ||
'config' => array | ||
( | ||
'dataContainer' => 'Table', | ||
'ptable' => 'tl_cds', | ||
'enableVersioning' => true, | ||
'sql' => array | ||
( | ||
'keys' => array | ||
( | ||
'id' => 'primary', | ||
'pid' => 'index' | ||
) | ||
) | ||
), | ||
|
||
// List | ||
'list' => array | ||
( | ||
'sorting' => array | ||
( | ||
'mode' => 4, | ||
'fields' => array('sorting'), | ||
'headerFields' => array('title', 'artist', 'year', 'genre'), | ||
'panelLayout' => 'search,limit', | ||
'child_record_callback' => array('tl_cds_song', 'generateSongRow') | ||
), | ||
'global_operations' => array | ||
( | ||
'all' => array | ||
( | ||
'label' => &$GLOBALS['TL_LANG']['MSC']['all'], | ||
'href' => 'act=select', | ||
'class' => 'header_edit_all', | ||
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"' | ||
) | ||
), | ||
'operations' => array | ||
( | ||
'edit' => array | ||
( | ||
'label' => &$GLOBALS['TL_LANG']['tl_cds_song']['edit'], | ||
'href' => 'act=edit', | ||
'icon' => 'edit.gif' | ||
), | ||
'copy' => array | ||
( | ||
'label' => &$GLOBALS['TL_LANG']['tl_cds_song']['copy'], | ||
'href' => 'act=paste&mode=copy', | ||
'icon' => 'copy.gif' | ||
), | ||
'cut' => array | ||
( | ||
'label' => &$GLOBALS['TL_LANG']['tl_cds_song']['cut'], | ||
'href' => 'act=paste&mode=cut', | ||
'icon' => 'cut.gif' | ||
), | ||
'delete' => array | ||
( | ||
'label' => &$GLOBALS['TL_LANG']['tl_cds_song']['delete'], | ||
'href' => 'act=delete', | ||
'icon' => 'delete.gif', | ||
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"' | ||
), | ||
'show' => array | ||
( | ||
'label' => &$GLOBALS['TL_LANG']['tl_cds_song']['show'], | ||
'href' => 'act=show', | ||
'icon' => 'show.gif' | ||
) | ||
) | ||
), | ||
|
||
// Palettes | ||
'palettes' => array | ||
( | ||
'default' => '{title_legend},title,duration' | ||
), | ||
|
||
// Fields | ||
'fields' => array | ||
( | ||
'id' => array | ||
( | ||
'sql' => "int(10) unsigned NOT NULL auto_increment" | ||
), | ||
'pid' => array | ||
( | ||
'sql' => "int(10) unsigned NOT NULL default '0'" | ||
), | ||
'sorting' => array | ||
( | ||
'sql' => "int(10) unsigned NOT NULL default '0'" | ||
), | ||
'tstamp' => array | ||
( | ||
'sql' => "int(10) unsigned NOT NULL default '0'" | ||
), | ||
'title' => array | ||
( | ||
'label' => &$GLOBALS['TL_LANG']['tl_cds_song']['title'], | ||
'exclude' => true, | ||
'search' => true, | ||
'inputType' => 'text', | ||
'eval' => array('mandatory'=>true, 'maxlength'=>128, 'tl_class'=>'w50'), | ||
'sql' => "varchar(128) NOT NULL default ''" | ||
), | ||
'duration' => array | ||
( | ||
'label' => &$GLOBALS['TL_LANG']['tl_cds_song']['duration'], | ||
'exclude' => true, | ||
'inputType' => 'text', | ||
'eval' => array('mandatory'=>true, 'maxlength'=>8, 'tl_class'=>'w50'), | ||
'sql' => "varchar(8) NOT NULL default ''" | ||
) | ||
) | ||
); | ||
|
||
|
||
/** | ||
* Provide miscellaneous methods that are used by the data configuration array | ||
*/ | ||
class tl_cds_song extends Backend | ||
{ | ||
|
||
/** | ||
* Generate a song row and return it as HTML string | ||
* @param array | ||
* @return string | ||
*/ | ||
public function generateSongRow($arrRow) | ||
{ | ||
return '<div>' . $arrRow['title'] . ' <span style="padding-left:3px;color:#b3b3b3;">[' . $arrRow['duration'] . ']</span></div>'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
<?php | ||
|
||
/** | ||
* Add a palette to tl_module | ||
* Add palettes to tl_module | ||
*/ | ||
$GLOBALS['TL_DCA']['tl_module']['palettes']['cd_list'] = '{title_legend},name,headline,type;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space'; | ||
$GLOBALS['TL_DCA']['tl_module']['palettes']['cd_list'] = '{title_legend},name,headline,type;{redirect_legend},jumpTo;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space'; | ||
$GLOBALS['TL_DCA']['tl_module']['palettes']['cd_reader'] = '{title_legend},name,headline,type;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
/** | ||
* Miscellaneous | ||
*/ | ||
$GLOBALS['TL_LANG']['MSC']['song_number'] = 'No.'; | ||
$GLOBALS['TL_LANG']['MSC']['song_title'] = 'Title'; | ||
$GLOBALS['TL_LANG']['MSC']['song_duration'] = 'Duration'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
/** | ||
* Fields | ||
*/ | ||
$GLOBALS['TL_LANG']['tl_cds_song']['title'] = array('Title', 'Please enter the song title.'); | ||
$GLOBALS['TL_LANG']['tl_cds_song']['duration'] = array('Song duration', 'Please enter the song duration.'); | ||
|
||
|
||
/** | ||
* Legends | ||
*/ | ||
$GLOBALS['TL_LANG']['tl_cds_song']['title_legend'] = 'Title and duration'; | ||
|
||
|
||
/** | ||
* Buttons | ||
*/ | ||
$GLOBALS['TL_LANG']['tl_cds_song']['new'] = array('New song', 'Add a new song'); | ||
$GLOBALS['TL_LANG']['tl_cds_song']['show'] = array('Song details', 'Show the details of song ID %s'); | ||
$GLOBALS['TL_LANG']['tl_cds_song']['edit'] = array('Edit song', 'Edit song ID %s'); | ||
$GLOBALS['TL_LANG']['tl_cds_song']['copy'] = array('Copy song', 'Copy song ID %s'); | ||
$GLOBALS['TL_LANG']['tl_cds_song']['cut'] = array('Move song', 'Move song ID %s'); | ||
$GLOBALS['TL_LANG']['tl_cds_song']['delete'] = array('Delete song', 'Delete song ID %s'); | ||
$GLOBALS['TL_LANG']['tl_cds_song']['pasteafter'] = array('Paste into this album', 'Paste after song ID %s'); | ||
$GLOBALS['TL_LANG']['tl_cds_song']['pastenew'] = array('Add new at the top', 'Add new after question ID %s'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.