]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
updated reported content to use elgg_view_form
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 12 Feb 2011 17:52:18 +0000 (17:52 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 12 Feb 2011 17:52:18 +0000 (17:52 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@8166 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/reportedcontent/actions/reportedcontent/add.php [moved from mod/reportedcontent/actions/add.php with 100% similarity]
mod/reportedcontent/actions/reportedcontent/archive.php [moved from mod/reportedcontent/actions/archive.php with 100% similarity]
mod/reportedcontent/actions/reportedcontent/delete.php [moved from mod/reportedcontent/actions/delete.php with 100% similarity]
mod/reportedcontent/start.php
mod/reportedcontent/views/default/forms/reportedcontent/add.php [new file with mode: 0644]
mod/reportedcontent/views/default/reportedcontent/form.php [deleted file]

index e231216cddbc6a2f5ac1df1584d15091db745b70..9e5bb813adc1b6329cf7dff2a3fa42eef04a4eb6 100644 (file)
@@ -36,7 +36,7 @@ function reportedcontent_init() {
                        'admin');
 
        // Register actions
-       $action_path = elgg_get_plugins_path() . "reportedcontent/actions";
+       $action_path = elgg_get_plugins_path() . "reportedcontent/actions/reportedcontent";
        elgg_register_action('reportedcontent/add', "$action_path/add.php");
        elgg_register_action('reportedcontent/delete', "$action_path/delete.php", 'admin');
        elgg_register_action('reportedcontent/archive', "$action_path/archive.php", 'admin');
@@ -54,7 +54,7 @@ function reportedcontent_page_handler($page) {
        gatekeeper();
 
        $content .= elgg_view_title(elgg_echo('reportedcontent:this'));
-       $content .= elgg_view('reportedcontent/form');
+       $content .= elgg_view_form('reportedcontent/add');
        $sidebar = elgg_echo('reportedcontent:instructions');
 
        $params = array(
diff --git a/mod/reportedcontent/views/default/forms/reportedcontent/add.php b/mod/reportedcontent/views/default/forms/reportedcontent/add.php
new file mode 100644 (file)
index 0000000..abc53e7
--- /dev/null
@@ -0,0 +1,57 @@
+<?php
+/**
+ * Elgg report content plugin form
+ * 
+ * @package ElggReportContent
+ */
+
+$guid = 0;
+$title = get_input('title', "");
+$address = get_input('address', "");
+
+$description = "";
+$owner = elgg_get_logged_in_user_entity();
+
+?>
+
+<div>
+       <label>
+               <?php
+                       echo elgg_echo('reportedcontent:title');
+                       echo elgg_view('input/text', array(
+                               'internalname' => 'title',
+                               'value' => $title,
+                       ));
+               ?>
+       </label>
+</div>
+<div>
+       <label>
+               <?php
+                       echo elgg_echo('reportedcontent:address');
+                       echo elgg_view('input/url', array(
+                                       'internalname' => 'address',
+                                                       'value' => $address,
+                                       )); 
+                       
+                       ?>
+       </label>
+</div>
+<div>
+       <label>
+               <?php   echo elgg_echo('reportedcontent:description'); ?>
+       </label>
+       <?php
+               echo elgg_view('input/longtext',array(
+                       'internalname' => 'description',
+                       'value' => $description,
+               )); 
+       ?>
+</div>
+<div>
+       <?php
+               echo elgg_view('input/submit', array(
+                       'value' => elgg_echo('reportedcontent:report'),
+               ));
+       ?>
+</div>
diff --git a/mod/reportedcontent/views/default/reportedcontent/form.php b/mod/reportedcontent/views/default/reportedcontent/form.php
deleted file mode 100644 (file)
index b520d40..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-<?php
-/**
- * Elgg report content plugin form
- * 
- * @package ElggReportContent
- */
-
-$guid = 0;
-$title = get_input('title', "");
-$description = "";
-$address = get_input('address', "");
-if ($address == "previous") {
-       $address = $_SERVER['HTTP_REFERER'];
-}
-$tags = array();
-$access_id = ACCESS_PRIVATE;
-$shares = array();
-$owner = elgg_get_logged_in_user_entity();
-
-?>
-<form action="<?php echo elgg_get_site_url(); ?>action/reportedcontent/add" method="post" class="mtm">
-<?php echo elgg_view('input/securitytoken'); ?>
-
-       <div>
-               <label>
-                       <?php   echo elgg_echo('reportedcontent:title'); ?>
-                       <?php
-
-                                       echo elgg_view('input/text',array(
-                                                       'internalname' => 'title',
-                                                       'value' => $title,
-                                       )); 
-                       
-                       ?>
-               </label>
-       </div>
-       <div>
-               <label>
-                       <?php   echo elgg_echo('reportedcontent:address'); ?>
-                       <?php
-
-                                       echo elgg_view('input/url',array(
-                                                       'internalname' => 'address',
-                                                       'value' => $address,
-                                       )); 
-                       
-                       ?>
-               </label>
-       </div>
-       <div>
-               <label>
-                       <?php   echo elgg_echo('reportedcontent:description'); ?>
-               </label>
-                       <?php
-
-                                       echo elgg_view('input/longtext',array(
-                                                       'internalname' => 'description',
-                                                       'value' => $description,
-                                       )); 
-                       
-                       ?>
-       </div>
-       <div>
-               <input type="submit" value="<?php echo elgg_echo('reportedcontent:report'); ?>" />
-       </div>
-</form>