Overview

Packages

  • Admin
  • Archive
  • Common
  • DB
  • Express
  • Form
  • Layout
  • Mailer
  • None
  • OpenHomeoDB
  • PDF
    • MC
  • Process
  • Rep
  • RevRep
  • SaveReps
  • Search
  • Session
  • SymRem
  • TreeView
  • UserDB

Classes

  • DbPlugin
  • FPDF

Functions

  • add_donate_button
  • begin_popup
  • bot_detected
  • build_change_field_select
  • build_change_table_form
  • build_change_table_select
  • build_csv
  • build_date_select
  • build_details_table
  • build_enable_features_checkboxes
  • build_enabled_features_ar
  • build_fields_labels_array
  • build_fields_names_array
  • build_form
  • build_insert_duplication_form
  • build_insert_update_notice_email_record_details
  • build_installed_table_infos_ar
  • build_int_table_field_form
  • build_navigation_tool
  • build_records_per_page_form
  • build_results_table
  • build_results_table_archiv
  • build_select_duplicated_query
  • build_select_part
  • build_select_type_select
  • build_tables_names_array
  • build_where_clause
  • check_fields_types
  • check_length_fields
  • check_required_fields
  • contains_numerics
  • create_ajax_script
  • create_internal_table
  • create_table_list_table
  • create_users_table
  • create_xml_response
  • current_user_is_owner
  • delete_multiple_records
  • delete_record
  • display_sql
  • end_popup
  • get_browser_language
  • get_field_correct_csv_displaying
  • get_field_correct_displaying
  • get_ID_user_field_name
  • get_pages_number
  • insert_other_field
  • insert_record
  • is_valid_email
  • is_valid_url
  • popup
  • skin_close
  • skin_open
  • table_allowed
  • table_contains
  • txt_out
  • update_options
  • update_record
  • Overview
  • Package
  • Function
  • Tree
  1: <?php
  2: 
  3: /**
  4:  * functions/layout.php
  5:  *
  6:  * Some layout functions.
  7:  *
  8:  * PHP version 8
  9:  *
 10:  * LICENSE: This program is free software: you can redistribute it and/or modify
 11:  * it under the terms of the GNU Affero General Public License as
 12:  * published by the Free Software Foundation, either version 3 of the
 13:  * License, or (at your option) any later version.
 14:  * This program is distributed in the hope that it will be useful,
 15:  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 16:  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 17:  * GNU Affero General Public License for more details.
 18:  * You should have received a copy of the GNU Affero General Public License
 19:  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 20:  *
 21:  * @category  Layout
 22:  * @package   Layout
 23:  * @author    Henri Schumacher <henri.hulski@gazeta.pl>
 24:  * @copyright 2007-2014 Henri Schumacher
 25:  * @license   http://www.gnu.org/licenses/agpl.html GNU Affero General Public License v3
 26:  * @version   1.0
 27:  * @link      https://research.openhomeo.info/download/OpenHomeopath_1.0.2.tar.gz
 28:  */
 29: 
 30: function select_skin($class = "") {
 31:     global $session, $db;
 32:     $current_skin = "";
 33:     if (!empty($session->skin)) {
 34:         $current_skin = $session->skin;
 35:     } elseif (isset($_SESSION['skin'])) {
 36:         $current_skin = $_SESSION['skin'];
 37:     } elseif ($session && $session->logged_in) {
 38:         $user_skin  = $db->getUserInfo($session->username, 'skin_name');
 39:         if (!empty($user_skin[0])) {
 40:             $current_skin = $user_skin[0];
 41:         }
 42:     }
 43:     if (empty($current_skin)) {
 44:         $current_skin = DEFAULT_SKIN;
 45:     }
 46:     $select = "<select ";
 47:     if (!empty($class)) {
 48:         $select .= "class='$class' ";
 49:     }
 50:     $select .= "name='skin' id='skin' size='1' onchange='changeSkin(this.value)'>\n";
 51:     echo ($select);
 52:     echo ("  <option selected='selected' value='$current_skin'>$current_skin</option>\n");
 53:     $query = "SELECT skin_name FROM skins ORDER BY skin_id";
 54:     $db->send_query($query);
 55:     while($skin_name = $db->db_fetch_row()) {
 56:         if ($skin_name[0] != $current_skin) {
 57:             echo ("  <option value='$skin_name[0]'>$skin_name[0]</option>\n");
 58:         }
 59:     }
 60:     $db->free_result();
 61:     echo ("</select>\n");
 62: }
 63: 
 64: function add_donate_button($button_nr = 1) {
 65:     global $session;
 66:     $lang = 'de';
 67:     if (isset($session->lang)) {
 68:         $lang = $session->lang;
 69:     }
 70:     switch ($button_nr) {
 71:         case 1:
 72:             $value = '5VCBZJRKXM9EC';
 73:             $button = "spenden_$lang.gif";
 74:             break;
 75:         case 2:
 76:             $value = '936L8TD998HF2';
 77:             $button = "spenden_big_$lang.gif";
 78:             break;
 79:         case 3:
 80:             $value = 'VJ9J7Z8MY7PBN';
 81:             $button = "spenden_big_$lang.gif";
 82:             break;
 83:         case 4:
 84:             $value = '5VCBZJRKXM9EC';
 85:             $button = "spenden_big_$lang.gif";
 86:             break;
 87:     }
 88:     echo ("<form action='https://www.paypal.com/cgi-bin/webscr' method='post' target='_blank'>\n");
 89:     echo ("  <input type='hidden' name='cmd' value='_s-xclick'>\n");
 90:     echo ("  <input type='hidden' name='hosted_button_id' value='$value'>\n");
 91:     echo ("  <input type='image' onclick=\"_paq.push(['trackGoal', 6])\" src='img/$button' name='submit' alt='" . _("Donations") . "' title='" . _("Every donation is very welcome and helps the development of OpenHomeopath.") . "'>\n");
 92:     echo ("  <img alt='' src='https://www.paypal.com/de_DE/i/scr/pixel.gif' width='1' height='1'>\n");
 93:     echo ("</form>\n");
 94: }
 95: 
 96: function begin_popup($history = 0) {
 97:     echo ("<div id='popup' style='position: fixed; display:none; z-index:13;'>\n");
 98:     echo ("  <div class='dragme'>\n");
 99:     echo ("    <div id='popup-icon' style='position: absolute; top: 0; left: 0; width: 30px; height: 25px;'><img height='25' width='30' src='img/popup-icon.gif' alt='Popup icon'></div>\n");
100:     echo ("    <div id='popup-title' style='position: absolute; top: 0; left: 30px; height: 25px; background: url(./img/popup-title-bg.gif) repeat-x; text-align: center;'><img height='25' width='140' src='img/popup-title.gif' alt='Popup title'></div>\n");
101:     echo ("  </div>\n");
102:     echo ("  <div id='popup-close' style='position: absolute; top: 0; width: 30px; height: 25px;'><a style='padding: 0;' href='javascript:popupClose();'><img height='25' width='30' src='img/popup-close.gif' alt='Popup close'></a></div>\n");
103:     echo ("  <div id='popup-lu' style='position: absolute; left: 0; width: 5px; height: 6px; background-color: transparent;'><img height='6' width='5' src='img/popup-lu.gif' alt='Popup frame'></div>\n");
104:     echo ("  <div id='popup-u' class='popup-background' style='position: absolute; left: 5px; height: 6px; background-image: url(./img/popup-u.gif); background-repeat: repeat-x;'></div>\n");
105:     echo ("  <div class='resize' id='popup-ru' style='position: absolute; width: 16px; height: 16px; background-color:transparent; z-index:12;'><img height='16' width='16' src='img/popup-resize.gif' alt='Popup resize'></div>\n");
106:     echo ("  <div id='popup-l' style='position: absolute; top: 25px; left: 0; width: 2px; background: url(./img/popup-l.gif) repeat-y;'></div>\n");
107:     echo ("  <div id='popup-r' style='position: absolute; top: 25px; width: 2px; background: url(./img/popup-r.gif) repeat-y;'></div>\n");
108:     echo ("  <div id='popup-m' class='popup-background' style='position: absolute; top: 25px; left: 2px; overflow:auto;'>\n");
109:     if ($history != 0) {
110:         echo ("      <div style='float: right; margin: 25px'>\n");
111:         echo ("        <a id='history_back' style='padding: 7px;'><img id='arrow_left' height='24' width='38' src='img/arrow_left_inactive.gif' alt='History back'></a><a id='history_forward' style='padding: 7px;'><img id='arrow_right' height='24' width='38' src='img/arrow_right_inactive.gif' alt='History forward'></a>\n");
112:         echo ("      </div>\n");
113:     }
114:     echo ("    <div id='popup-body'>\n");
115: }
116: 
117: function end_popup() {
118:     echo ("    </div>\n");
119:     echo ("  </div>\n");
120:     echo ("</div>\n");
121: }
122: 
123: /* Anwendung:
124: <input type='button' onClick='popupOpen(0,0)' value=' Hilfe '>
125: */
126: function popup($history = 0) {
127:     begin_popup($history);
128:     end_popup();
129: }
130: 
OpenHomeopath PHP code documentation API documentation generated by ApiGen 2.8.0