Exemplo n.º 1
0
 /**
  * builds and outputs custom toolbar button
  *
  * @param string $task
  * @param string $icon
  * @param string $iconOver
  * @param string $alt
  * @param bool $listSelect
  * @param string $prefix
  * @param string $class
  */
 static function custom($task = null, $icon = null, $iconOver = null, $alt = null, $listSelect = true, $prefix = null, $class = null)
 {
     if ($listSelect) {
         $onClick = "if ( document.adminForm.boxchecked.value == 0 ) {" . "alert( '" . addslashes(sprintf(CBTxt::T('Please make a selection from the list to %s'), CBTxt::T($alt))) . "' );" . "} else {" . $prefix . "submitbutton( '{$task}' );" . "}";
     } else {
         $onClick = $prefix . "submitbutton( '{$task}' )";
     }
     $icon = preg_replace('/\\.[^.]*$/', '', $icon);
     cbMenuBarBase::_output($onClick, $icon, $alt, '#', $class);
 }
 /**
  * Writes a custom option and task button for the button bar
  * @param string The task to perform (picked up by the switch($task) blocks
  * @param string The image to display
  * @param string The image to display when moused over
  * @param string The alt text for the icon image
  * @param boolean True if required to check that a standard list item is checked
  */
 static function custom($task = '', $icon = '', $iconOver = '', $alt = '', $listSelect = true, $prefix = '')
 {
     if ($listSelect) {
         $onClick = "if (document.adminForm.boxchecked.value == 0){\r\n\t\t\t\talert('" . addslashes(sprintf(CBTxt::T('Please make a selection from the list to %s'), CBTxt::T($alt))) . "');\r\n\t\t\t}else {\r\n\t\t\t\t" . $prefix . "submitbutton('{$task}');\r\n\t\t\t}";
     } else {
         $onClick = $prefix . "submitbutton('{$task}')";
     }
     //   if ( $icon ) {
     $icon = preg_replace('/\\.[^.]*$/', '', $icon);
     echo cbMenuBarBase::_output($onClick, $icon, $alt);
     //   }
 }