/** * Return clipboard button * * HOOK: $GLOBALS['TL_HOOKS']['clipboardButtons'] * * @param object $dc * @param array $row * @param string $table * @param boolean $cr * @param array $arrClipboard * @param childs $childs * @return string */ public function clipboardButtons(DataContainer $dc, $row, $table, $cr, $arrClipboard = false, $childs) { if (!$this->Input->get('act')) { $objFavorit = Clipboard::getInstance()->cb()->getFavorite(); if ($dc->table == 'tl_article' && $table == 'tl_page') { // Create button title and lable $label = $title = vsprintf($GLOBALS['TL_LANG'][$dc->table]['pasteinto'][1], array($row['id'])); // Create Paste Button $return = $this->getPasteButton($row, $GLOBALS['CLIPBOARD']['pasteinto']['href'], $label, $title, $GLOBALS['CLIPBOARD']['pasteinto']['icon'], $GLOBALS['CLIPBOARD']['pasteinto']['attributes'], $dc->table); return $return; } } }
/** * Config */ $GLOBALS['TL_DCA']['tl_page']['config']['onload_callback'][] = array('Clipboard', 'init'); $GLOBALS['TL_DCA']['tl_page']['config']['dataContainer'] = 'Clipboard'; /** * List operations */ // Copy button $GLOBALS['TL_DCA']['tl_page']['list']['operations']['cl_copy'] = array('label' => &$GLOBALS['TL_LANG']['tl_page']['copy']); $GLOBALS['TL_DCA']['tl_page']['list']['operations']['cl_copy'] = array_merge($GLOBALS['CLIPBOARD']['copy'], $GLOBALS['TL_DCA']['tl_page']['list']['operations']['cl_copy']); // ----------------------------------------------------------------------------- // Copy with childs button $GLOBALS['TL_DCA']['tl_page']['list']['operations']['cl_copyChilds'] = array('label' => &$GLOBALS['TL_LANG']['tl_page']['copyChilds'], 'button_callback' => array('tl_page_cl', 'cl_copyPageWithSubpages')); $GLOBALS['TL_DCA']['tl_page']['list']['operations']['cl_copyChilds'] = array_merge($GLOBALS['CLIPBOARD']['copy_childs'], $GLOBALS['TL_DCA']['tl_page']['list']['operations']['cl_copyChilds']); if (Clipboard::getInstance()->cb()->hasFavorite()) { // ----------------------------------------------------------------------------- // Paste after button $GLOBALS['TL_DCA']['tl_page']['list']['operations']['cl_paste_after'] = array('label' => $GLOBALS['TL_LANG']['tl_page']['pasteafter'], 'attributes' => 'class="cl_paste"'); $GLOBALS['TL_DCA']['tl_page']['list']['operations']['cl_paste_after'] = array_merge($GLOBALS['CLIPBOARD']['pasteafter'], $GLOBALS['TL_DCA']['tl_page']['list']['operations']['cl_paste_after']); // ----------------------------------------------------------------------------- // Paste into button $GLOBALS['TL_DCA']['tl_page']['list']['operations']['cl_paste_into'] = array('label' => $GLOBALS['TL_LANG']['tl_page']['pasteinto'], 'attributes' => 'class="cl_paste"'); $GLOBALS['TL_DCA']['tl_page']['list']['operations']['cl_paste_into'] = array_merge($GLOBALS['CLIPBOARD']['pasteinto'], $GLOBALS['TL_DCA']['tl_page']['list']['operations']['cl_paste_into']); } } /** * Class tl_page_cl * * Provide miscellaneous methods that are used by the data configuration array. *