[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [14459]
From: |
Nelson Guerra |
Subject: |
[Fmsystem-commits] [14459] |
Date: |
Tue, 24 Nov 2015 00:39:31 +0000 |
Revision: 14459
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14459
Author: nelson224
Date: 2015-11-24 00:39:30 +0000 (Tue, 24 Nov 2015)
Log Message:
-----------
Modified Paths:
--------------
branches/dev-syncromind/activitycalendar/inc/class.uicommon.inc.php
Modified: branches/dev-syncromind/activitycalendar/inc/class.uicommon.inc.php
===================================================================
--- branches/dev-syncromind/activitycalendar/inc/class.uicommon.inc.php
2015-11-24 00:34:53 UTC (rev 14458)
+++ branches/dev-syncromind/activitycalendar/inc/class.uicommon.inc.php
2015-11-24 00:39:30 UTC (rev 14459)
@@ -1,8 +1,9 @@
<?php
- phpgw::import_class('phpgwapi.yui');
+ //phpgw::import_class('phpgwapi.yui');
+ phpgw::import_class('phpgwapi.uicommon_jquery');
- define("ACTIVITYCALENDAR_TEMPLATE_PATH",
"activitycalendar/templates/base/");
- define("ACTIVITYCALENDAR_IMAGE_PATH", "rental/templates/base/");
+ //define("ACTIVITYCALENDAR_TEMPLATE_PATH",
"activitycalendar/templates/base/");
+ //define("ACTIVITYCALENDAR_IMAGE_PATH", "rental/templates/base/");
/**
* Cherry pick selected values into a new array
@@ -30,13 +31,13 @@
if(!isset($array[$key]))
$array[$key] = $value;
}
+
define('MANAGER', 'MANAGER');
define('EXECUTIVE_OFFICER', 'EXECUTIVE_OFFICER');
define('ADMINISTRATOR', 'ADMINISTRATOR');
- abstract class activitycalendar_uicommon
+ abstract class activitycalendar_uicommon extends
phpgwapi_uicommon_jquery
{
-
protected static $old_exception_handler;
const LOCATION_ROOT = '.';
@@ -44,14 +45,16 @@
const LOCATION_OUT = '.RESPONSIBILITY.OUT';
const LOCATION_INTERNAL = '.RESPONSIBILITY.INTERNAL';
- public $dateFormat;
+ //public $dateFormat;
public $type_of_user;
public $flash_msgs;
public function __construct()
{
+ parent::__construct();
+
self::set_active_menu('activitycalendar');
-
self::add_stylesheet('phpgwapi/js/yahoo/calendar/assets/skins/sam/calendar.css');
+
/*self::add_stylesheet('phpgwapi/js/yahoo/calendar/assets/skins/sam/calendar.css');
self::add_stylesheet('phpgwapi/js/yahoo/autocomplete/assets/skins/sam/autocomplete.css');
self::add_stylesheet('phpgwapi/js/yahoo/datatable/assets/skins/sam/datatable.css');
self::add_stylesheet('phpgwapi/js/yahoo/container/assets/skins/sam/container.css');
@@ -71,7 +74,7 @@
phpgwapi_yui::load_widget('autocomplete');
phpgwapi_yui::load_widget('animation');
- $dateFormat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+ $dateFormat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];*/
$this->acl = & $GLOBALS['phpgw']->acl;
$this->locations = & $GLOBALS['phpgw']->locations;
@@ -149,89 +152,6 @@
}
}
- public function link($data)
- {
- return $GLOBALS['phpgw']->link('/index.php', $data);
- }
-
- public function redirect($link_data)
- {
- $GLOBALS['phpgw']->redirect_link('/index.php',
$link_data);
- }
-
- public function flash($msg, $type = 'success')
- {
- $this->flash_msgs[$msg] = $type == 'success';
- }
-
- public function flash_form_errors($errors)
- {
- foreach($errors as $field => $msg)
- {
- $this->flash_msgs[$msg] = false;
- }
- }
-
- public function add_stylesheet($path)
- {
- $GLOBALS['phpgw']->css->add_external_file($path);
- }
-
- public function add_javascript($app, $pkg, $name)
- {
- return $GLOBALS['phpgw']->js->validate_file($pkg,
str_replace('.js', '', $name), $app);
- }
-
- public function set_active_menu($item)
- {
- $GLOBALS['phpgw_info']['flags']['menu_selection'] =
$item;
- }
-
- /**
- * A more flexible version of xslttemplate.add_file
- */
- public function add_template_file($tmpl)
- {
- if(is_array($tmpl))
- {
- foreach($tmpl as $t)
- {
- $this->add_template_file($t);
- }
- return;
- }
- foreach(array_reverse($this->tmpl_search_path) as $path)
- {
- $filename = $path . '/' . $tmpl . '.xsl';
- if(file_exists($filename))
- {
-
$GLOBALS['phpgw']->xslttpl->xslfiles[$tmpl] = $filename;
- return;
- }
- }
- echo "Template $tmpl not found in search path: ";
- print_r($this->tmpl_search_path);
- die;
- }
-
- public function render_template($output)
- {
- $GLOBALS['phpgw']->common->phpgw_header(true);
- if($this->flash_msgs)
- {
- $msgbox_data =
$GLOBALS['phpgw']->common->msgbox_data($this->flash_msgs);
- $msgbox_data =
$GLOBALS['phpgw']->common->msgbox($msgbox_data);
- foreach($msgbox_data as & $message)
- {
- echo "<div
class='{$message['msgbox_class']}'>";
- echo $message['msgbox_text'];
- echo '</div>';
- }
- }
- echo htmlspecialchars_decode($output);
- $GLOBALS['phpgw']->common->phpgw_exit();
- }
-
public function check_active($url)
{
if($_SERVER['REQUEST_METHOD'] == 'POST')
@@ -276,34 +196,12 @@
return $gab_id;
}
- public function render($template, $local_variables = array())
- {
- foreach($local_variables as $name => $value)
- {
- $$name = $value;
- }
-
- ob_start();
- foreach(array_reverse($this->tmpl_search_path) as $path)
- {
- $filename = $path . '/' . $template;
- if(file_exists($filename))
- {
- include($filename);
- break;
- }
- }
- $output = ob_get_contents();
- ob_end_clean();
- self::render_template($output);
- }
-
/**
* Method for JSON queries.
*
* @return YUI result
*/
- public abstract function query();
+ //public abstract function query();
/**
* Generate javascript for the extra column definitions for a
partial list
@@ -345,108 +243,6 @@
}
/**
- * Generate javascript definitions for any editor widgets set
on columns for
- * a partial list.
- *
- * @param $array_name the name of the javascript variable that
contains the column definitions
- * @param $editors the list of editors, keyed by column key
- * @return string javascript
- */
- public static function get_column_editors($array_name, $editors
= array())
- {
- $result = "for (var i in {$array_name}) {\n";
- $result .= " switch ({$array_name}[i].key) {\n";
- foreach($editors as $field => $editor)
- {
- $result .= " case '{$field}':\n";
- $result .= "
{$array_name}[i].editor = {$editor};\n";
- $result .= " break;\n";
- }
- $result .= " }\n";
- $result .= "}";
-
- return $result;
- }
-
- /**
- * Returns a html-formatted error message if one is defined in
the
- * list of validation errors on the object we're given. If no
- * error is defined, an empty string is returned.
- *
- * @param $object the object to display errors for
- * @param $field the name of the attribute to display errors for
- * @return string a html formatted error message
- */
- public static function get_field_error($object, $field)
- {
- if(isset($object))
- {
- $errors = $object->get_validation_errors();
-
- if($errors[$field])
- {
- return '<label class="error" for="' .
$field . '">' . $errors[$field] . '</label>';
- }
- return '';
- }
- }
-
- public static function get_messages($messages, $message_type)
- {
- $output = '';
- if(is_array($messages) && count($messages) > 0) //
Array of messages
- {
- $output = "<div class=\"{$message_type}\">";
- foreach($messages as $message)
- {
- $output .= "<p
class=\"message\">{$message}</p>";
- }
- $output .= "</div>";
- }
- else if($messages)
- {
- $output = "<div class=\"{$message_type}\"><p
class=\"message\">{$messages}</p></div>";
- }
- return $output;
- }
-
- /**
- * Returns a html-formatted error message to display on top of
the page. If
- * no error is defined, an empty string is returned.
- *
- * @param $error the error to display
- * @return string a html formatted error message
- */
- public static function get_page_error($errors)
- {
- return self::get_messages($errors, 'error');
- }
-
- /**
- * Returns a html-formatted error message to display on top of
the page. If
- * no error is defined, an empty string is returned.
- *
- * @param $error the error to display
- * @return string a html formatted error message
- */
- public static function get_page_warning($warnings)
- {
- return self::get_messages($warnings, 'warning');
- }
-
- /**
- * Returns a html-formatted info message to display on top of
the page. If
- * no message is defined, an empty string is returned.
- *
- * @param $message the message to display
- * @return string a html formatted info message
- */
- public static function get_page_message($messages)
- {
- return self::get_messages($messages, 'info');
- }
-
- /**
* Download xls, csv or similar file representation of a data
table
*/
public function download()
@@ -498,9 +294,4 @@
{
return array('table_name', 'fields');
}
-
- protected function generate_secret($length = 10)
- {
- return substr(base64_encode(rand(1000000000,
9999999999)), 0, $length);
- }
}
\ No newline at end of file
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [14459],
Nelson Guerra <=