<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
* and similar across all objects (thus providing both reuse and standards)
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
* Different possible actions are defined here. Keep in sync with the
* constant from CRM_Core_Form for various modes.
*
- * @var const
+ * @var integer const
*
* @access public
*/
*
* called by the request object to translate a string into a mask
*
- * @param string $action the action to be resolved
+ * @param $str
+ *
+ * @internal param string $action the action to be resolved
*
* @return int the action mask corresponding to the input string
* @access public
* @static
- *
*/
static function resolve($str) {
$action = 0;
* given a set of links and a mask, return the html action string for
* the links associated with the mask
*
- * @param array $links the set of link items
- * @param int $mask the mask to be used. a null mask means all items
+ * @param array $links the set of link items
+ * @param int $mask the mask to be used. a null mask means all items
* @param array $values the array of values for parameter substitution in the link items
- * @param string $extraULName enclosed extra links in this UL.
- * @param boolean $enclosedAllInSingleUL force to enclosed all links in single UL.
+ * @param string $extraULName enclosed extra links in this UL.
+ * @param boolean $enclosedAllInSingleUL force to enclosed all links in single UL.
+ *
+ * @param null $op
+ * @param null $objectName
+ * @param null $objectId
*
* @return string the html string
* @access public
$url = array();
- $firstLink = TRUE;
- foreach ($seqLinks as $link) {
+ foreach ($seqLinks as $i => $link) {
if (!$mask || !array_key_exists('bit', $link) || ($mask & $link['bit'])) {
$extra = isset($link['extra']) ? self::replace($link['extra'], $values) : NULL;
$urlPath = CRM_Utils_Array::value('url', $link, '#');
}
- $classes = 'action-item';
- if ($firstLink) {
- $firstLink = FALSE;
- $classes .= " action-item-first";
- }
+ $classes = 'action-item crm-hover-button';
if (isset($link['ref'])) {
$classes .= ' ' . strtolower($link['ref']);
}
//get the user specified classes in.
if (isset($link['class'])) {
- $className = $link['class'];
- if (is_array($className)) {
- $className = implode(' ', $className);
- }
+ $className = is_array($link['class']) ? implode(' ', $link['class']) : $link['class'];
$classes .= ' ' . strtolower($className);
}
- $linkClasses = 'class="' . $classes . '"';
-
if ($urlPath !== '#' && $frontend) {
$extra .= ' target="_blank"';
}
- $url[] = sprintf('<a href="%s" %s title="%s" ' . $extra . '>%s</a>',
+ // Hack to make delete dialogs smaller
+ if (strpos($urlPath, '/delete') || strpos($urlPath, 'action=delete')) {
+ $classes .= " small-popup";
+ }
+ $url[] = sprintf('<a href="%s" class="%s" %s' . $extra . '>%s</a>',
$urlPath,
- $linkClasses,
- CRM_Utils_Array::value('title', $link),
+ $classes,
+ !empty($link['title']) ? "title='{$link['title']}' " : '',
$link['name']
);
}
}
- $result = '';
$mainLinks = $url;
if ($enclosedAllInSingleUL) {
$allLinks = '';
CRM_Utils_String::append($allLinks, '</li><li>', $mainLinks);
$allLinks = "{$extraULName}<ul class='panel'><li>{$allLinks}</li></ul>";
- $result = "<span class='btn-slide'>{$allLinks}</span>";
+ $result = "<span class='btn-slide crm-hover-button'>{$allLinks}</span>";
}
else {
$extra = '';
$resultLinks = '';
CRM_Utils_String::append($resultLinks, '', $mainLinks);
if ($extra) {
- $result = "<span>{$resultLinks}</span><span class='btn-slide'>{$extra}</span>";
+ $result = "<span>{$resultLinks}</span><span class='btn-slide crm-hover-button'>{$extra}</span>";
}
else {
$result = "<span>{$resultLinks}</span>";