| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
const CACHE_KEY_STRLEN = 8;
/**
- * Class constructor
+ * Class constructor.
*/
public function __construct() {
parent::__construct();
}
/**
- * Update the is_active flag in the db
+ * Update the is_active flag in the db.
*
* @param int $id
* Id of the database record.
* @return Object
* DAO object on sucess, NULL otherwise
*
- * @static
*/
public static function setIsActive($id, $is_active) {
return CRM_Core_DAO::setFieldValue('CRM_Core_DAO_Navigation', $id, 'is_active', $is_active);
/**
* Get existing / build navigation for CiviCRM Admin Menu
*
- * @static
* @return array
* associated array
*/
/**
* Add/update navigation record
*
- * @param array associated array of submitted values
+ * @param $params associated array of submitted values
*
* @return object
* navigation object
- * @static
*/
public static function add(&$params) {
$navigation = new CRM_Core_DAO_Navigation();
}
/**
- * Fetch object based on array of properties
+ * Fetch object based on array of properties.
*
* @param array $params
* (reference ) an assoc array of name/value pairs.
* @param array $defaults
* (reference ) an assoc array to hold the flattened values.
*
- * @return CRM_Core_BAO_Navigation object on success, NULL otherwise
- * @static
+ * @return CRM_Core_BAO_Navigation|null
+ * object on success, NULL otherwise
*/
public static function retrieve(&$params, &$defaults) {
$navigation = new CRM_Core_DAO_Navigation();
}
/**
- * Calculate navigation weight
+ * Calculate navigation weight.
*
* @param int $parentID
* Parent_id of a menu.
*
* @return int
* $weight string
- * @static
*/
public static function calculateWeight($parentID = NULL, $menuID = NULL) {
$domainID = CRM_Core_Config::domainID();
}
/**
- * Get formatted menu list
+ * Get formatted menu list.
*
* @return array
* returns associated array
- * @static
*/
public static function getNavigationList() {
$cacheKeyString = "navigationList";
}
/**
- * Build navigation tree
+ * Build navigation tree.
*
* @param array $navigationTree
* Nested array of menus.
*
* @return array
* nested array of menus
- * @static
*/
public static function buildNavigationTree(&$navigationTree, $parentID, $navigationMenu = TRUE) {
$whereClause = " parent_id IS NULL";
'parentID' => $navigation->parent_id,
'navID' => $navigation->id,
'active' => $navigation->is_active,
- )
+ ),
);
self::buildNavigationTree($navigationTree[$navigation->id]['child'], $navigation->id, $navigationMenu);
}
}
/**
- * Build menu
+ * Build menu.
*
* @param bool $json
* By default output is html.
* @param bool $navigationMenu
* True when called for building top navigation menu.
*
- * @return returns html or json object
- * @static
+ * @return string
+ * html or json string
*/
public static function buildNavigation($json = FALSE, $navigationMenu = TRUE) {
$navigations = array();
}
/**
- * Recursively check child menus
+ * Recursively check child menus.
*
* @param array $value
* @param string $navigationString
}
/**
- * Get Menu name
+ * Get Menu name.
*
* @param $value
* @param array $skipMenuItems
//we need to check core view/edit or supported acls.
if (in_array($menuName, array(
'Search...',
- 'Contacts'
+ 'Contacts',
))) {
if (!CRM_Core_Permission::giveMeAllACLs()) {
$skipMenuItems[] = $navID;
}
/**
- * Create navigation for CiviCRM Admin Menu
+ * Create navigation for CiviCRM Admin Menu.
*
* @param int $contactID
* Contact id.
*
* @return string
* returns navigation html
- * @static
*/
public static function createNavigation($contactID) {
$config = CRM_Core_Config::singleton();
// get home menu from db
$homeParams = array('name' => 'Home');
$homeNav = array();
- $homeIcon = '<img src="' . $config->userFrameworkResourceURL . 'i/logo16px.png" style="vertical-align:middle;" />';
+ $homeIcon = '<span class="crm-logo-sm" ></span>';
self::retrieve($homeParams, $homeNav);
if ($homeNav) {
list($path, $q) = explode('?', $homeNav['url']);
}
/**
- * Reset navigation for all contacts or a specified contact
+ * Reset navigation for all contacts or a specified contact.
*
* @param int $contactID
* Reset only entries belonging to that contact ID.
}
/**
- * Process navigation
+ * Process navigation.
*
* @param array $params
* Associated array, $_GET.
*
* @return void
- * @static
*/
public static function processNavigation(&$params) {
$nodeID = (int) str_replace("node_", "", $params['id']);
}
/**
- * Process move action
+ * Process move action.
*
* @param $nodeID
* Node that is being moved.
* New position of the nod, it starts with 0 - n.
*
* @return void
- * @static
*/
public static function processMove($nodeID, $referenceID, $position) {
// based on the new position we need to get the weight of the node after moved node
}
/**
- * Function to process rename action for tree
+ * Function to process rename action for tree.
*
* @param int $nodeID
* @param $label
}
/**
- * Process delete action for tree
+ * Process delete action for tree.
*
* @param int $nodeID
*/
}
/**
- * Get the info on navigation item
+ * Get the info on navigation item.
*
* @param int $navigationID
* Navigation id.
*
* @return array
* associated array
- * @static
*/
public static function getNavigationInfo($navigationID) {
$query = "SELECT parent_id, weight FROM civicrm_navigation WHERE id = %1";
}
/**
- * Update menu
+ * Update menu.
*
* @param array $params
* @param array $newParams
* New value of params.
- * @static
*/
public static function processUpdate($params, $newParams) {
$dao = new CRM_Core_DAO_Navigation();
}
return $key;
}
+
}