Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Ported actions and add_key form to new Elgg conventions for elgg_view…
…_form method
  • Loading branch information
fmestrone authored and cash committed Jan 27, 2013
1 parent b653a19 commit 0fe7a3b
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 10 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions start.php
@@ -1,7 +1,7 @@
<?php
/**
* Elgg API Admin
* Upgraded to Elgg 1.8 (tested on 1.8.6) and added rename and regenerate actions
* Upgraded to Elgg 1.8 (tested on 1.8.8) and added rename and regenerate actions
*
* @package ElggAPIAdmin
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
Expand All @@ -28,11 +28,11 @@ function apiadmin_init($event, $object_type, $object = null) {
elgg_register_event_handler('delete', 'object', 'apiadmin_delete_key');

// Register some actions
$plugins = elgg_get_plugins_path();
elgg_register_action('apiadmin/revokekey', $plugins . 'apiadmin/actions/revokekey.php', 'admin');
elgg_register_action('apiadmin/generate', $plugins . 'apiadmin/actions/generate.php', 'admin');
elgg_register_action('apiadmin/renamekey', $plugins . 'apiadmin/actions/renamekey.php', 'admin');
elgg_register_action('apiadmin/regenerate', $plugins . 'apiadmin/actions/regenerate.php', 'admin');
$plugindir = dirname(__FILE__);
elgg_register_action('apiadmin/revokekey', $plugindir . '/actions/apiadmin/revokekey.php', 'admin');
elgg_register_action('apiadmin/generate', $plugindir . '/actions/apiadmin/generate.php', 'admin');
elgg_register_action('apiadmin/renamekey', $plugindir . '/actions/apiadmin/renamekey.php', 'admin');
elgg_register_action('apiadmin/regenerate', $plugindir . '/actions/apiadmin/regenerate.php', 'admin');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion views/default/admin/administer_utilities/apiadmin.php
Expand Up @@ -12,7 +12,7 @@
*/

// Display add form
echo elgg_view('apiadmin/forms/add_key');
echo elgg_view_form('apiadmin/generate');

// Display all current API keys
echo elgg_list_entities(array(
Expand Down
Expand Up @@ -15,10 +15,8 @@
$ref_control = elgg_view('input/text', array('name' => 'ref'));
$gen_control = elgg_view('input/submit', array('value' => elgg_echo('apiadmin:generate')));

$form_body = <<<END
echo <<<END
<div class="contentWrapper">
<p>$ref_label: $ref_control $gen_control</p>
</div>
END;

echo elgg_view('input/form', array('action' => "{$vars['url']}action/apiadmin/generate", "body" => $form_body));

0 comments on commit 0fe7a3b

Please sign in to comment.