/** * Shows the Tools index template */ public function actionToolsIndex() { // Get only the tools we want $tools = array('SupercoolTools_ClearCaches' => craft()->components->getComponentByTypeAndClass(ComponentType::Tool, 'SupercoolTools_ClearCaches'), 'SupercoolTools_ClearTasks' => craft()->components->getComponentByTypeAndClass(ComponentType::Tool, 'SupercoolTools_ClearTasks'), 'SearchIndex' => craft()->components->getComponentByTypeAndClass(ComponentType::Tool, 'SearchIndex')); $variables['tools'] = ToolVariable::populateVariables($tools); $this->renderTemplate('supercooltools/_index', $variables); }
/** * Shows the settings index. */ public function actionSettingsIndex() { // Get all the tools $tools = craft()->components->getComponentsByType(ComponentType::Tool); ksort($tools); $variables['tools'] = ToolVariable::populateVariables($tools); $this->renderTemplate('settings/index', $variables); }
public function getBodyHtml() { $tools = craft()->components->getComponentsByType(ComponentType::Tool); ksort($tools); // If there are no Asset sources, don't display the update Asset indexes tool. if (count(craft()->assetSources->getAllSources()) == 0) { unset($tools['AssetIndex']); } $variables['tools'] = ToolVariable::populateVariables($tools); return craft()->templates->render('clientwidgets/_tools', array('tools' => $tools)); }
/** * Shows the settings index. * * @return null */ public function actionSettingsIndex() { // Get all the tools $tools = craft()->components->getComponentsByType(ComponentType::Tool); ksort($tools); // If there are no Asset sources, don't display the update Asset indexes tool. if (count(craft()->assetSources->getAllSources()) == 0) { unset($tools['AssetIndex']); } $variables['tools'] = ToolVariable::populateVariables($tools); $this->renderTemplate('settings/_index', $variables); }