Clean up style
This commit is contained in:
parent
5153654060
commit
7665546022
@ -1,4 +1,5 @@
|
|||||||
<?php defined("SYSPATH") or die("No direct script access.");/**
|
<?php defined("SYSPATH") or die("No direct script access.");
|
||||||
|
/**
|
||||||
* Gallery - a web based photo album viewer and editor
|
* Gallery - a web based photo album viewer and editor
|
||||||
* Copyright (C) 2000-2009 Bharat Mediratta
|
* Copyright (C) 2000-2009 Bharat Mediratta
|
||||||
*
|
*
|
||||||
@ -16,40 +17,33 @@
|
|||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
class Admin_Google_Analytics_Controller extends Admin_Controller
|
class Admin_Google_Analytics_Controller extends Admin_Controller {
|
||||||
{
|
public function index() {
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
print $this->_get_view();
|
print $this->_get_view();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handler()
|
public function handler() {
|
||||||
{
|
|
||||||
access::verify_csrf();
|
access::verify_csrf();
|
||||||
|
|
||||||
$form = $this->_get_form();
|
$form = $this->_get_form();
|
||||||
|
if ($form->validate()) {
|
||||||
if ($form->validate())
|
module::set_var(
|
||||||
{
|
"google_analytics", "code", $form->google_analytics_code->analytics_code->value);
|
||||||
module::set_var("google_analytics", "code", $form->google_analytics_code->inputs["analytics_code"]->value);
|
|
||||||
url::redirect("admin/google_analytics");
|
url::redirect("admin/google_analytics");
|
||||||
}
|
}
|
||||||
|
|
||||||
print $this->_get_view($form);
|
print $this->_get_view($form);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function _get_view($form=null)
|
private function _get_view($form=null) {
|
||||||
{
|
|
||||||
$v = new Admin_View("admin.html");
|
$v = new Admin_View("admin.html");
|
||||||
$v->content = new View("admin_google_analytics.html");
|
$v->content = new View("admin_google_analytics.html");
|
||||||
$v->content->form = empty($form) ? $this->_get_form() : $form;
|
$v->content->form = empty($form) ? $this->_get_form() : $form;
|
||||||
return $v;
|
return $v;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function _get_form()
|
private function _get_form() {
|
||||||
{
|
$form = new Forge("admin/google_analytics/handler", "", "post", array("id" => "gAdminForm"));
|
||||||
$form = new Forge("admin/google_analytics/handler", "", "post",
|
|
||||||
array("id" => "gAdminForm"));
|
|
||||||
$group = $form->group("google_analytics_code");
|
$group = $form->group("google_analytics_code");
|
||||||
$group->input("analytics_code")->label(t('Enter the <a href="http://www.google.com/support/googleanalytics/bin/answer.py?answer=113500" target="_blank">Web-Property-ID</a> given by Google.'))->rules("required")->value(module::get_var("google_analytics", "code"));
|
$group->input("analytics_code")->label(t('Enter the <a href="http://www.google.com/support/googleanalytics/bin/answer.py?answer=113500" target="_blank">Web-Property-ID</a> given by Google.'))->rules("required")->value(module::get_var("google_analytics", "code"));
|
||||||
$group->submit("submit")->value(t("Save"));
|
$group->submit("submit")->value(t("Save"));
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<?php defined("SYSPATH") or die("No direct script access.");/**
|
<?php defined("SYSPATH") or die("No direct script access.");
|
||||||
|
/**
|
||||||
* Gallery - a web based photo album viewer and editor
|
* Gallery - a web based photo album viewer and editor
|
||||||
* Copyright (C) 2000-2009 Bharat Mediratta
|
* Copyright (C) 2000-2009 Bharat Mediratta
|
||||||
*
|
*
|
||||||
@ -16,23 +17,13 @@
|
|||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
class google_analytics_installer
|
class google_analytics_installer {
|
||||||
{
|
static function install() {
|
||||||
static function install()
|
|
||||||
{
|
|
||||||
$version = module::get_version("google_analytics");
|
|
||||||
module::set_var("google_analytics", "code", "");
|
module::set_var("google_analytics", "code", "");
|
||||||
module::set_version("google_analytics", $version);
|
module::set_version("google_analytics", 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static function upgrade($version)
|
static function uninstall() {
|
||||||
{
|
|
||||||
module::set_version("google_analytics", $version);
|
|
||||||
}
|
|
||||||
|
|
||||||
static function uninstall()
|
|
||||||
{
|
|
||||||
module::clear_var("google_analytics", "code");
|
module::clear_var("google_analytics", "code");
|
||||||
module::delete("google_analytics");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<?php defined("SYSPATH") or die("No direct script access.");/**
|
<?php defined("SYSPATH") or die("No direct script access.");
|
||||||
|
/**
|
||||||
* Gallery - a web based photo album viewer and editor
|
* Gallery - a web based photo album viewer and editor
|
||||||
* Copyright (C) 2000-2009 Bharat Mediratta
|
* Copyright (C) 2000-2009 Bharat Mediratta
|
||||||
*
|
*
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<?php defined("SYSPATH") or die("No direct script access.");/**
|
<?php defined("SYSPATH") or die("No direct script access.");
|
||||||
|
/**
|
||||||
* Gallery - a web based photo album viewer and editor
|
* Gallery - a web based photo album viewer and editor
|
||||||
* Copyright (C) 2000-2009 Bharat Mediratta
|
* Copyright (C) 2000-2009 Bharat Mediratta
|
||||||
*
|
*
|
||||||
@ -16,10 +17,8 @@
|
|||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
class google_analytics_theme
|
class google_analytics_theme {
|
||||||
{
|
static function page_bottom($theme) {
|
||||||
static function page_bottom($theme)
|
|
||||||
{
|
|
||||||
$google_code = '
|
$google_code = '
|
||||||
<!-- Begin Google Analytics -->
|
<!-- Begin Google Analytics -->
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@ -39,5 +38,4 @@ class google_analytics_theme
|
|||||||
|
|
||||||
return $google_code;
|
return $google_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
name = Google Analytics
|
name = Google Analytics
|
||||||
description = Renders the Google Analytics Code at the end of the page.
|
description = Renders the Google Analytics Code at the end of the page. (by mcp)
|
||||||
version = 1.2
|
version = 1.2
|
Reference in New Issue
Block a user