Skip to content
Permalink
Browse files

removed stats handler and lavacharts, ui can render external template…

…s, custom handler now are lazy loaded
  • Loading branch information
michelerota committed Jul 5, 2016
1 parent 7b68d8f commit eb5becf8c0deb8b7a34c77a70ef8fc50715c7a4c
@@ -14,7 +14,6 @@
"php": ">=5.5.9",
"fightbulc/moment": "^1.13",
"smarty/smarty": "^3.1",
"vlucas/phpdotenv": "^2.2",
"khill/lavacharts": "^3.0"
"vlucas/phpdotenv": "^2.2"
}
}
@@ -2491,40 +2491,6 @@ public function addToSearchformFields(&$fields, $node, &$record, $fieldprefix =
return $this;
}

public function addToStatsformFields(&$fields, $node, &$record, $fieldprefix = '')
{
$field = [];
$defaults = $record;
$opts = $this->getStatOptions();
$extended = $opts['extended'];
//$this->m_isStatsMode = true;

// set "widget" value:
$funcname = $this->m_name.'_search';

if (method_exists($node, $funcname)) {
$field['widget'] = $node->$funcname($defaults, $extended, $fieldprefix);
} else {
$field['widget'] = $this->stats($defaults, $extended, $fieldprefix); // second param indicates extended search.
}

$field['id'] = $this->getSearchFieldName($fieldprefix);
$field['rowid'] = 'ar_'.($field['id'] != '' ? $field['id'] : Tools::getUniqueId('anonymousattribrows')); // The id of the containing row

// pre-emptive set "full" value:
$field['full'] = $field['widget']; // lateron, we might add more to full
// set "searchmode" value:
$field['searchmode'] = $opts['showSearchMode'] ? $this->searchMode($extended, $fieldprefix) : '';

// set "label" value:
$field['label'] = $this->label();

// add $field to fields array
$fields[] = $field;

return $this;
}

/**
* Retrieve the fieldname of the attribute in an atksearch form.
*
@@ -266,17 +266,24 @@ public function moduleDir($moduleName)
* @param string $nodeUri the uri of the node
* @param string $action the node action
*
* @return ActionHandler functionname or object (is_subclass_of ActionHandler) or
* NULL if no handler exists for the specified action
* @return ActionHandler full class or object instance (subclass of ActionHandler) or NULL if no handler exists for the specified action
*/
public function atkGetNodeHandler($nodeUri, $action)
{
if (isset($this->g_nodeHandlers[$nodeUri][$action])) {
$handler = $this->g_nodeHandlers[$nodeUri][$action];
if(!is_object($handler)){
$handler = new $handler();
$this->g_nodeHandlers[$nodeUri][$action] = $handler;
}
} elseif (isset($this->g_nodeHandlers['*'][$action])) {
$handler = $this->g_nodeHandlers['*'][$action];
if(!is_object($handler)){
$handler = new $handler();
$this->g_nodeHandlers['*'][$action] = $handler;
}
} else {
$handler = null;
return null;
}

return $handler;
@@ -1795,8 +1795,6 @@ public function getFormButtons($mode, $record = array())
// (don't change the order of button)
$result[] = $this->getButton('search', true);
$result[] = $this->getButton('cancel');
} elseif ($mode == 'stats') {
$result[] = $this->getButton('search', true);
}

return $result;
@@ -2444,8 +2442,6 @@ public function getTemplate($action, $record = null, $tab = '')
return 'smartsearchform.tpl';
case 'admin':
return 'recordlist.tpl';
case 'stats':
return 'statsform.tpl';
}
}

This file was deleted.

0 comments on commit eb5becf

Please sign in to comment.
You can’t perform that action at this time.