repo_name
stringlengths
4
116
path
stringlengths
4
379
size
stringlengths
1
7
content
stringlengths
3
1.05M
license
stringclasses
15 values
nitesh146/Motleymart
components/com_api/views/keys/view.html.php
2452
<?php /** * @package com_api * @copyright Copyright (C) 2009 2014 Techjoomla, Tekdi Technologies Pvt. Ltd. All rights reserved. * @license GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html> * @link http://techjoomla.com * Work derived from the original RESTful API by Techjoomla (https://github.com/techjoomla/Joomla-REST-API) * and the com_api extension by Brian Edgerton (http://www.edgewebworks.com) */ // no direct access defined('_JEXEC') or die('Restricted access'); class ApiViewKeys extends ApiView { public $can_register = null; public function __construct() { parent::__construct(); $user = JFactory::getUser(); if (!$user->get('id')) { JFactory::getApplication()->redirect('index.php', JText::_('COM_API_NOT_AUTH_MSG')); exit(); } $params = JComponentHelper::getParams('com_api'); $this->set('can_register', $params->get('key_registration', false) && $user->get('gid') >= $params->get('key_registration_access', 18)); } public function display($tpl = null) { JHTML::stylesheet('com_api.css', 'components/com_api/assets/css/'); if ($this->routeLayout($tpl)) : return; endif; $user = JFactory::getUser(); $model = JModelLegacy::getInstance('Key', 'ApiModel'); $model->setState('user_id', $user->get('id')); $tokens = $model->getList(); $new_token_link = JRoute::_('index.php?option=com_api&view=keys&layout=new'); $this->session_token = JHtml::_('form.token'); $this->new_token_link = $new_token_link; $this->user = $user; $this->tokens = $tokens; parent::display($tpl); } protected function displayNew($tpl=null) { $this->setLayout('edit'); $this->displayEdit($tpl); } protected function displayEdit($tpl=null) { $app = JFactory::getApplication(); JHTML::script('joomla.javascript.js', 'includes/js/'); $this->assignRef('return', $_SERVER['HTTP_REFERER']); $key = JTable::getInstance('Key', 'ApiTable'); if ($id = $app->input->get('id', 0 ,'INT')) : $key->load($id); if ($key->user_id != JFactory::getUser()->get('id')) : JFactory::getApplication()->redirect($_SERVER['HTTP_REFERER'], JText::_('COM_API_UNAUTHORIZED_EDIT_KEY')); return false; endif; elseif (!$this->can_register) : JFactory::getApplication()->redirect(JRoute::_('index.php?option=com_api&view=keys'), JText::_('COM_API_UNAUTHORIZED_REGISTER')); return false; endif; $this->assignRef('key', $key); parent::display($tpl); } }
gpl-2.0
KENICHI88/pizzahut
administrator/components/com_districts/controller.php
4253
<?php defined('_JEXEC') or die( 'Restricted access' ); jimport( 'joomla.application.component.controller' ); class DistrictsController extends JController { function __construct($config = array()) { parent::__construct($config); // Register Extra tasks $this->registerTask( 'add', 'display' ); $this->registerTask( 'edit', 'display' ); } function display( ) { switch($this->getTask()) { case 'add' : { JRequest::setVar( 'hidemainmenu', 1 ); JRequest::setVar( 'layout', 'default' ); JRequest::setVar( 'view' , 'district'); JRequest::setVar( 'edit', false ); $model = $this->getModel('district'); } break; case 'edit' : { JRequest::setVar( 'hidemainmenu', 1 ); JRequest::setVar( 'layout', 'default' ); JRequest::setVar( 'view' , 'district'); JRequest::setVar( 'edit', true ); $model = $this->getModel('district'); } break; } parent::display(); } function save() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $post = JRequest::get('post'); $cid = JRequest::getVar( 'cid', array(0), 'post', 'array' ); $post['id'] = (int) $cid[0]; $model = $this->getModel('district'); if ($model->store($post)) { $msg = JText::_( 'District Saved' ); } else { $msg = JText::_( 'Error Saving District' ); } $link = 'index.php?option=com_districts'; $this->setRedirect($link, $msg); } function remove() { JRequest::checkToken() or jexit( 'Invalid Token' ); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); JArrayHelper::toInteger($cid); if (count( $cid ) < 1) { JError::raiseError(500, JText::_( 'Select an item to delete' ) ); } $model = $this->getModel('district'); if(!$model->delete($cid)) { echo "<script> alert('".$model->getError(true)."'); window.history.go(-1); </script>\n"; } $this->setRedirect( 'index.php?option=com_districts' ); } function publish() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); JArrayHelper::toInteger($cid); if (count( $cid ) < 1) { JError::raiseError(500, JText::_( 'Select an item to publish' ) ); } $model = $this->getModel('district'); if(!$model->publish($cid, 1)) { echo "<script> alert('".$model->getError(true)."'); window.history.go(-1); </script>\n"; } $this->setRedirect( 'index.php?option=com_districts' ); } function unpublish() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); JArrayHelper::toInteger($cid); if (count( $cid ) < 1) { JError::raiseError(500, JText::_( 'Select an item to unpublish' ) ); } $model = $this->getModel('district'); if(!$model->publish($cid, 0)) { echo "<script> alert('".$model->getError(true)."'); window.history.go(-1); </script>\n"; } $this->setRedirect( 'index.php?option=com_districts' ); } function cancel() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Checkin the district $model = $this->getModel('district'); $model->checkin(); $this->setRedirect( 'index.php?option=com_districts' ); } function orderup() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $model = $this->getModel('district'); $model->move(-1); $this->setRedirect( 'index.php?option=com_districts'); } function orderdown() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $model = $this->getModel('district'); $model->move(1); $this->setRedirect( 'index.php?option=com_districts'); } function saveorder() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); $order = JRequest::getVar( 'order', array(), 'post', 'array' ); JArrayHelper::toInteger($cid); JArrayHelper::toInteger($order); $model = $this->getModel('district'); $model->saveorder($cid, $order); $msg = JText::_( 'New ordering saved' ); $this->setRedirect( 'index.php?option=com_districts', $msg ); } }
gpl-2.0
joshmoore/openmicroscopy
components/insight/SRC/org/openmicroscopy/shoola/agents/editor/browser/BrowserModel.java
7397
/* * org.openmicroscopy.shoola.agents.editor.browser.BrowserModel * *------------------------------------------------------------------------------ * Copyright (C) 2006-2008 University of Dundee. All rights reserved. * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * *------------------------------------------------------------------------------ */ package org.openmicroscopy.shoola.agents.editor.browser; //Java imports import java.util.Date; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.TreeModel; import javax.swing.tree.TreeNode; import org.openmicroscopy.shoola.agents.editor.model.CPEimport; import org.openmicroscopy.shoola.agents.editor.model.ExperimentInfo; import org.openmicroscopy.shoola.agents.editor.model.IAttributes; //Third-party libraries //Application-internal dependencies /** * The Browser model. * The data is stored in a treeModel. * * @author William Moore &nbsp;&nbsp;&nbsp;&nbsp; * <a href="mailto:will@lifesci.dundee.ac.uk">will@lifesci.dundee.ac.uk</a> * @version 3.0 * <small> * (<b>Internal version:</b> $Revision: $Date: $) * </small> * @since OME3.0 */ class BrowserModel { /** Is the file locked? */ private boolean fileLocked; /** Either {@link Browser#TREE_EDITED} or {@link Browser#TREE_SAVED} */ private int savedState; /** * If the file is saved to the server, this ID will be the ID of the * original file on the server (not the file annotation). * The Editor manages file saving etc and this ID is purely for display * purposes in the Browser. */ private long id; /** Reference to the component that embeds this model. */ protected Browser component; /** The model is delegated to a treeModel. */ private TreeModel treeModel; /** The type of browser. */ private int type; /** * Creates an instance. * * @param state The editing mode of the browser. * Either {@link Browser#EDIT_EXPERIMENT} or * {@link Browser#EDIT_PROTOCOL} * @param type */ BrowserModel(int state, int type) { setEditingMode(state); this.savedState = Browser.TREE_SAVED; this.type = type; } /** * Called by the <code>Browser</code> after creation to allow this * object to store a back reference to the embedding component. * * @param component The embedding component. */ void initialize(Browser component) { this.component = component; } /** * Returns a reference to the treeModel * * @return A reference to the treeModel. */ TreeModel getTreeModel() { return treeModel; } /** * Sets the treeModel. * * @param model the new TreeModel. */ void setTreeModel(TreeModel model) { this.treeModel = model; // if the model is an experiment, file is locked by default. if (isModelExperiment()) { setEditingMode(Browser.EDIT_EXPERIMENT); // fileLocked = true; } } /** * Returns the current state. Either {@link Browser#EDIT_EXPERIMENT} or * {@link Browser#EDIT_PROTOCOL}. * If we are not currently editing an Experiment, this will return * {@link Browser#EDIT_PROTOCOL}. Otherwise, this method delegates to * the {@link ExperimentInfo}. * * @return see above */ int getEditingMode() { if (isModelExperiment()) { if ("true".equals(ExperimentInfo.getExpInfo(treeModel). getAttribute(ExperimentInfo.EDIT_PROTOCOL))) return Browser.EDIT_PROTOCOL; else return Browser.EDIT_EXPERIMENT; } return Browser.EDIT_PROTOCOL; } /** * Returns the current saved state. * * @return One of the flags defined by the {@link Browser} interface. */ int getSavedState() { return savedState; } /** * Sets the Edited state of the Browser. * * @param edited Pass to <code>true</code> to indicate that the file is * edited, <code>false</code> otherwise. */ void setEdited(boolean edited) { if (edited) savedState = Browser.TREE_EDITED; else savedState = Browser.TREE_SAVED; // notify listeners of changes to the model // when file saved (eg Exp-Info last-saved date) if (!edited) { DefaultTreeModel d = ((DefaultTreeModel) treeModel); d.nodeChanged((TreeNode) d.getRoot()); } } /** * Allows the file to be locked to prevent editing. * @param locked */ void setFileLocked(boolean locked) { fileLocked = locked; } /** * Returns true if the file is locked. * NB This functionality is not currently used. * * @return see above. */ boolean isFileLocked() { return fileLocked; } /** * Sets the editing mode. Either * {@link Browser#EDIT_EXPERIMENT} or {@link Browser#EDIT_PROTOCOL} * @param mode see above */ void setEditingMode(int mode) { if (isModelExperiment()) { if (mode == Browser.EDIT_PROTOCOL) { ExperimentInfo.getExpInfo(treeModel).setAttribute (ExperimentInfo.EDIT_PROTOCOL, "true"); } else { ExperimentInfo.getExpInfo(treeModel).setAttribute (ExperimentInfo.EDIT_PROTOCOL, "false"); } } } /** * Determines whether a TreeModel of a protocol * contains an Experimental Info object at the root node, thereby * defining it as an Experiment. * * @return see above. */ boolean isModelExperiment() { return ExperimentInfo.isModelExperiment(treeModel); } /** * Gets the Date that the file was last saved (archive date). * @return see above. */ Date getLastSavedDate() { DefaultMutableTreeNode root = (DefaultMutableTreeNode) treeModel.getRoot(); IAttributes rootField = ((IAttributes)root.getUserObject()); String archiveUTC = rootField.getAttribute(CPEimport.ARCHIVE_DATE); try { long millis = new Long(archiveUTC); Date d = new Date(millis); return d; } catch (NumberFormatException nfe) { return null; } } /** * Sets the ID so that it can be displayed in the browser. * * @param id The value to set. */ void setId(long id) { this.id = id; } /** * Gets the ID for display. Not used for file saving etc (handled by Editor) * * @return see above. */ long getId() { return id; } /** * Returns the type of the browser. * * @return See above. */ int getType() { return type; } }
gpl-2.0
CoordCulturaDigital-Minc/culturadigital.br
wp-content/plugins/si-captcha-for-wordpress/captcha-secureimage/captcha-temp/Uae6HNlW1GfZhTUv.php
32
<?php $captcha_word = '2LDT'; ?>
gpl-2.0
amirlotfi/Nikagram
app/src/main/java/ir/nikagram/messenger/time/FastDatePrinter.java
40237
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ir.nikagram.messenger.time; import java.io.IOException; import java.io.ObjectInputStream; import java.io.Serializable; import java.text.DateFormat; import java.text.DateFormatSymbols; import java.text.FieldPosition; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.List; import java.util.Locale; import java.util.TimeZone; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; /** * <p>FastDatePrinter is a fast and thread-safe version of * {@link java.text.SimpleDateFormat}.</p> * * <p>This class can be used as a direct replacement to * {@code SimpleDateFormat} in most formatting situations. * This class is especially useful in multi-threaded server environments. * {@code SimpleDateFormat} is not thread-safe in any JDK version, * nor will it be as Sun have closed the bug/RFE. * </p> * * <p>Only formatting is supported, but all patterns are compatible with * SimpleDateFormat (except time zones and some year patterns - see below).</p> * * <p>Java 1.4 introduced a new pattern letter, {@code 'Z'}, to represent * time zones in RFC822 format (eg. {@code +0800} or {@code -1100}). * This pattern letter can be used here (on all JDK versions).</p> * * <p>In addition, the pattern {@code 'ZZ'} has been made to represent * ISO8601 full format time zones (eg. {@code +08:00} or {@code -11:00}). * This introduces a minor incompatibility with Java 1.4, but at a gain of * useful functionality.</p> * * <p>Javadoc cites for the year pattern: <i>For formatting, if the number of * pattern letters is 2, the year is truncated to 2 digits; otherwise it is * interpreted as a number.</i> Starting with Java 1.7 a pattern of 'Y' or * 'YYY' will be formatted as '2003', while it was '03' in former Java * versions. FastDatePrinter implements the behavior of Java 7.</p> * * @version $Id: FastDatePrinter.java 1567799 2014-02-12 23:25:58Z sebb $ * @since 3.2 */ public class FastDatePrinter implements DatePrinter, Serializable { // A lot of the speed in this class comes from caching, but some comes // from the special int to StringBuffer conversion. // // The following produces a padded 2 digit number: // buffer.append((char)(value / 10 + '0')); // buffer.append((char)(value % 10 + '0')); // // Note that the fastest append to StringBuffer is a single char (used here). // Note that Integer.toString() is not called, the conversion is simply // taking the value and adding (mathematically) the ASCII value for '0'. // So, don't change this code! It works and is very fast. /** * Required for serialization support. * * @see java.io.Serializable */ private static final long serialVersionUID = 1L; /** * FULL locale dependent date or time style. */ public static final int FULL = DateFormat.FULL; /** * LONG locale dependent date or time style. */ public static final int LONG = DateFormat.LONG; /** * MEDIUM locale dependent date or time style. */ public static final int MEDIUM = DateFormat.MEDIUM; /** * SHORT locale dependent date or time style. */ public static final int SHORT = DateFormat.SHORT; /** * The pattern. */ private final String mPattern; /** * The time zone. */ private final TimeZone mTimeZone; /** * The locale. */ private final Locale mLocale; /** * The parsed rules. */ private transient Rule[] mRules; /** * The estimated maximum length. */ private transient int mMaxLengthEstimate; // Constructor //----------------------------------------------------------------------- /** * <p>Constructs a new FastDatePrinter.</p> * * @param pattern {@link java.text.SimpleDateFormat} compatible pattern * @param timeZone non-null time zone to use * @param locale non-null locale to use * @throws NullPointerException if pattern, timeZone, or locale is null. */ protected FastDatePrinter(final String pattern, final TimeZone timeZone, final Locale locale) { mPattern = pattern; mTimeZone = timeZone; mLocale = locale; init(); } /** * <p>Initializes the instance for first use.</p> */ private void init() { final List<Rule> rulesList = parsePattern(); mRules = rulesList.toArray(new Rule[rulesList.size()]); int len = 0; for (int i = mRules.length; --i >= 0; ) { len += mRules[i].estimateLength(); } mMaxLengthEstimate = len; } // Parse the pattern //----------------------------------------------------------------------- /** * <p>Returns a list of Rules given a pattern.</p> * * @return a {@code List} of Rule objects * @throws IllegalArgumentException if pattern is invalid */ protected List<Rule> parsePattern() { final DateFormatSymbols symbols = new DateFormatSymbols(mLocale); final List<Rule> rules = new ArrayList<Rule>(); final String[] ERAs = symbols.getEras(); final String[] months = symbols.getMonths(); final String[] shortMonths = symbols.getShortMonths(); final String[] weekdays = symbols.getWeekdays(); final String[] shortWeekdays = symbols.getShortWeekdays(); final String[] AmPmStrings = symbols.getAmPmStrings(); final int length = mPattern.length(); final int[] indexRef = new int[1]; for (int i = 0; i < length; i++) { indexRef[0] = i; final String token = parseToken(mPattern, indexRef); i = indexRef[0]; final int tokenLen = token.length(); if (tokenLen == 0) { break; } Rule rule; final char c = token.charAt(0); switch (c) { case 'G': // era designator (text) rule = new TextField(Calendar.ERA, ERAs); break; case 'y': // year (number) if (tokenLen == 2) { rule = TwoDigitYearField.INSTANCE; } else { rule = selectNumberRule(Calendar.YEAR, tokenLen < 4 ? 4 : tokenLen); } break; case 'M': // month in year (text and number) if (tokenLen >= 4) { rule = new TextField(Calendar.MONTH, months); } else if (tokenLen == 3) { rule = new TextField(Calendar.MONTH, shortMonths); } else if (tokenLen == 2) { rule = TwoDigitMonthField.INSTANCE; } else { rule = UnpaddedMonthField.INSTANCE; } break; case 'd': // day in month (number) rule = selectNumberRule(Calendar.DAY_OF_MONTH, tokenLen); break; case 'h': // hour in am/pm (number, 1..12) rule = new TwelveHourField(selectNumberRule(Calendar.HOUR, tokenLen)); break; case 'H': // hour in day (number, 0..23) rule = selectNumberRule(Calendar.HOUR_OF_DAY, tokenLen); break; case 'm': // minute in hour (number) rule = selectNumberRule(Calendar.MINUTE, tokenLen); break; case 's': // second in minute (number) rule = selectNumberRule(Calendar.SECOND, tokenLen); break; case 'S': // millisecond (number) rule = selectNumberRule(Calendar.MILLISECOND, tokenLen); break; case 'E': // day in week (text) rule = new TextField(Calendar.DAY_OF_WEEK, tokenLen < 4 ? shortWeekdays : weekdays); break; case 'D': // day in year (number) rule = selectNumberRule(Calendar.DAY_OF_YEAR, tokenLen); break; case 'F': // day of week in month (number) rule = selectNumberRule(Calendar.DAY_OF_WEEK_IN_MONTH, tokenLen); break; case 'w': // week in year (number) rule = selectNumberRule(Calendar.WEEK_OF_YEAR, tokenLen); break; case 'W': // week in month (number) rule = selectNumberRule(Calendar.WEEK_OF_MONTH, tokenLen); break; case 'a': // am/pm marker (text) rule = new TextField(Calendar.AM_PM, AmPmStrings); break; case 'k': // hour in day (1..24) rule = new TwentyFourHourField(selectNumberRule(Calendar.HOUR_OF_DAY, tokenLen)); break; case 'K': // hour in am/pm (0..11) rule = selectNumberRule(Calendar.HOUR, tokenLen); break; case 'z': // time zone (text) if (tokenLen >= 4) { rule = new TimeZoneNameRule(mTimeZone, mLocale, TimeZone.LONG); } else { rule = new TimeZoneNameRule(mTimeZone, mLocale, TimeZone.SHORT); } break; case 'Z': // time zone (value) if (tokenLen == 1) { rule = TimeZoneNumberRule.INSTANCE_NO_COLON; } else { rule = TimeZoneNumberRule.INSTANCE_COLON; } break; case '\'': // literal text final String sub = token.substring(1); if (sub.length() == 1) { rule = new CharacterLiteral(sub.charAt(0)); } else { rule = new StringLiteral(sub); } break; default: throw new IllegalArgumentException("Illegal pattern component: " + token); } rules.add(rule); } return rules; } /** * <p>Performs the parsing of tokens.</p> * * @param pattern the pattern * @param indexRef index references * @return parsed token */ protected String parseToken(final String pattern, final int[] indexRef) { final StringBuilder buf = new StringBuilder(); int i = indexRef[0]; final int length = pattern.length(); char c = pattern.charAt(i); if (c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z') { // Scan a run of the same character, which indicates a time // pattern. buf.append(c); while (i + 1 < length) { final char peek = pattern.charAt(i + 1); if (peek == c) { buf.append(c); i++; } else { break; } } } else { // This will identify token as text. buf.append('\''); boolean inLiteral = false; for (; i < length; i++) { c = pattern.charAt(i); if (c == '\'') { if (i + 1 < length && pattern.charAt(i + 1) == '\'') { // '' is treated as escaped ' i++; buf.append(c); } else { inLiteral = !inLiteral; } } else if (!inLiteral && (c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z')) { i--; break; } else { buf.append(c); } } } indexRef[0] = i; return buf.toString(); } /** * <p>Gets an appropriate rule for the padding required.</p> * * @param field the field to get a rule for * @param padding the padding required * @return a new rule with the correct padding */ protected NumberRule selectNumberRule(final int field, final int padding) { switch (padding) { case 1: return new UnpaddedNumberField(field); case 2: return new TwoDigitNumberField(field); default: return new PaddedNumberField(field, padding); } } // Format methods //----------------------------------------------------------------------- /** * <p>Formats a {@code Date}, {@code Calendar} or * {@code Long} (milliseconds) object.</p> * * @param obj the object to format * @param toAppendTo the buffer to append to * @param pos the position - ignored * @return the buffer passed in */ @Override public StringBuffer format(final Object obj, final StringBuffer toAppendTo, final FieldPosition pos) { if (obj instanceof Date) { return format((Date) obj, toAppendTo); } else if (obj instanceof Calendar) { return format((Calendar) obj, toAppendTo); } else if (obj instanceof Long) { return format(((Long) obj).longValue(), toAppendTo); } else { throw new IllegalArgumentException("Unknown class: " + (obj == null ? "<null>" : obj.getClass().getName())); } } /* (non-Javadoc) * @see org.apache.commons.lang3.time.DatePrinter#format(long) */ @Override public String format(final long millis) { final Calendar c = newCalendar(); // hard code GregorianCalendar c.setTimeInMillis(millis); return applyRulesToString(c); } /** * Creates a String representation of the given Calendar by applying the rules of this printer to it. * * @param c the Calender to apply the rules to. * @return a String representation of the given Calendar. */ private String applyRulesToString(final Calendar c) { return applyRules(c, new StringBuffer(mMaxLengthEstimate)).toString(); } /** * Creation method for ne calender instances. * * @return a new Calendar instance. */ private GregorianCalendar newCalendar() { // hard code GregorianCalendar return new GregorianCalendar(mTimeZone, mLocale); } /* (non-Javadoc) * @see org.apache.commons.lang3.time.DatePrinter#format(java.util.Date) */ @Override public String format(final Date date) { final Calendar c = newCalendar(); // hard code GregorianCalendar c.setTime(date); return applyRulesToString(c); } /* (non-Javadoc) * @see org.apache.commons.lang3.time.DatePrinter#format(java.util.Calendar) */ @Override public String format(final Calendar calendar) { return format(calendar, new StringBuffer(mMaxLengthEstimate)).toString(); } /* (non-Javadoc) * @see org.apache.commons.lang3.time.DatePrinter#format(long, java.lang.StringBuffer) */ @Override public StringBuffer format(final long millis, final StringBuffer buf) { return format(new Date(millis), buf); } /* (non-Javadoc) * @see org.apache.commons.lang3.time.DatePrinter#format(java.util.Date, java.lang.StringBuffer) */ @Override public StringBuffer format(final Date date, final StringBuffer buf) { final Calendar c = newCalendar(); // hard code GregorianCalendar c.setTime(date); return applyRules(c, buf); } /* (non-Javadoc) * @see org.apache.commons.lang3.time.DatePrinter#format(java.util.Calendar, java.lang.StringBuffer) */ @Override public StringBuffer format(final Calendar calendar, final StringBuffer buf) { return applyRules(calendar, buf); } /** * <p>Performs the formatting by applying the rules to the * specified calendar.</p> * * @param calendar the calendar to format * @param buf the buffer to format into * @return the specified string buffer */ protected StringBuffer applyRules(final Calendar calendar, final StringBuffer buf) { for (final Rule rule : mRules) { rule.appendTo(buf, calendar); } return buf; } // Accessors //----------------------------------------------------------------------- /* (non-Javadoc) * @see org.apache.commons.lang3.time.DatePrinter#getPattern() */ @Override public String getPattern() { return mPattern; } /* (non-Javadoc) * @see org.apache.commons.lang3.time.DatePrinter#getTimeZone() */ @Override public TimeZone getTimeZone() { return mTimeZone; } /* (non-Javadoc) * @see org.apache.commons.lang3.time.DatePrinter#getLocale() */ @Override public Locale getLocale() { return mLocale; } /** * <p>Gets an estimate for the maximum string length that the * formatter will produce.</p> * <p/> * <p>The actual formatted length will almost always be less than or * equal to this amount.</p> * * @return the maximum formatted length */ public int getMaxLengthEstimate() { return mMaxLengthEstimate; } // Basics //----------------------------------------------------------------------- /** * <p>Compares two objects for equality.</p> * * @param obj the object to compare to * @return {@code true} if equal */ @Override public boolean equals(final Object obj) { if (!(obj instanceof FastDatePrinter)) { return false; } final FastDatePrinter other = (FastDatePrinter) obj; return mPattern.equals(other.mPattern) && mTimeZone.equals(other.mTimeZone) && mLocale.equals(other.mLocale); } /** * <p>Returns a hashcode compatible with equals.</p> * * @return a hashcode compatible with equals */ @Override public int hashCode() { return mPattern.hashCode() + 13 * (mTimeZone.hashCode() + 13 * mLocale.hashCode()); } /** * <p>Gets a debugging string version of this formatter.</p> * * @return a debugging string */ @Override public String toString() { return "FastDatePrinter[" + mPattern + "," + mLocale + "," + mTimeZone.getID() + "]"; } // Serializing //----------------------------------------------------------------------- /** * Create the object after serialization. This implementation reinitializes the * transient properties. * * @param in ObjectInputStream from which the object is being deserialized. * @throws IOException if there is an IO issue. * @throws ClassNotFoundException if a class cannot be found. */ private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); init(); } // Rules //----------------------------------------------------------------------- /** * <p>Inner class defining a rule.</p> */ private interface Rule { /** * Returns the estimated lentgh of the result. * * @return the estimated length */ int estimateLength(); /** * Appends the value of the specified calendar to the output buffer based on the rule implementation. * * @param buffer the output buffer * @param calendar calendar to be appended */ void appendTo(StringBuffer buffer, Calendar calendar); } /** * <p>Inner class defining a numeric rule.</p> */ private interface NumberRule extends Rule { /** * Appends the specified value to the output buffer based on the rule implementation. * * @param buffer the output buffer * @param value the value to be appended */ void appendTo(StringBuffer buffer, int value); } /** * <p>Inner class to output a constant single character.</p> */ private static class CharacterLiteral implements Rule { private final char mValue; /** * Constructs a new instance of {@code CharacterLiteral} * to hold the specified value. * * @param value the character literal */ CharacterLiteral(final char value) { mValue = value; } /** * {@inheritDoc} */ @Override public int estimateLength() { return 1; } /** * {@inheritDoc} */ @Override public void appendTo(final StringBuffer buffer, final Calendar calendar) { buffer.append(mValue); } } /** * <p>Inner class to output a constant string.</p> */ private static class StringLiteral implements Rule { private final String mValue; /** * Constructs a new instance of {@code StringLiteral} * to hold the specified value. * * @param value the string literal */ StringLiteral(final String value) { mValue = value; } /** * {@inheritDoc} */ @Override public int estimateLength() { return mValue.length(); } /** * {@inheritDoc} */ @Override public void appendTo(final StringBuffer buffer, final Calendar calendar) { buffer.append(mValue); } } /** * <p>Inner class to output one of a set of values.</p> */ private static class TextField implements Rule { private final int mField; private final String[] mValues; /** * Constructs an instance of {@code TextField} * with the specified field and values. * * @param field the field * @param values the field values */ TextField(final int field, final String[] values) { mField = field; mValues = values; } /** * {@inheritDoc} */ @Override public int estimateLength() { int max = 0; for (int i = mValues.length; --i >= 0; ) { final int len = mValues[i].length(); if (len > max) { max = len; } } return max; } /** * {@inheritDoc} */ @Override public void appendTo(final StringBuffer buffer, final Calendar calendar) { buffer.append(mValues[calendar.get(mField)]); } } /** * <p>Inner class to output an unpadded number.</p> */ private static class UnpaddedNumberField implements NumberRule { private final int mField; /** * Constructs an instance of {@code UnpadedNumberField} with the specified field. * * @param field the field */ UnpaddedNumberField(final int field) { mField = field; } /** * {@inheritDoc} */ @Override public int estimateLength() { return 4; } /** * {@inheritDoc} */ @Override public void appendTo(final StringBuffer buffer, final Calendar calendar) { appendTo(buffer, calendar.get(mField)); } /** * {@inheritDoc} */ @Override public final void appendTo(final StringBuffer buffer, final int value) { if (value < 10) { buffer.append((char) (value + '0')); } else if (value < 100) { buffer.append((char) (value / 10 + '0')); buffer.append((char) (value % 10 + '0')); } else { buffer.append(Integer.toString(value)); } } } /** * <p>Inner class to output an unpadded month.</p> */ private static class UnpaddedMonthField implements NumberRule { static final UnpaddedMonthField INSTANCE = new UnpaddedMonthField(); /** * Constructs an instance of {@code UnpaddedMonthField}. */ UnpaddedMonthField() { super(); } /** * {@inheritDoc} */ @Override public int estimateLength() { return 2; } /** * {@inheritDoc} */ @Override public void appendTo(final StringBuffer buffer, final Calendar calendar) { appendTo(buffer, calendar.get(Calendar.MONTH) + 1); } /** * {@inheritDoc} */ @Override public final void appendTo(final StringBuffer buffer, final int value) { if (value < 10) { buffer.append((char) (value + '0')); } else { buffer.append((char) (value / 10 + '0')); buffer.append((char) (value % 10 + '0')); } } } /** * <p>Inner class to output a padded number.</p> */ private static class PaddedNumberField implements NumberRule { private final int mField; private final int mSize; /** * Constructs an instance of {@code PaddedNumberField}. * * @param field the field * @param size size of the output field */ PaddedNumberField(final int field, final int size) { if (size < 3) { // Should use UnpaddedNumberField or TwoDigitNumberField. throw new IllegalArgumentException(); } mField = field; mSize = size; } /** * {@inheritDoc} */ @Override public int estimateLength() { return 4; } /** * {@inheritDoc} */ @Override public void appendTo(final StringBuffer buffer, final Calendar calendar) { appendTo(buffer, calendar.get(mField)); } /** * {@inheritDoc} */ @Override public final void appendTo(final StringBuffer buffer, final int value) { if (value < 100) { for (int i = mSize; --i >= 2; ) { buffer.append('0'); } buffer.append((char) (value / 10 + '0')); buffer.append((char) (value % 10 + '0')); } else { int digits; if (value < 1000) { digits = 3; } else { digits = Integer.toString(value).length(); } for (int i = mSize; --i >= digits; ) { buffer.append('0'); } buffer.append(Integer.toString(value)); } } } /** * <p>Inner class to output a two digit number.</p> */ private static class TwoDigitNumberField implements NumberRule { private final int mField; /** * Constructs an instance of {@code TwoDigitNumberField} with the specified field. * * @param field the field */ TwoDigitNumberField(final int field) { mField = field; } /** * {@inheritDoc} */ @Override public int estimateLength() { return 2; } /** * {@inheritDoc} */ @Override public void appendTo(final StringBuffer buffer, final Calendar calendar) { appendTo(buffer, calendar.get(mField)); } /** * {@inheritDoc} */ @Override public final void appendTo(final StringBuffer buffer, final int value) { if (value < 100) { buffer.append((char) (value / 10 + '0')); buffer.append((char) (value % 10 + '0')); } else { buffer.append(Integer.toString(value)); } } } /** * <p>Inner class to output a two digit year.</p> */ private static class TwoDigitYearField implements NumberRule { static final TwoDigitYearField INSTANCE = new TwoDigitYearField(); /** * Constructs an instance of {@code TwoDigitYearField}. */ TwoDigitYearField() { super(); } /** * {@inheritDoc} */ @Override public int estimateLength() { return 2; } /** * {@inheritDoc} */ @Override public void appendTo(final StringBuffer buffer, final Calendar calendar) { appendTo(buffer, calendar.get(Calendar.YEAR) % 100); } /** * {@inheritDoc} */ @Override public final void appendTo(final StringBuffer buffer, final int value) { buffer.append((char) (value / 10 + '0')); buffer.append((char) (value % 10 + '0')); } } /** * <p>Inner class to output a two digit month.</p> */ private static class TwoDigitMonthField implements NumberRule { static final TwoDigitMonthField INSTANCE = new TwoDigitMonthField(); /** * Constructs an instance of {@code TwoDigitMonthField}. */ TwoDigitMonthField() { super(); } /** * {@inheritDoc} */ @Override public int estimateLength() { return 2; } /** * {@inheritDoc} */ @Override public void appendTo(final StringBuffer buffer, final Calendar calendar) { appendTo(buffer, calendar.get(Calendar.MONTH) + 1); } /** * {@inheritDoc} */ @Override public final void appendTo(final StringBuffer buffer, final int value) { buffer.append((char) (value / 10 + '0')); buffer.append((char) (value % 10 + '0')); } } /** * <p>Inner class to output the twelve hour field.</p> */ private static class TwelveHourField implements NumberRule { private final NumberRule mRule; /** * Constructs an instance of {@code TwelveHourField} with the specified * {@code NumberRule}. * * @param rule the rule */ TwelveHourField(final NumberRule rule) { mRule = rule; } /** * {@inheritDoc} */ @Override public int estimateLength() { return mRule.estimateLength(); } /** * {@inheritDoc} */ @Override public void appendTo(final StringBuffer buffer, final Calendar calendar) { int value = calendar.get(Calendar.HOUR); if (value == 0) { value = calendar.getLeastMaximum(Calendar.HOUR) + 1; } mRule.appendTo(buffer, value); } /** * {@inheritDoc} */ @Override public void appendTo(final StringBuffer buffer, final int value) { mRule.appendTo(buffer, value); } } /** * <p>Inner class to output the twenty four hour field.</p> */ private static class TwentyFourHourField implements NumberRule { private final NumberRule mRule; /** * Constructs an instance of {@code TwentyFourHourField} with the specified * {@code NumberRule}. * * @param rule the rule */ TwentyFourHourField(final NumberRule rule) { mRule = rule; } /** * {@inheritDoc} */ @Override public int estimateLength() { return mRule.estimateLength(); } /** * {@inheritDoc} */ @Override public void appendTo(final StringBuffer buffer, final Calendar calendar) { int value = calendar.get(Calendar.HOUR_OF_DAY); if (value == 0) { value = calendar.getMaximum(Calendar.HOUR_OF_DAY) + 1; } mRule.appendTo(buffer, value); } /** * {@inheritDoc} */ @Override public void appendTo(final StringBuffer buffer, final int value) { mRule.appendTo(buffer, value); } } //----------------------------------------------------------------------- private static final ConcurrentMap<TimeZoneDisplayKey, String> cTimeZoneDisplayCache = new ConcurrentHashMap<TimeZoneDisplayKey, String>(7); /** * <p>Gets the time zone display name, using a cache for performance.</p> * * @param tz the zone to query * @param daylight true if daylight savings * @param style the style to use {@code TimeZone.LONG} or {@code TimeZone.SHORT} * @param locale the locale to use * @return the textual name of the time zone */ static String getTimeZoneDisplay(final TimeZone tz, final boolean daylight, final int style, final Locale locale) { final TimeZoneDisplayKey key = new TimeZoneDisplayKey(tz, daylight, style, locale); String value = cTimeZoneDisplayCache.get(key); if (value == null) { // This is a very slow call, so cache the results. value = tz.getDisplayName(daylight, style, locale); final String prior = cTimeZoneDisplayCache.putIfAbsent(key, value); if (prior != null) { value = prior; } } return value; } /** * <p>Inner class to output a time zone name.</p> */ private static class TimeZoneNameRule implements Rule { private final Locale mLocale; private final int mStyle; private final String mStandard; private final String mDaylight; /** * Constructs an instance of {@code TimeZoneNameRule} with the specified properties. * * @param timeZone the time zone * @param locale the locale * @param style the style */ TimeZoneNameRule(final TimeZone timeZone, final Locale locale, final int style) { mLocale = locale; mStyle = style; mStandard = getTimeZoneDisplay(timeZone, false, style, locale); mDaylight = getTimeZoneDisplay(timeZone, true, style, locale); } /** * {@inheritDoc} */ @Override public int estimateLength() { // We have no access to the Calendar object that will be passed to // appendTo so base estimate on the TimeZone passed to the // constructor return Math.max(mStandard.length(), mDaylight.length()); } /** * {@inheritDoc} */ @Override public void appendTo(final StringBuffer buffer, final Calendar calendar) { final TimeZone zone = calendar.getTimeZone(); if (zone.useDaylightTime() && calendar.get(Calendar.DST_OFFSET) != 0) { buffer.append(getTimeZoneDisplay(zone, true, mStyle, mLocale)); } else { buffer.append(getTimeZoneDisplay(zone, false, mStyle, mLocale)); } } } /** * <p>Inner class to output a time zone as a number {@code +/-HHMM} * or {@code +/-HH:MM}.</p> */ private static class TimeZoneNumberRule implements Rule { static final TimeZoneNumberRule INSTANCE_COLON = new TimeZoneNumberRule(true); static final TimeZoneNumberRule INSTANCE_NO_COLON = new TimeZoneNumberRule(false); final boolean mColon; /** * Constructs an instance of {@code TimeZoneNumberRule} with the specified properties. * * @param colon add colon between HH and MM in the output if {@code true} */ TimeZoneNumberRule(final boolean colon) { mColon = colon; } /** * {@inheritDoc} */ @Override public int estimateLength() { return 5; } /** * {@inheritDoc} */ @Override public void appendTo(final StringBuffer buffer, final Calendar calendar) { int offset = calendar.get(Calendar.ZONE_OFFSET) + calendar.get(Calendar.DST_OFFSET); if (offset < 0) { buffer.append('-'); offset = -offset; } else { buffer.append('+'); } final int hours = offset / (60 * 60 * 1000); buffer.append((char) (hours / 10 + '0')); buffer.append((char) (hours % 10 + '0')); if (mColon) { buffer.append(':'); } final int minutes = offset / (60 * 1000) - 60 * hours; buffer.append((char) (minutes / 10 + '0')); buffer.append((char) (minutes % 10 + '0')); } } // ---------------------------------------------------------------------- /** * <p>Inner class that acts as a compound key for time zone names.</p> */ private static class TimeZoneDisplayKey { private final TimeZone mTimeZone; private final int mStyle; private final Locale mLocale; /** * Constructs an instance of {@code TimeZoneDisplayKey} with the specified properties. * * @param timeZone the time zone * @param daylight adjust the style for daylight saving time if {@code true} * @param style the timezone style * @param locale the timezone locale */ TimeZoneDisplayKey(final TimeZone timeZone, final boolean daylight, final int style, final Locale locale) { mTimeZone = timeZone; if (daylight) { mStyle = style | 0x80000000; } else { mStyle = style; } mLocale = locale; } /** * {@inheritDoc} */ @Override public int hashCode() { return (mStyle * 31 + mLocale.hashCode()) * 31 + mTimeZone.hashCode(); } /** * {@inheritDoc} */ @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj instanceof TimeZoneDisplayKey) { final TimeZoneDisplayKey other = (TimeZoneDisplayKey) obj; return mTimeZone.equals(other.mTimeZone) && mStyle == other.mStyle && mLocale.equals(other.mLocale); } return false; } } }
gpl-2.0
noparking/alticcio
core/exemples/dico/dico_exemple.php
549
<?php require "../../outils/dico.php"; $dico = new Dico("en_UK"); $dico->add("traductions"); header('Content-Type: text/html; charset=utf-8'); ?> <html> <head> <style> span.untranslated-term { color: red; } span.default-term { color: green; } </style> </head> <body> <?php echo "<p>".$dico->t("HelloWorld")."</p>\n"; echo "<p>".$dico->t("Bonjour le monde !!!")."</p>\n"; echo "<p>".$dico->t("PhraseDefault")."</p>\n"; echo "<p>".$dico->t("Phrase par défault")."</p>\n"; echo "<p>".$dico->t("Phrase non traduite")."</p>\n"; ?> </body> </html>
gpl-2.0
teamfx/openjfx-8u-dev-rt
modules/web/src/main/native/Source/WebCore/bindings/java/dom3/JavaHTMLMapElement.cpp
2347
/* * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ #undef IMPL #include "config.h" #include <WebCore/HTMLCollection.h> #include <WebCore/HTMLMapElement.h> #include <WebCore/HTMLNames.h> #include <WebCore/JSMainThreadExecState.h> #include <wtf/RefPtr.h> #include <wtf/GetPtr.h> #include "JavaDOMUtils.h" #include <wtf/java/JavaEnv.h> using namespace WebCore; extern "C" { #define IMPL (static_cast<HTMLMapElement*>(jlong_to_ptr(peer))) // Attributes JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_HTMLMapElementImpl_getAreasImpl(JNIEnv* env, jclass, jlong peer) { WebCore::JSMainThreadNullState state; return JavaReturn<HTMLCollection>(env, WTF::getPtr(IMPL->areas())); } JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_HTMLMapElementImpl_getNameImpl(JNIEnv* env, jclass, jlong peer) { WebCore::JSMainThreadNullState state; return JavaReturn<String>(env, IMPL->getNameAttribute()); } JNIEXPORT void JNICALL Java_com_sun_webkit_dom_HTMLMapElementImpl_setNameImpl(JNIEnv* env, jclass, jlong peer, jstring value) { WebCore::JSMainThreadNullState state; IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::nameAttr, String(env, value)); } }
gpl-2.0
cuongnd/test_pro
administrator/components/com_easysocial/includes/stream/template.php
7663
<?php /** * @package EasySocial * @copyright Copyright (C) 2010 - 2012 Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * EasySocial is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ defined( '_JEXEC' ) or die( 'Unauthorized Access' ); /** * Stream data template. * Example: * * <code> * </code> * * @since */ class SocialStreamTemplate extends JObject { /** * The actor's id. (Example 42 ) * @var int * mantadory field */ public $actor_id = null; /** * The unique actor type (Example: user, group , photos) * @var int * optional - default to user */ public $actor_type = ''; /** * the content type id of this item. ( Example, album, status, photos, group and etc) * @var int * mantadory field */ public $context_id = null; /** * the content type of this item. ( Example, album, status, photos, group and etc) * @var string * mantadory field */ public $context_type = null; /** * the stream type. ( full or mini ) * @var string * opstional - default to full */ public $stream_type = null; /** * the action for the context ( example, add, update and etc ) * @var string * mantadory field */ public $verb = null; /** * the id of which the context object associate with. ( E.g album id, when the context is a photo type. Add photo in album xxx ) * @var int * optional - default to 0 */ public $target_id = 0; /** * Stream title which is optional. * @var string * optional */ public $title = null; /** * Stream content which is option. (Example: $1 something) * @var string * optional */ public $content = null; /** * @var int * system uses */ public $uid = 0; /** * creation date * @var mysql date * system use */ public $created = null; /* * to determine if the stream is a sitewide * @var boolean * system use */ public $sitewide = null; /** * If this stream is posted with a location, store the location id. * @var int */ public $location_id = null; /** * If this stream is posted with their friends store in json string. * @var string */ public $with = null; /** * to indicate this stream item should aggregate or not. */ public $isAggregate = null; /** * to indicate this stream should be a public stream or not. */ public $isPublic = null; /** * if this stream is posted with params */ public $params = null; /** * if context item is posted with params */ public $item_params = null; /** * this childs is to aggreate items of same type ONLY in within one stream. * the requirement is to off isAggregate flag. else it will ignore this property. */ public $childs = null; /** * Class Constructor. * * @since 1.0 * @access public * @param string * @return */ public function __construct() { // Set the creation date to the current time. $date = Foundry::date(); $this->created = $date->toMySQL(); $this->sitewide = '0'; $this->isAggregate = false; $this->isPublic = 0; $this->childs = array(); } /** * * @since 1.0 * @access public * @param title string ( optional ) * @return null */ public function setTitle( $title ) { $this->title = $title; } /** * * @since 1.0 * @access public * @param content string ( optional ) * @return null */ public function setContent( $content ) { $this->content = $content; } /** * Sets the actor object. * * @since 1.0 * @access public * @param int The actor's id. * @param string The actor's type. */ public function setActor( $id , $type ) { // Set actors id $this->actor_id = $id; // Set actors type $this->actor_type = $type; } /** * Sets the context of this stream * * @since 1.0 * @access public * @param int The context id. * @param string The context type. */ public function setContext( $id , $type, $params = null ) { // Set the context id. $this->context_id = $id; // Set the context type. $this->context_type = $type; if( $params ) { if(! is_string( $params ) ) { $this->item_params = Foundry::json()->encode( $params ); } else { $this->item_params = $params; } } } /** * Sets the verb of the stream item. * * @since 1.0 * @access public * @param string The verb */ public function setVerb( $verb ) { // Set the verb property. $this->verb = $verb; } /** * Sets the target id. * * @since 1.0 * @access public * @param int The target id */ public function setTarget( $id ) { $this->target_id = $id; } /** * Sets the stream location * * @since 1.0 * @access public * @param string * @return */ public function setLocation( $location = null ) { if( !is_null( $location ) && is_object( $location ) ) { $this->location_id = $location->id; } } /** * Sets the users in the stream * * @since 1.0 * @access public * @param string * @return */ public function setWith( $ids = '' ) { // if( is_array( $ids ) ) // { // $ids = Foundry::makeJSON( $ids ); // } $this->with = $ids; } /** * Sets the stream type. * * @since 1.0 * @access public * @param int The target id */ public function setType( $type = 'full' ) { $this->stream_type = $type; } public function setSiteWide( $isSideWide = true ) { $this->sitewide = $isSideWide; } public function setAggregate( $aggregate = true ) { // when this is true, it will aggregate based on current context and verb. $this->isAggregate = $aggregate; } public function setDate( $mySQLdate ) { $this->created = $mySQLdate; } public function setPublicStream( $keys, $privacy = null ) { if( $this->actor_type == SOCIAL_STREAM_ACTOR_TYPE_USER ) { if(! is_null( $privacy ) && $privacy == SOCIAL_PRIVACY_PUBLIC ) { $this->isPublic = 1; } else { // we need to test the user privacy for this rule. $rules = explode( '.', $keys ); $key = array_shift( $rules ); $rule = implode( '.', $rules ); $privacyLib = Foundry::privacy( $this->actor_id ); $targetValue = $privacyLib->getValue( $key, $rule ); if( is_array( $targetValue ) ) { $$privacy = $targetValue[0]; } else { $privacy = $targetValue; } if( $privacy == SOCIAL_PRIVACY_PUBLIC ) { $this->isPublic = 1; } } } } /** * Sets the stream params * * @since 1.0 * @access public * @param json string only! * @return */ public function setParams( $params ) { if( ! $params ) return; if(! is_string( $params ) ) { $this->params = Foundry::json()->encode( $params ); } else { $this->params = $params; } } /* * This functin allow user to aggreate items of same type ONLY in within one stream. * when there are child items, the isAggreate will be off by default when processing streams aggregation. * E.g. of when this function take action: * Imagine if you wanna agreate photos activity logs for one single stream but DO NOT wish to aggregate with other photos stream. * If that is the case, then you will need to use this function so that stream lib will only aggreate the photos items in this single stream. */ public function setChild( $contextId ) { if( $contextId ) { $this->childs[] = $contextId; } } }
gpl-2.0
mhamed/wordtosay
sites/all/libraries/leaflet/Leaflet/src/core/Util.js
5034
/* * L.Util contains various utility functions used throughout Leaflet code. */ L.Util = { // extend an object with properties of one or more other objects extend: function (dest) { var i, j, len, src; for (j = 1, len = arguments.length; j < len; j++) { src = arguments[j]; for (i in src) { dest[i] = src[i]; } } return dest; }, // create an object from a given prototype create: Object.create || (function () { function F() {} return function (proto) { F.prototype = proto; return new F(); }; })(), // bind a function to be called with a given context bind: function (fn, obj) { var slice = Array.prototype.slice; if (fn.bind) { return fn.bind.apply(fn, slice.call(arguments, 1)); } var args = slice.call(arguments, 2); return function () { return fn.apply(obj, args.length ? args.concat(slice.call(arguments)) : arguments); }; }, // return unique ID of an object stamp: function (obj) { /*eslint-disable */ obj._leaflet_id = obj._leaflet_id || ++L.Util.lastId; return obj._leaflet_id; /*eslint-enable */ }, lastId: 0, // return a function that won't be called more often than the given interval throttle: function (fn, time, context) { var lock, args, wrapperFn, later; later = function () { // reset lock and call if queued lock = false; if (args) { wrapperFn.apply(context, args); args = false; } }; wrapperFn = function () { if (lock) { // called too soon, queue to call later args = arguments; } else { // call and lock until later fn.apply(context, arguments); setTimeout(later, time); lock = true; } }; return wrapperFn; }, // wrap the given number to lie within a certain range (used for wrapping longitude) wrapNum: function (x, range, includeMax) { var max = range[1], min = range[0], d = max - min; return x === max && includeMax ? x : ((x - min) % d + d) % d + min; }, // do nothing (used as a noop throughout the code) falseFn: function () { return false; }, // round a given number to a given precision formatNum: function (num, digits) { var pow = Math.pow(10, digits || 5); return Math.round(num * pow) / pow; }, // trim whitespace from both sides of a string trim: function (str) { return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); }, // split a string into words splitWords: function (str) { return L.Util.trim(str).split(/\s+/); }, // set options to an object, inheriting parent's options as well setOptions: function (obj, options) { if (!obj.hasOwnProperty('options')) { obj.options = obj.options ? L.Util.create(obj.options) : {}; } for (var i in options) { obj.options[i] = options[i]; } return obj.options; }, // make a URL with GET parameters out of a set of properties/values getParamString: function (obj, existingUrl, uppercase) { var params = []; for (var i in obj) { params.push(encodeURIComponent(uppercase ? i.toUpperCase() : i) + '=' + encodeURIComponent(obj[i])); } return ((!existingUrl || existingUrl.indexOf('?') === -1) ? '?' : '&') + params.join('&'); }, // super-simple templating facility, used for TileLayer URLs template: function (str, data) { return str.replace(L.Util.templateRe, function (str, key) { var value = data[key]; if (value === undefined) { throw new Error('No value provided for variable ' + str); } else if (typeof value === 'function') { value = value(data); } return value; }); }, templateRe: /\{ *([\w_]+) *\}/g, isArray: Array.isArray || function (obj) { return (Object.prototype.toString.call(obj) === '[object Array]'); }, // minimal image URI, set to an image when disposing to flush memory emptyImageUrl: 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=' }; (function () { // inspired by http://paulirish.com/2011/requestanimationframe-for-smart-animating/ function getPrefixed(name) { return window['webkit' + name] || window['moz' + name] || window['ms' + name]; } var lastTime = 0; // fallback for IE 7-8 function timeoutDefer(fn) { var time = +new Date(), timeToCall = Math.max(0, 16 - (time - lastTime)); lastTime = time + timeToCall; return window.setTimeout(fn, timeToCall); } var requestFn = window.requestAnimationFrame || getPrefixed('RequestAnimationFrame') || timeoutDefer, cancelFn = window.cancelAnimationFrame || getPrefixed('CancelAnimationFrame') || getPrefixed('CancelRequestAnimationFrame') || function (id) { window.clearTimeout(id); }; L.Util.requestAnimFrame = function (fn, context, immediate) { if (immediate && requestFn === timeoutDefer) { fn.call(context); } else { return requestFn.call(window, L.bind(fn, context)); } }; L.Util.cancelAnimFrame = function (id) { if (id) { cancelFn.call(window, id); } }; })(); // shortcuts for most used utility functions L.extend = L.Util.extend; L.bind = L.Util.bind; L.stamp = L.Util.stamp; L.setOptions = L.Util.setOptions;
gpl-2.0
acassis/lintouch
lintouch/src/template-libraries/ltl-input/src/Slider.hh
2611
// $Id: Slider.hh 1168 2005-12-12 14:48:03Z modesto $ // // FILE: Slider.hh -- // AUTHOR: patrik <patrik@modesto.cz> // DATE: 04 November 2004 // // Copyright (c) 2001-2006 S.W.A.C. GmbH, Germany. // Copyright (c) 2001-2006 S.W.A.C. Bohemia s.r.o., Czech Republic. // // THIS SOFTWARE IS DISTRIBUTED AS IS AND WITHOUT ANY WARRANTY. // // This application is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License as published // by the Free Software Foundation; either version 2 of the License, or (at // your option) any later version. // // This application is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details. // // You should have received a copy of the GNU General Public // License along with this application; if not, write to the // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. #ifndef _SLIDER_HH #define _SLIDER_HH #include "lt/templates/Template.hh" /** * Slider * * \author Patrik Modesto <modesto@swac.cz> */ class Slider : public Template { public: /** * Constructor. */ Slider( LoggerPtr logger = Logger::nullPtr() ); /** * Destructor. */ virtual ~Slider(); protected: virtual void drawShape( QPainter & ); public: virtual QWidget::FocusPolicy focusPolicy() const; virtual void mousePressEvent( QMouseEvent * e ); virtual void mouseReleaseEvent( QMouseEvent * e ); virtual void mouseMoveEvent( QMouseEvent * e ); virtual void mouseDoubleClickEvent( QMouseEvent * e ); virtual void keyPressEvent( QKeyEvent * ); virtual void setRect( const QRect & rect ); virtual void propertiesChanged(); virtual void iopinsChanged(); virtual QPointArray areaPoints() const; virtual QRegion collisionRegion() const; virtual void setVisible( bool visible ); virtual void setCanvas( QCanvas * c ); virtual void advance( int phase ); virtual void localize( LocalizatorPtr loc ); virtual Template * clone( const LocalizatorPtr & loc, const TemplateManager & tm, LoggerPtr logger = Logger::nullPtr() ) const; virtual void focusInEvent ( QFocusEvent * ); virtual void focusOutEvent ( QFocusEvent * ); private: struct SliderPrivate; SliderPrivate* d; }; #endif /* _SLIDER_HH */ // vim: set et ts=4 sw=4 tw=76: // $Id: Slider.hh 1168 2005-12-12 14:48:03Z modesto $
gpl-2.0
espenak/enkel
enkel/wansgli/cgigateway.py
1903
# This file is part of the Enkel web programming library. # # Copyright (C) 2007 Espen Angell Kristiansen (espen@wsgi.net) # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. """ WSGI cgi gateway. """ from os import environ import sys from apprunner import Response, run_app def cgi_app_runner(app): """ Runs "app" in a CGI environment. CGI example script ================== >>> import cgitb; cgitb.enable() >>> import sys >>> from enkel.wansgli.cgigateway import cgi_app_runner >>> from enkel.wansgli.demo_apps import simple_app >>> cgi_app_runner(simple_app) Put the above in a executable python script, and run it using a cgi server. @note: This code is almost a copy of the CGI gateway example in PEP 333. It will be replaced by a more powerfull class that supports logging ++ in the future. @param app: A WSGI app. """ env = dict(environ.items()) env['wsgi.input'] = sys.stdin env['wsgi.errors'] = sys.stderr env['wsgi.version'] = (1,0) env['wsgi.multithread'] = False env['wsgi.multiprocess'] = True env['wsgi.run_once'] = True if env.get('HTTPS','off') in ('on','1'): env['wsgi.url_scheme'] = 'https' else: env['wsgi.url_scheme'] = 'http' req = Response(sys.stdout, env) run_app(app, req)
gpl-2.0
naka211/domus
components/com_booking/views/bookings/tmpl/default.php
6553
<?php /** * @version 1.0.0 * @package com_booking * @copyright Copyright (C) 2015. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * @author Nguyen Thanh Trung <nttrung211@yahoo.com> - */ // no direct access defined('_JEXEC') or die; JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); JHtml::_('bootstrap.tooltip'); JHtml::_('behavior.multiselect'); JHtml::_('formbehavior.chosen', 'select'); $user = JFactory::getUser(); $userId = $user->get('id'); $listOrder = $this->state->get('list.ordering'); $listDirn = $this->state->get('list.direction'); $canCreate = $user->authorise('core.create', 'com_booking'); $canEdit = $user->authorise('core.edit', 'com_booking'); $canCheckin = $user->authorise('core.manage', 'com_booking'); $canChange = $user->authorise('core.edit.state', 'com_booking'); $canDelete = $user->authorise('core.delete', 'com_booking'); ?> <form action="<?php echo JRoute::_('index.php?option=com_booking&view=bookings'); ?>" method="post" name="adminForm" id="adminForm"> <?php echo JLayoutHelper::render('default_filter', array('view' => $this), dirname(__FILE__)); ?> <table class="table table-striped" id = "bookingList" > <thead > <tr > <?php if (isset($this->items[0]->state)): ?> <th width="1%" class="nowrap center"> <?php echo JHtml::_('grid.sort', 'JSTATUS', 'a.state', $listDirn, $listOrder); ?> </th> <?php endif; ?> <th class='left'> <?php echo JHtml::_('grid.sort', 'COM_BOOKING_BOOKINGS_SUPPLIER_ID', 'a.supplier_id', $listDirn, $listOrder); ?> </th> <th class='left'> <?php echo JHtml::_('grid.sort', 'COM_BOOKING_BOOKINGS_FIRST_NAME', 'a.first_name', $listDirn, $listOrder); ?> </th> <th class='left'> <?php echo JHtml::_('grid.sort', 'COM_BOOKING_BOOKINGS_LAST_NAME', 'a.last_name', $listDirn, $listOrder); ?> </th> <th class='left'> <?php echo JHtml::_('grid.sort', 'COM_BOOKING_BOOKINGS_CHECKIN', 'a.checkin', $listDirn, $listOrder); ?> </th> <th class='left'> <?php echo JHtml::_('grid.sort', 'COM_BOOKING_BOOKINGS_CHECKOUT', 'a.checkout', $listDirn, $listOrder); ?> </th> <th class='left'> <?php echo JHtml::_('grid.sort', 'COM_BOOKING_BOOKINGS_TOTAL', 'a.total', $listDirn, $listOrder); ?> </th> <th class='left'> <?php echo JHtml::_('grid.sort', 'COM_BOOKING_BOOKINGS_PAY_30', 'a.pay_30', $listDirn, $listOrder); ?> </th> <th class='left'> <?php echo JHtml::_('grid.sort', 'COM_BOOKING_BOOKINGS_PAY_ALL', 'a.pay_all', $listDirn, $listOrder); ?> </th> <?php if (isset($this->items[0]->id)): ?> <th width="1%" class="nowrap center hidden-phone"> <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?> </th> <?php endif; ?> <?php if ($canEdit || $canDelete): ?> <th class="center"> <?php echo JText::_('COM_BOOKING_BOOKINGS_ACTIONS'); ?> </th> <?php endif; ?> </tr> </thead> <tfoot> <tr> <td colspan="<?php echo isset($this->items[0]) ? count(get_object_vars($this->items[0])) : 10; ?>"> <?php echo $this->pagination->getListFooter(); ?> </td> </tr> </tfoot> <tbody> <?php foreach ($this->items as $i => $item) : ?> <?php $canEdit = $user->authorise('core.edit', 'com_booking'); ?> <tr class="row<?php echo $i % 2; ?>"> <?php if (isset($this->items[0]->state)): ?> <?php $class = ($canEdit || $canChange) ? 'active' : 'disabled'; ?> <td class="center"> <a class="btn btn-micro <?php echo $class; ?>" href="<?php echo ($canEdit || $canChange) ? JRoute::_('index.php?option=com_booking&task=booking.publish&id=' . $item->id . '&state=' . (($item->state + 1) % 2), false, 2) : '#'; ?>"> <?php if ($item->state == 1): ?> <i class="icon-publish"></i> <?php else: ?> <i class="icon-unpublish"></i> <?php endif; ?> </a> </td> <?php endif; ?> <td> <?php echo $item->supplier_id; ?> </td> <td> <?php if (isset($item->checked_out) && $item->checked_out) : ?> <?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'bookings.', $canCheckin); ?> <?php endif; ?> <a href="<?php echo JRoute::_('index.php?option=com_booking&view=booking&id='.(int) $item->id); ?>"> <?php echo $this->escape($item->first_name); ?></a> </td> <td> <?php echo $item->last_name; ?> </td> <td> <?php echo $item->checkin; ?> </td> <td> <?php echo $item->checkout; ?> </td> <td> <?php echo $item->total; ?> </td> <td> <?php echo $item->pay_30; ?> </td> <td> <?php echo $item->pay_all; ?> </td> <?php if (isset($this->items[0]->id)): ?> <td class="center hidden-phone"> <?php echo (int)$item->id; ?> </td> <?php endif; ?> <?php if ($canEdit || $canDelete): ?> <td class="center"> </td> <?php endif; ?> </tr> <?php endforeach; ?> </tbody> </table> <?php if ($canCreate): ?> <a href="<?php echo JRoute::_('index.php?option=com_booking&task=bookingform.edit&id=0', false, 2); ?>" class="btn btn-success btn-small"><i class="icon-plus"></i> <?php echo JText::_('COM_BOOKING_ADD_ITEM'); ?></a> <?php endif; ?> <input type="hidden" name="task" value=""/> <input type="hidden" name="boxchecked" value="0"/> <input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>"/> <input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>"/> <?php echo JHtml::_('form.token'); ?> </form> <script type="text/javascript"> jQuery(document).ready(function () { jQuery('.delete-button').click(deleteItem); }); function deleteItem() { var item_id = jQuery(this).attr('data-item-id'); if (confirm("<?php echo JText::_('COM_BOOKING_DELETE_MESSAGE'); ?>")) { window.location.href = '<?php echo JRoute::_('index.php?option=com_booking&task=bookingform.remove&id=', false, 2) ?>' + item_id; } } </script>
gpl-2.0
pavel-pimenov/flylinkdc-r5xx
client/SearchManager.cpp
20848
/* * Copyright (C) 2001-2017 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "stdinc.h" #include "UploadManager.h" #include "ShareManager.h" #include "QueueManager.h" #include "StringTokenizer.h" #include "FinishedManager.h" #include "DebugManager.h" #include "../FlyFeatures/flyServer.h" uint16_t SearchManager::g_search_port = 0; const char* SearchManager::getTypeStr(Search::TypeModes type) { static const char* g_types[Search::TYPE_LAST_MODE] = { CSTRING(ANY), CSTRING(AUDIO), CSTRING(COMPRESSED), CSTRING(DOCUMENT), CSTRING(EXECUTABLE), CSTRING(PICTURE), CSTRING(VIDEO_AND_SUBTITLES), CSTRING(DIRECTORY), "TTH", CSTRING(CD_DVD_IMAGES), CSTRING(COMICS), CSTRING(BOOK), }; return g_types[type]; } SearchManager::SearchManager() { } SearchManager::~SearchManager() { if (socket.get()) { stopThread(); socket->disconnect(); #ifdef _WIN32 join(); #endif } } void SearchManager::runTestUDPPort() { extern bool g_DisableTestPort; if (g_DisableTestPort == false && boost::logic::indeterminate(SettingsManager::g_TestUDPSearchLevel)) { string l_external_ip; std::vector<unsigned short> l_udp_port, l_tcp_port; l_udp_port.push_back(SETTING(UDP_PORT)); bool l_is_udp_port_send = CFlyServerJSON::pushTestPort(l_udp_port, l_tcp_port, l_external_ip, 0, "UDP"); if (l_is_udp_port_send) { SettingsManager::g_UDPTestExternalIP = l_external_ip; } } } void SearchManager::listen() { disconnect(); try { socket.reset(new Socket); socket->create(Socket::TYPE_UDP); socket->setBlocking(true); if (BOOLSETTING(AUTO_DETECT_CONNECTION)) { g_search_port = socket->bind(0, BaseUtil::emptyString); } else { const auto l_ip = SETTING(BIND_ADDRESS); const auto l_port = SETTING(UDP_PORT); g_search_port = socket->bind(static_cast<uint16_t>(l_port), l_ip); } SET_SETTING(UDP_PORT, g_search_port); #ifdef _DEBUG LogManager::message("Start search manager! UDP_PORT = " + Util::toString(g_search_port)); #endif runTestUDPPort(); start(64, "SearchManager"); } catch (...) { socket.reset(); throw; } } void SearchManager::disconnect(bool p_is_stop /*=true */) { if (socket.get()) { stopThread(); m_queue_thread.shutdown(); socket->disconnect(); g_search_port = 0; join(); socket.reset(); stopThread(p_is_stop); } } #define BUFSIZE 8192 int SearchManager::run() { std::unique_ptr<uint8_t[]> buf(new uint8_t[BUFSIZE]); int len; sockaddr_in remoteAddr = { 0 }; m_queue_thread.start(0); while (!isShutdown()) { try { while (!isShutdown()) { // @todo: remove this workaround for http://bugs.winehq.org/show_bug.cgi?id=22291 // if that's fixed by reverting to simpler while (read(...) > 0) {...} code. //if (socket->wait(400, Socket::WAIT_READ) != Socket::WAIT_READ) //{ // continue; // [merge] https://github.com/eiskaltdcpp/eiskaltdcpp/commit/c8dcf444d17fffacb6797d14a57b102d653896d0 //} if (isShutdown() || (len = socket->read(&buf[0], BUFSIZE, remoteAddr)) <= 0) break; const boost::asio::ip::address_v4 l_ip4(ntohl(remoteAddr.sin_addr.S_un.S_addr)); #ifdef _DEBUG const string l_ip1 = l_ip4.to_string(); const string l_ip2 = inet_ntoa(remoteAddr.sin_addr); dcassert(l_ip1 == l_ip2); #endif onData(&buf[0], len, l_ip4); } } catch (const SocketException& e) { dcdebug("SearchManager::run Error: %s\n", e.getError().c_str()); } bool failed = false; while (!isShutdown()) { try { socket->disconnect(); socket->create(Socket::TYPE_UDP); socket->setBlocking(true); dcassert(g_search_port); socket->bind(g_search_port, SETTING(BIND_ADDRESS)); if (failed) { LogManager::message(STRING(SEARCH_ENABLED)); failed = false; } break; } catch (const SocketException& e) { dcdebug("SearchManager::run Stopped listening: %s\n", e.getError().c_str()); if (!failed) { LogManager::message(STRING(SEARCH_DISALED) + ": " + e.getError()); failed = true; } // Spin for 60 seconds for (int i = 0; i < 60 && !isShutdown(); ++i) { sleep(1000); LogManager::message("SearchManager::run() - sleep(1000)"); } } } } return 0; } int SearchManager::UdpQueue::run() { string x; boost::asio::ip::address_v4 remoteIp; m_is_stop = false; while (true) { m_search_semaphore.wait(); if (m_is_stop) break; { CFlyFastLock(m_cs); if (m_resultList.empty()) continue; x = m_resultList.front().first; remoteIp = m_resultList.front().second; m_resultList.pop_front(); } dcassert(x.length() > 4); if (x.length() <= 4) { dcassert(0); continue; } try { if (x.compare(0, 4, "$SR ", 4) == 0) { string::size_type i = 4; string::size_type j; // Directories: $SR <nick><0x20><directory><0x20><free slots>/<total slots><0x05><Hubname><0x20>(<Hubip:port>) // Files: $SR <nick><0x20><filename><0x05><filesize><0x20><free slots>/<total slots><0x05><Hubname><0x20>(<Hubip:port>) if ((j = x.find(' ', i)) == string::npos) { continue; } string nick = x.substr(i, j - i); i = j + 1; // A file has 2 0x05, a directory only one // const size_t cnt = count(x.begin() + j, x.end(), 0x05); // C÷èòàòü ìîæíî òîëüêî äî 2-õ. çíà÷åíèÿ áîëüøå èãíîðèðóþòñÿ const auto l_find_05_first = x.find(0x05, j); dcassert(l_find_05_first != string::npos); if (l_find_05_first == string::npos) continue; const auto l_find_05_second = x.find(0x05, l_find_05_first + 1); SearchResult::Types type = SearchResult::TYPE_FILE; string file; int64_t size = 0; if (l_find_05_first != string::npos && l_find_05_second == string::npos) // cnt == 1 { // We have a directory...find the first space beyond the first 0x05 from the back // (dirs might contain spaces as well...clever protocol, eh?) type = SearchResult::TYPE_DIRECTORY; // Get past the hubname that might contain spaces j = l_find_05_first; // Find the end of the directory info if ((j = x.rfind(' ', j - 1)) == string::npos) { continue; } if (j < i + 1) { continue; } file = x.substr(i, j - i) + '\\'; } else if (l_find_05_first != string::npos && l_find_05_second != string::npos) // cnt == 2 { j = l_find_05_first; file = x.substr(i, j - i); i = j + 1; if ((j = x.find(' ', i)) == string::npos) { continue; } size = Util::toInt64(x.substr(i, j - i)); } i = j + 1; if ((j = x.find('/', i)) == string::npos) { continue; } uint8_t freeSlots = (uint8_t)Util::toInt(x.substr(i, j - i)); i = j + 1; if ((j = x.find((char)5, i)) == string::npos) { continue; } uint8_t slots = (uint8_t)Util::toInt(x.substr(i, j - i)); i = j + 1; if ((j = x.rfind(" (")) == string::npos) { continue; } string l_hub_name_or_tth = x.substr(i, j - i); i = j + 2; if ((j = x.rfind(')')) == string::npos) { continue; } const string hubIpPort = x.substr(i, j - i); const string url = ClientManager::findHub(hubIpPort); const string l_encoding = ClientManager::findHubEncoding(url); nick = Text::toUtf8(nick, l_encoding); file = Text::toUtf8(file, l_encoding); const bool l_isTTH = isTTHBase64(l_hub_name_or_tth); if (!l_isTTH) l_hub_name_or_tth = Text::toUtf8(l_hub_name_or_tth, l_encoding); UserPtr user = ClientManager::findUser(nick, url); if (!user) { user = ClientManager::findLegacyUser(nick, url); if (!user) { continue; } } if (!remoteIp.is_unspecified()) { user->setIP(remoteIp, true); #ifdef _DEBUG //ClientManager::setIPUser(user, remoteIp); // TODO - ìîæåò íå íóæíî òóò? #endif // Òÿæåëàÿ îïåðàöèÿ ïî ìàïå þçåðîâ - òîëüêî ÷òîáû ïîêàçàòü IP â ñïèñêå ? } string tth; if (l_isTTH) { tth = l_hub_name_or_tth.substr(4); } if (tth.empty() && type == SearchResult::TYPE_FILE) { dcassert(tth.empty() && type == SearchResult::TYPE_FILE); continue; } const TTHValue l_tth_value(tth); auto sr = std::make_unique<SearchResult>(user, type, slots, freeSlots, size, file, BaseUtil::emptyString, url, remoteIp, l_tth_value, -1 /*0 == auto*/); COMMAND_DEBUG("[Search-result] url = " + url + " remoteIp = " + remoteIp.to_string() + " file = " + file + " user = " + user->getLastNick(), DebugTask::CLIENT_IN, remoteIp.to_string()); SearchManager::getInstance()->fly_fire1(SearchManagerListener::SR(), sr); #ifdef FLYLINKDC_USE_COLLECT_STAT CFlylinkDBManager::getInstance()->push_event_statistic("SearchManager::UdpQueue::run()", "$SR", x, remoteIp, "", url, tth); #endif } else if (x.compare(1, 4, "RES ", 4) == 0 && x[x.length() - 1] == 0x0a) { AdcCommand c(x.substr(0, x.length() - 1)); if (c.getParameters().empty()) continue; const string cid = c.getParam(0); if (cid.size() != 39) { dcassert(0); continue; } UserPtr user = ClientManager::findUser(CID(cid)); if (!user) continue; SearchManager::getInstance()->onRES(c, user, remoteIp); #ifdef FLYLINKDC_USE_COLLECT_STAT CFlylinkDBManager::getInstance()->push_event_statistic("SearchManager::UdpQueue::run()", "RES", x, remoteIp, "", "", ""); #endif } else if (x.compare(1, 4, "PSR ", 4) == 0 && x[x.length() - 1] == 0x0a) { AdcCommand c(x.substr(0, x.length() - 1)); if (c.getParameters().empty()) continue; const string cid = c.getParam(0); if (cid.size() != 39) continue; const UserPtr user = ClientManager::findUser(CID(cid)); // when user == NULL then it is probably NMDC user, check it later if (user) { SearchManager::getInstance()->onPSR(c, user, remoteIp); #ifdef FLYLINKDC_USE_COLLECT_STAT CFlylinkDBManager::getInstance()->push_event_statistic("SearchManager::UdpQueue::run()", "PSR", x, remoteIp, "", "", ""); #endif } } else if (x.compare(0, 15, "$FLY-TEST-PORT ", 15) == 0) { //dcassert(SettingsManager::g_TestUDPSearchLevel <= 1); const auto l_magic = x.substr(15, 39); if (ClientManager::getMyCID().toBase32() == l_magic) { //LogManager::message("Test UDP port - OK!"); SettingsManager::g_TestUDPSearchLevel = CFlyServerJSON::setTestPortOK(SETTING(UDP_PORT), "udp"); auto l_ip = x.substr(15 + 39); if (l_ip.size() && l_ip[l_ip.size() - 1] == '|') { l_ip = l_ip.substr(0, l_ip.size() - 1); } SettingsManager::g_UDPTestExternalIP = l_ip; } else { SettingsManager::g_TestUDPSearchLevel = false; CFlyServerJSON::pushError(57, "UDP Error magic value = " + l_magic); } } else { // ADC commands must end with \n if (x[x.length() - 1] != 0x0a) { dcassert(0); dcdebug("Invalid UDP data received: %s (no newline)\n", x.c_str()); //CFlyServerJSON::pushError(88, "[UDP]Invalid UDP data received: %s (no newline): ip = " + remoteIp.to_string() + " x = [" + x + "]"); continue; } if (!Text::validateUtf8(x)) { dcassert(0); dcdebug("UTF-8 validation failed for received UDP data: %s\n", x.c_str()); //CFlyServerJSON::pushError(87, "[UDP]UTF-8 validation failed for received UDP data: ip = " + remoteIp.to_string() + " x = [" + x + "]"); continue; } // TODO respond(AdcCommand(x.substr(0, x.length()-1))); } } catch (const ParseException& e) { dcassert(0); CFlyServerJSON::pushError(86, "[UDP][ParseException]:" + e.getError() + " ip = " + remoteIp.to_string() + " x = [" + x + "]"); } sleep(2); } return 0; } void SearchManager::onData(const std::string& p_line) { m_queue_thread.addResult(p_line, boost::asio::ip::address_v4()); } void SearchManager::onData(const uint8_t* buf, size_t aLen, const boost::asio::ip::address_v4& remoteIp) { if (aLen > 4) { const string x((char*)buf, aLen); m_queue_thread.addResult(x, remoteIp); } else { dcassert(0); } } void SearchManager::search_auto(const string& p_tth) { SearchParamOwner l_search_param; l_search_param.m_token = 0; /*"auto"*/ l_search_param.m_size_mode = Search::SIZE_DONTCARE; l_search_param.m_file_type = Search::TYPE_TTH; l_search_param.m_size = 0; l_search_param.m_filter = p_tth; // Äëÿ TTH íå íóæíî ýòîãî. l_search_param.normalize_whitespace(); l_search_param.m_owner = nullptr; l_search_param.m_is_force_passive_searh = false; dcassert(p_tth.size() == 39); //search(l_search_param); ClientManager::search(l_search_param); } void SearchManager::onRES(const AdcCommand& cmd, const UserPtr& from, const boost::asio::ip::address_v4& p_remoteIp) { int freeSlots = -1; int64_t size = -1; string file; string tth; uint32_t l_token = -1; // 0 == auto for (auto i = cmd.getParameters().cbegin(); i != cmd.getParameters().cend(); ++i) { const string& str = *i; if (str.compare(0, 2, "FN", 2) == 0) { file = Util::toNmdcFile(str.substr(2)); } else if (str.compare(0, 2, "SL", 2) == 0) { freeSlots = Util::toInt(str.substr(2)); } else if (str.compare(0, 2, "SI", 2) == 0) { size = Util::toInt64(str.substr(2)); } else if (str.compare(0, 2, "TR", 2) == 0) { tth = str.substr(2); } else if (str.compare(0, 2, "TO", 2) == 0) { l_token = Util::toUInt32(str.substr(2)); // dcassert(l_token); } } if (!file.empty() && freeSlots != -1 && size != -1) { /// @todo get the hub this was sent from, to be passed as a hint? (eg by using the token?) const StringList names = ClientManager::getHubNames(from->getCID(), BaseUtil::emptyString); const string hubName = names.empty() ? STRING(OFFLINE) : Util::toString(names); const StringList hubs = ClientManager::getHubs(from->getCID(), BaseUtil::emptyString); const string hub = hubs.empty() ? STRING(OFFLINE) : Util::toString(hubs); const SearchResult::Types type = (file[file.length() - 1] == '\\' ? SearchResult::TYPE_DIRECTORY : SearchResult::TYPE_FILE); if (type == SearchResult::TYPE_FILE && tth.empty()) return; const uint8_t slots = ClientManager::getSlots(from->getCID()); auto sr = std::make_unique<SearchResult>(from, type, slots, (uint8_t)freeSlots, size, file, hubName, hub, p_remoteIp, TTHValue(tth), l_token); fly_fire1(SearchManagerListener::SR(), sr); } } void SearchManager::onPSR(const AdcCommand& p_cmd, UserPtr from, const boost::asio::ip::address_v4& remoteIp) { uint16_t udpPort = 0; uint32_t partialCount = 0; string tth; string hubIpPort; string nick; PartsInfo partialInfo; for (auto i = p_cmd.getParameters().cbegin(); i != p_cmd.getParameters().cend(); ++i) { const string& str = *i; if (str.compare(0, 2, "U4", 2) == 0) { udpPort = static_cast<uint16_t>(Util::toInt(str.substr(2))); } else if (str.compare(0, 2, "NI", 2) == 0) { nick = str.substr(2); } else if (str.compare(0, 2, "HI", 2) == 0) { hubIpPort = str.substr(2); } else if (str.compare(0, 2, "TR", 2) == 0) { tth = str.substr(2); } else if (str.compare(0, 2, "PC", 2) == 0) { partialCount = Util::toUInt32(str.substr(2)) * 2; } else if (str.compare(0, 2, "PI", 2) == 0) { const StringTokenizer<string> tok(str.substr(2), ','); for (auto j = tok.getTokens().cbegin(); j != tok.getTokens().cend(); ++j) { partialInfo.push_back((uint16_t)Util::toInt(*j)); } } } if (partialInfo.size() != partialCount) { // what to do now ? just ignore partial search result :-/ return; } const string url = ClientManager::findHub(hubIpPort); if (!from || ClientManager::isMe(from)) { // for NMDC support if (nick.empty() || hubIpPort.empty()) { return; } from = ClientManager::findUser(nick, url); // TODO îïòìèçíóòü makeCID if (!from) { // Could happen if hub has multiple URLs / IPs from = ClientManager::findLegacyUser(nick, url); if (!from) { dcdebug("Search result from unknown user"); LogManager::psr_message("Error SearchManager::onPSR & ClientManager::findLegacyUser nick = " + nick + " url = " + url); return; } else { dcdebug("Search result from valid user"); LogManager::psr_message("OK SearchManager::onPSR & ClientManager::findLegacyUser nick = " + nick + " url = " + url); } } } #ifdef _DEBUG // ClientManager::setIPUser(from, remoteIp, udpPort); #endif if (!from) { return; } PartsInfo outPartialInfo; QueueItem::PartialSource ps(from->isNMDC() ? ClientManager::findMyNick(url) : BaseUtil::emptyString, hubIpPort, remoteIp, udpPort); ps.setPartialInfo(partialInfo); QueueManager::getInstance()->handlePartialResult(from, TTHValue(tth), ps, outPartialInfo); if (udpPort > 0 && !outPartialInfo.empty()) { try { AdcCommand cmd(AdcCommand::CMD_PSR, AdcCommand::TYPE_UDP); toPSR(cmd, false, ps.getMyNick(), hubIpPort, tth, outPartialInfo); ClientManager::send(cmd, from->getCID()); LogManager::psr_message( "[SearchManager::respond] hubIpPort = " + hubIpPort + " ps.getMyNick() = " + ps.getMyNick() + " tth = " + tth + " outPartialInfo.size() = " + Util::toString(outPartialInfo.size()) ); } catch (const Exception& e) { dcdebug("Partial search caught error\n"); LogManager::psr_message("Partial search caught error = " + e.getError()); } } } ClientManagerListener::SearchReply SearchManager::respond(const AdcCommand& adc, const CID& from, bool isUdpActive, const string& hubIpPort, StringSearch::List& reguest) { // Filter own searches if (from == ClientManager::getMyCID()) { return ClientManagerListener::SEARCH_MISS; } const UserPtr p = ClientManager::findUser(from); if (!p) { return ClientManagerListener::SEARCH_MISS; } SearchResultList l_search_results; ShareManager::search_max_result(l_search_results, adc.getParameters(), isUdpActive ? 10 : 5, reguest); ClientManagerListener::SearchReply l_sr = ClientManagerListener::SEARCH_MISS; // TODO: don't send replies to passive users if (l_search_results.empty()) { string tth; if (!adc.getParam("TR", 0, tth)) return l_sr; PartsInfo partialInfo; if (QueueManager::handlePartialSearch(TTHValue(tth), partialInfo)) { AdcCommand cmd(AdcCommand::CMD_PSR, AdcCommand::TYPE_UDP); toPSR(cmd, true, BaseUtil::emptyString, hubIpPort, tth, partialInfo); ClientManager::send(cmd, from); l_sr = ClientManagerListener::SEARCH_PARTIAL_HIT; LogManager::psr_message( "[SearchManager::respond] hubIpPort = " + hubIpPort + " tth = " + tth + " partialInfo.size() = " + Util::toString(partialInfo.size()) ); } } else { string l_token; adc.getParam("TO", 0, l_token); for (auto i = l_search_results.cbegin(); i != l_search_results.cend(); ++i) { AdcCommand cmd(AdcCommand::CMD_RES, AdcCommand::TYPE_UDP); i->toRES(cmd, AdcCommand::TYPE_UDP); if (!l_token.empty()) { cmd.addParam("TO", l_token); } ClientManager::send(cmd, from); } l_sr = ClientManagerListener::SEARCH_HIT; } return l_sr; } string SearchManager::getPartsString(const PartsInfo& partsInfo) { string ret; for (auto i = partsInfo.cbegin(); i < partsInfo.cend(); i += 2) { ret += Util::toString(*i) + "," + Util::toString(*(i + 1)) + ","; } return ret.substr(0, ret.size() - 1); } void SearchManager::toPSR(AdcCommand& cmd, bool wantResponse, const string& myNick, const string& hubIpPort, const string& tth, const vector<uint16_t>& partialInfo) { cmd.getParameters().reserve(6); if (!myNick.empty()) { cmd.addParam("NI", Text::utf8ToAcp(myNick)); } cmd.addParam("HI", hubIpPort); cmd.addParam("U4", Util::toString(wantResponse ? getSearchPortUint() : 0)); // Ñþäà ïî îøèáêå ïîäàâñÿ íå óðë ê õàáó. && ClientManager::isActive(hubIpPort) cmd.addParam("TR", tth); cmd.addParam("PC", Util::toString(partialInfo.size() / 2)); cmd.addParam("PI", getPartsString(partialInfo)); } /** * @file * $Id: SearchManager.cpp 575 2011-08-25 19:38:04Z bigmuscle $ */
gpl-2.0
sandsmark/konsole
src/SaveHistoryTask.cpp
7168
/* Copyright 2006-2008 by Robert Knight <robertknight@gmail.com> Copyright 2009 by Thomas Dreibholz <dreibh@iem.uni-due.de> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "SaveHistoryTask.h" #include <QFileDialog> #include <QApplication> #include <QTextStream> #include <KMessageBox> #include <KLocalizedString> #include <KSharedConfig> #include <KConfig> #include <KConfigGroup> #include "session/SessionManager.h" #include "Emulation.h" #include "PlainTextDecoder.h" #include "HTMLDecoder.h" namespace Konsole { QString SaveHistoryTask::_saveDialogRecentURL; SaveHistoryTask::SaveHistoryTask(QObject* parent) : SessionTask(parent) { } SaveHistoryTask::~SaveHistoryTask() = default; void SaveHistoryTask::execute() { // TODO - think about the UI when saving multiple history sessions, if there are more than two or // three then providing a URL for each one will be tedious // TODO - show a warning ( preferably passive ) if saving the history output fails QFileDialog* dialog = new QFileDialog(QApplication::activeWindow()); dialog->setAcceptMode(QFileDialog::AcceptSave); QStringList mimeTypes { QStringLiteral("text/plain"), QStringLiteral("text/html") }; dialog->setMimeTypeFilters(mimeTypes); KSharedConfigPtr konsoleConfig = KSharedConfig::openConfig(); auto group = konsoleConfig->group("SaveHistory Settings"); if (_saveDialogRecentURL.isEmpty()) { const auto list = group.readPathEntry("Recent URLs", QStringList()); if (list.isEmpty()) { dialog->setDirectory(QDir::homePath()); } else { dialog->setDirectoryUrl(QUrl(list.at(0))); } } else { dialog->setDirectoryUrl(QUrl(_saveDialogRecentURL)); } // iterate over each session in the task and display a dialog to allow the user to choose where // to save that session's history. // then start a KIO job to transfer the data from the history to the chosen URL const QList<QPointer<Session>> sessionsList = sessions(); for (const auto &session : sessionsList) { dialog->setWindowTitle(i18n("Save Output From %1", session->title(Session::NameRole))); int result = dialog->exec(); if (result != QDialog::Accepted) { continue; } QUrl url = (dialog->selectedUrls()).at(0); if (!url.isValid()) { // UI: Can we make this friendlier? KMessageBox::sorry(nullptr , i18n("%1 is an invalid URL, the output could not be saved.", url.url())); continue; } // Save selected URL for next time _saveDialogRecentURL = url.adjusted(QUrl::RemoveFilename|QUrl::StripTrailingSlash).toString(); group.writePathEntry("Recent URLs", _saveDialogRecentURL); KIO::TransferJob* job = KIO::put(url, -1, // no special permissions // overwrite existing files // do not resume an existing transfer // show progress information only for remote // URLs KIO::Overwrite | (url.isLocalFile() ? KIO::HideProgressInfo : KIO::DefaultFlags) // a better solution would be to show progress // information after a certain period of time // instead, since the overall speed of transfer // depends on factors other than just the protocol // used ); SaveJob jobInfo; jobInfo.session = session; jobInfo.lastLineFetched = -1; // when each request for data comes in from the KIO subsystem // lastLineFetched is used to keep track of how much of the history // has already been sent, and where the next request should continue // from. // this is set to -1 to indicate the job has just been started if (((dialog->selectedNameFilter()).contains(QLatin1String("html"), Qt::CaseInsensitive)) || ((dialog->selectedFiles()).at(0).endsWith(QLatin1String("html"), Qt::CaseInsensitive))) { Profile::Ptr profile = SessionManager::instance()->sessionProfile(session); jobInfo.decoder = new HTMLDecoder(profile); } else { jobInfo.decoder = new PlainTextDecoder(); } _jobSession.insert(job, jobInfo); connect(job, &KIO::TransferJob::dataReq, this, &Konsole::SaveHistoryTask::jobDataRequested); connect(job, &KIO::TransferJob::result, this, &Konsole::SaveHistoryTask::jobResult); } dialog->deleteLater(); } void SaveHistoryTask::jobDataRequested(KIO::Job* job , QByteArray& data) { // TODO - Report progress information for the job // PERFORMANCE: Do some tests and tweak this value to get faster saving const int LINES_PER_REQUEST = 500; SaveJob& info = _jobSession[job]; // transfer LINES_PER_REQUEST lines from the session's history // to the save location if (!info.session.isNull()) { // note: when retrieving lines from the emulation, // the first line is at index 0. int sessionLines = info.session->emulation()->lineCount(); if (sessionLines - 1 == info.lastLineFetched) { return; // if there is no more data to transfer then stop the job } int copyUpToLine = qMin(info.lastLineFetched + LINES_PER_REQUEST , sessionLines - 1); QTextStream stream(&data, QIODevice::ReadWrite); info.decoder->begin(&stream); info.session->emulation()->writeToStream(info.decoder , info.lastLineFetched + 1 , copyUpToLine); info.decoder->end(); info.lastLineFetched = copyUpToLine; } } void SaveHistoryTask::jobResult(KJob* job) { if (job->error() != 0) { KMessageBox::sorry(nullptr , i18n("A problem occurred when saving the output.\n%1", job->errorString())); } TerminalCharacterDecoder * decoder = _jobSession[job].decoder; _jobSession.remove(job); delete decoder; // notify the world that the task is done emit completed(true); if (autoDelete()) { deleteLater(); } } }
gpl-2.0
bspeiser/cards
cards/src/main/java/cards/action/Action.java
52
package cards.action; public interface Action { }
gpl-2.0
SunLabsAST/AURA
WebMusicExplaura/src/java/com/sun/labs/aura/music/wsitm/client/items/AttentionItem.java
2224
/* * Copyright 2007-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER * * This code is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * only, as published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License version 2 for more details (a copy is * included in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU General Public License * version 2 along with this work; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * * Please contact Sun Microsystems, Inc., 16 Network Circle, Menlo * Park, CA 94025 or visit www.sun.com if you need additional * information or have any questions. */ package com.sun.labs.aura.music.wsitm.client.items; import com.google.gwt.user.client.rpc.IsSerializable; import java.util.Date; import java.util.HashSet; import java.util.Set; /** * * @author mailletf */ public class AttentionItem<T extends IsSerializable> implements IsSerializable { private T item; private int rating; private Date date; private Set<String> tags; public AttentionItem() { } public AttentionItem(T item) { this.item = item; this.rating = 0; this.tags = new HashSet<String>(); } public void setItem(T item) { this.item = item; } public void setRating(int rating) { this.rating = rating; } public void setTags(Set<String> tags) { this.tags = tags; } public int getRating() { return rating; } public Set<String> getTags() { return tags; } public T getItem() { return item; } public Date getDate() { return date; } public void setDate(long timestamp) { this.date = new Date(timestamp); } public void setDate(Date d) { this.date = d; } }
gpl-2.0
tjflexic/kaggle-word2vec-movie-reviews
nbsvm.py
2483
import numpy as np import pandas as pd from collections import Counter from KaggleWord2VecUtility import KaggleWord2VecUtility def tokenize(sentence, grams): words = KaggleWord2VecUtility.review_to_wordlist(sentence) tokens = [] for gram in grams: for i in range(len(words) - gram + 1): tokens += ["_*_".join(words[i:i+gram])] return tokens def build_dict(data, grams): dic = Counter() for token_list in data: dic.update(token_list) return dic def compute_ratio(poscounts, negcounts, alpha=1): alltokens = list(set(poscounts.keys() + negcounts.keys())) dic = dict((t, i) for i, t in enumerate(alltokens)) d = len(dic) print "Computing r...\n" p, q = np.ones(d) * alpha , np.ones(d) * alpha for t in alltokens: p[dic[t]] += poscounts[t] q[dic[t]] += negcounts[t] p /= abs(p).sum() q /= abs(q).sum() r = np.log(p/q) return dic, r def generate_svmlight_content(data, dic, r, grams): output = [] for _, row in data.iterrows(): tokens = tokenize(row['review'], grams) indexes = [] for t in tokens: try: indexes += [dic[t]] except KeyError: pass indexes = list(set(indexes)) indexes.sort() if 'sentiment' in row: line = [str(row['sentiment'])] else: line = ['0'] for i in indexes: line += ["%i:%f" % (i + 1, r[i])] output += [" ".join(line)] return "\n".join(output) def generate_svmlight_files(train, test, grams, outfn): ngram = [int(i) for i in grams] ptrain = [] ntrain = [] print "Parsing training data...\n" for _, row in train.iterrows(): if row['sentiment'] == 1: ptrain.append(tokenize(row['review'], ngram)) elif row['sentiment'] == 0: ntrain.append(tokenize(row['review'], ngram)) pos_counts = build_dict(ptrain, ngram) neg_counts = build_dict(ntrain, ngram) dic, r = compute_ratio(pos_counts, neg_counts) f = open(outfn + '-train.txt', "w") f.writelines(generate_svmlight_content(train, dic, r, ngram)) f.close() print "Parsing test data...\n" f = open(outfn + '-test.txt', "w") f.writelines(generate_svmlight_content(test, dic, r, ngram)) f.close() print "SVMlight files have been generated!"
gpl-2.0
Kimsangcheon/wp-calypso
client/lib/media/test/library-selected-store.js
3792
/** * External dependencies */ var expect = require( 'chai' ).expect, rewire = require( 'rewire' ), assign = require( 'lodash/assign' ), sinon = require( 'sinon' ); /** * Internal dependencies */ var Dispatcher = require( 'dispatcher' ), MediaStore = require( '../store' ); var DUMMY_SITE_ID = 1, DUMMY_OBJECTS = { 100: { ID: 100, title: 'Image' }, 'media-1': { ID: 100, title: 'Image' }, 200: { ID: 200, title: 'Video' } }, DUMMY_MEDIA_OBJECT = DUMMY_OBJECTS[ 100 ], DUMMY_TRANSIENT_MEDIA_OBJECT = DUMMY_OBJECTS[ 'media-1' ]; describe( 'MediaLibrarySelectedStore', function() { var sandbox, MediaLibrarySelectedStore, handler; before( function() { sandbox = sinon.sandbox.create(); sandbox.spy( Dispatcher, 'register' ); sandbox.stub( Dispatcher, 'waitFor' ).returns( true ); sandbox.stub( MediaStore, 'get', function( siteId, itemId ) { if ( siteId === DUMMY_SITE_ID ) { return DUMMY_OBJECTS[ itemId ]; } } ); MediaLibrarySelectedStore = rewire( '../library-selected-store' ); handler = Dispatcher.register.lastCall.args[ 0 ]; } ); beforeEach( function() { MediaLibrarySelectedStore.__set__( '_media', {} ); } ); after( function() { sandbox.restore(); } ); function dispatchSetLibrarySelectedItems( action ) { handler( { action: assign( { type: 'SET_MEDIA_LIBRARY_SELECTED_ITEMS', siteId: DUMMY_SITE_ID, data: [ DUMMY_TRANSIENT_MEDIA_OBJECT ] }, action ) } ); } function dispatchReceiveMediaItem() { handler( { action: { type: 'RECEIVE_MEDIA_ITEM', siteId: DUMMY_SITE_ID, data: DUMMY_MEDIA_OBJECT, id: DUMMY_TRANSIENT_MEDIA_OBJECT.ID } } ); } function dispatchRemoveMediaItem( error ) { handler( { action: { error: error, type: 'REMOVE_MEDIA_ITEM', siteId: DUMMY_SITE_ID, data: DUMMY_TRANSIENT_MEDIA_OBJECT } } ); } describe( '#get()', function() { it( 'should return a single value', function() { dispatchSetLibrarySelectedItems(); expect( MediaLibrarySelectedStore.get( DUMMY_SITE_ID, DUMMY_TRANSIENT_MEDIA_OBJECT.ID ) ).to.eql( DUMMY_TRANSIENT_MEDIA_OBJECT ); } ); it( 'should return undefined for an item that does not exist', function() { expect( MediaLibrarySelectedStore.get( DUMMY_SITE_ID, DUMMY_TRANSIENT_MEDIA_OBJECT.ID + 1 ) ).to.be.undefined; } ); } ); describe( '#getAll()', function() { it( 'should return all selected media', function() { dispatchSetLibrarySelectedItems(); expect( MediaLibrarySelectedStore.getAll( DUMMY_SITE_ID ) ).to.eql( [ DUMMY_TRANSIENT_MEDIA_OBJECT ] ); } ); it( 'should return an empty array for a site with no selected items', function() { expect( MediaLibrarySelectedStore.getAll( DUMMY_SITE_ID ) ).to.eql( [] ); } ); } ); describe( '.dispatchToken', function() { it( 'should expose its dispatcher ID', function() { expect( MediaLibrarySelectedStore.dispatchToken ).to.not.be.undefined; } ); it( 'should emit a change event when library items have been set', function( done ) { MediaLibrarySelectedStore.once( 'change', done ); dispatchSetLibrarySelectedItems(); } ); it( 'should emit a change event when receiving updates', function( done ) { MediaLibrarySelectedStore.once( 'change', done ); dispatchReceiveMediaItem(); } ); it( 'should replace an item when its ID has changed', function() { dispatchSetLibrarySelectedItems(); dispatchReceiveMediaItem(); expect( MediaLibrarySelectedStore.getAll( DUMMY_SITE_ID ) ).to.eql( [ DUMMY_MEDIA_OBJECT ] ); } ); it( 'should remove an item when REMOVE_MEDIA_ITEM is dispatched', function() { dispatchSetLibrarySelectedItems(); dispatchRemoveMediaItem(); expect( MediaLibrarySelectedStore.__get__( '_media' )[ DUMMY_SITE_ID ] ).to.be.empty; } ); } ); } );
gpl-2.0
tomaszrogucki/kvetysamorin
web/wp-content/plugins/woocommerce-pdf-invoices/vendor/mpdf/mpdf/Tag.php
261869
<?php class Tag { private $mpdf; public function __construct(mPDF $mpdf) { $this->mpdf = $mpdf; } function OpenTag($tag, $attr, &$ahtml, &$ihtml) { // mPDF 6 //Opening tag // mPDF 6 // Correct for tags where HTML5 specifies optional end tags excluding table elements (cf WriteHTML() ) if ($this->mpdf->allow_html_optional_endtags) { if (isset($this->mpdf->blk[$this->mpdf->blklvl]['tag'])) { $closed = false; // li end tag may be omitted if immediately followed by another li element if (!$closed && $this->mpdf->blk[$this->mpdf->blklvl]['tag'] == 'LI' && $tag == 'LI') { $this->CloseTag('LI', $ahtml, $ihtml); $closed = true; } // dt end tag may be omitted if immediately followed by another dt element or a dd element if (!$closed && $this->mpdf->blk[$this->mpdf->blklvl]['tag'] == 'DT' && ($tag == 'DT' || $tag == 'DD')) { $this->CloseTag('DT', $ahtml, $ihtml); $closed = true; } // dd end tag may be omitted if immediately followed by another dd element or a dt element if (!$closed && $this->mpdf->blk[$this->mpdf->blklvl]['tag'] == 'DD' && ($tag == 'DT' || $tag == 'DD')) { $this->CloseTag('DD', $ahtml, $ihtml); $closed = true; } // p end tag may be omitted if immediately followed by an address, article, aside, blockquote, div, dl, fieldset, form, // h1, h2, h3, h4, h5, h6, hgroup, hr, main, nav, ol, p, pre, section, table, ul if (!$closed && $this->mpdf->blk[$this->mpdf->blklvl]['tag'] == 'P' && ($tag == 'P' || $tag == 'DIV' || $tag == 'H1' || $tag == 'H2' || $tag == 'H3' || $tag == 'H4' || $tag == 'H5' || $tag == 'H6' || $tag == 'UL' || $tag == 'OL' || $tag == 'TABLE' || $tag == 'PRE' || $tag == 'FORM' || $tag == 'ADDRESS' || $tag == 'BLOCKQUOTE' || $tag == 'CENTER' || $tag == 'DL' || $tag == 'HR' || $tag == 'ARTICLE' || $tag == 'ASIDE' || $tag == 'FIELDSET' || $tag == 'HGROUP' || $tag == 'MAIN' || $tag == 'NAV' || $tag == 'SECTION')) { $this->CloseTag('P', $ahtml, $ihtml); $closed = true; } // option end tag may be omitted if immediately followed by another option element (or if it is immediately followed by an optgroup element) if (!$closed && $this->mpdf->blk[$this->mpdf->blklvl]['tag'] == 'OPTION' && $tag == 'OPTION') { $this->CloseTag('OPTION', $ahtml, $ihtml); $closed = true; } // Table elements - see also WriteHTML() if (!$closed && ($tag == 'TD' || $tag == 'TH') && $this->mpdf->lastoptionaltag == 'TD') { $this->CloseTag($this->mpdf->lastoptionaltag, $ahtml, $ihtml); $closed = true; } // *TABLES* if (!$closed && ($tag == 'TD' || $tag == 'TH') && $this->mpdf->lastoptionaltag == 'TH') { $this->CloseTag($this->mpdf->lastoptionaltag, $ahtml, $ihtml); $closed = true; } // *TABLES* if (!$closed && $tag == 'TR' && $this->mpdf->lastoptionaltag == 'TR') { $this->CloseTag($this->mpdf->lastoptionaltag, $ahtml, $ihtml); $closed = true; } // *TABLES* if (!$closed && $tag == 'TR' && $this->mpdf->lastoptionaltag == 'TD') { $this->CloseTag($this->mpdf->lastoptionaltag, $ahtml, $ihtml); $this->CloseTag('TR', $ahtml, $ihtml); $this->CloseTag('THEAD', $ahtml, $ihtml); $closed = true; } // *TABLES* if (!$closed && $tag == 'TR' && $this->mpdf->lastoptionaltag == 'TH') { $this->CloseTag($this->mpdf->lastoptionaltag, $ahtml, $ihtml); $this->CloseTag('TR', $ahtml, $ihtml); $this->CloseTag('THEAD', $ahtml, $ihtml); $closed = true; } // *TABLES* } } $align = array('left' => 'L', 'center' => 'C', 'right' => 'R', 'top' => 'T', 'text-top' => 'TT', 'middle' => 'M', 'baseline' => 'BS', 'bottom' => 'B', 'text-bottom' => 'TB', 'justify' => 'J'); switch ($tag) { case 'DOTTAB': $objattr = array(); $objattr['type'] = 'dottab'; $dots = str_repeat('.', 3) . " "; // minimum number of dots $objattr['width'] = $this->mpdf->GetStringWidth($dots); $objattr['margin_top'] = 0; $objattr['margin_bottom'] = 0; $objattr['margin_left'] = 0; $objattr['margin_right'] = 0; $objattr['height'] = 0; $objattr['colorarray'] = $this->mpdf->colorarray; $objattr['border_top']['w'] = 0; $objattr['border_bottom']['w'] = 0; $objattr['border_left']['w'] = 0; $objattr['border_right']['w'] = 0; $objattr['vertical_align'] = 'BS'; // mPDF 6 DOTTAB $properties = $this->mpdf->cssmgr->MergeCSS('INLINE', $tag, $attr); if (isset($properties['OUTDENT'])) { $objattr['outdent'] = $this->mpdf->ConvertSize($properties['OUTDENT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } else if (isset($attr['OUTDENT'])) { $objattr['outdent'] = $this->mpdf->ConvertSize($attr['OUTDENT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } else { $objattr['outdent'] = 0; } $objattr['fontfamily'] = $this->mpdf->FontFamily; $objattr['fontsize'] = $this->mpdf->FontSizePt; $e = "\xbb\xa4\xactype=dottab,objattr=" . serialize($objattr) . "\xbb\xa4\xac"; /* -- TABLES -- */ // Output it to buffers if ($this->mpdf->tableLevel) { if (!isset($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'])) { $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'] = $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s']; } elseif ($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'] < $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s']) { $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'] = $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s']; } $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s'] = 0; // reset $this->mpdf->_saveCellTextBuffer($e); } else { /* -- END TABLES -- */ $this->mpdf->_saveTextBuffer($e); } // *TABLES* break; case 'PAGEHEADER': case 'PAGEFOOTER': $this->mpdf->ignorefollowingspaces = true; if ($attr['NAME']) { $pname = $attr['NAME']; } else { $pname = '_nonhtmldefault'; } // mPDF 6 $p = array(); // mPDF 6 $p['L'] = array(); $p['C'] = array(); $p['R'] = array(); $p['L']['font-style'] = ''; $p['C']['font-style'] = ''; $p['R']['font-style'] = ''; if (isset($attr['CONTENT-LEFT'])) { $p['L']['content'] = $attr['CONTENT-LEFT']; } if (isset($attr['CONTENT-CENTER'])) { $p['C']['content'] = $attr['CONTENT-CENTER']; } if (isset($attr['CONTENT-RIGHT'])) { $p['R']['content'] = $attr['CONTENT-RIGHT']; } if (isset($attr['HEADER-STYLE']) || isset($attr['FOOTER-STYLE'])) { // font-family,size,weight,style,color if ($tag == 'PAGEHEADER') { $properties = $this->mpdf->cssmgr->readInlineCSS($attr['HEADER-STYLE']); } else { $properties = $this->mpdf->cssmgr->readInlineCSS($attr['FOOTER-STYLE']); } if (isset($properties['FONT-FAMILY'])) { $p['L']['font-family'] = $properties['FONT-FAMILY']; $p['C']['font-family'] = $properties['FONT-FAMILY']; $p['R']['font-family'] = $properties['FONT-FAMILY']; } if (isset($properties['FONT-SIZE'])) { $p['L']['font-size'] = $this->mpdf->ConvertSize($properties['FONT-SIZE']) * _MPDFK; $p['C']['font-size'] = $this->mpdf->ConvertSize($properties['FONT-SIZE']) * _MPDFK; $p['R']['font-size'] = $this->mpdf->ConvertSize($properties['FONT-SIZE']) * _MPDFK; } if (isset($properties['FONT-WEIGHT']) && $properties['FONT-WEIGHT'] == 'bold') { $p['L']['font-style'] = 'B'; $p['C']['font-style'] = 'B'; $p['R']['font-style'] = 'B'; } if (isset($properties['FONT-STYLE']) && $properties['FONT-STYLE'] == 'italic') { $p['L']['font-style'] .= 'I'; $p['C']['font-style'] .= 'I'; $p['R']['font-style'] .= 'I'; } if (isset($properties['COLOR'])) { $p['L']['color'] = $properties['COLOR']; $p['C']['color'] = $properties['COLOR']; $p['R']['color'] = $properties['COLOR']; } } if (isset($attr['HEADER-STYLE-LEFT']) || isset($attr['FOOTER-STYLE-LEFT'])) { if ($tag == 'PAGEHEADER') { $properties = $this->mpdf->cssmgr->readInlineCSS($attr['HEADER-STYLE-LEFT']); } else { $properties = $this->mpdf->cssmgr->readInlineCSS($attr['FOOTER-STYLE-LEFT']); } if (isset($properties['FONT-FAMILY'])) { $p['L']['font-family'] = $properties['FONT-FAMILY']; } if (isset($properties['FONT-SIZE'])) { $p['L']['font-size'] = $this->mpdf->ConvertSize($properties['FONT-SIZE']) * _MPDFK; } if (isset($properties['FONT-WEIGHT']) && $properties['FONT-WEIGHT'] == 'bold') { $p['L']['font-style'] = 'B'; } if (isset($properties['FONT-STYLE']) && $properties['FONT-STYLE'] == 'italic') { $p['L']['font-style'] .='I'; } if (isset($properties['COLOR'])) { $p['L']['color'] = $properties['COLOR']; } } if (isset($attr['HEADER-STYLE-CENTER']) || isset($attr['FOOTER-STYLE-CENTER'])) { if ($tag == 'PAGEHEADER') { $properties = $this->mpdf->cssmgr->readInlineCSS($attr['HEADER-STYLE-CENTER']); } else { $properties = $this->mpdf->cssmgr->readInlineCSS($attr['FOOTER-STYLE-CENTER']); } if (isset($properties['FONT-FAMILY'])) { $p['C']['font-family'] = $properties['FONT-FAMILY']; } if (isset($properties['FONT-SIZE'])) { $p['C']['font-size'] = $this->mpdf->ConvertSize($properties['FONT-SIZE']) * _MPDFK; } if (isset($properties['FONT-WEIGHT']) && $properties['FONT-WEIGHT'] == 'bold') { $p['C']['font-style'] = 'B'; } if (isset($properties['FONT-STYLE']) && $properties['FONT-STYLE'] == 'italic') { $p['C']['font-style'] .= 'I'; } if (isset($properties['COLOR'])) { $p['C']['color'] = $properties['COLOR']; } } if (isset($attr['HEADER-STYLE-RIGHT']) || isset($attr['FOOTER-STYLE-RIGHT'])) { if ($tag == 'PAGEHEADER') { $properties = $this->mpdf->cssmgr->readInlineCSS($attr['HEADER-STYLE-RIGHT']); } else { $properties = $this->mpdf->cssmgr->readInlineCSS($attr['FOOTER-STYLE-RIGHT']); } if (isset($properties['FONT-FAMILY'])) { $p['R']['font-family'] = $properties['FONT-FAMILY']; } if (isset($properties['FONT-SIZE'])) { $p['R']['font-size'] = $this->mpdf->ConvertSize($properties['FONT-SIZE']) * _MPDFK; } if (isset($properties['FONT-WEIGHT']) && $properties['FONT-WEIGHT'] == 'bold') { $p['R']['font-style'] = 'B'; } if (isset($properties['FONT-STYLE']) && $properties['FONT-STYLE'] == 'italic') { $p['R']['font-style'] .= 'I'; } if (isset($properties['COLOR'])) { $p['R']['color'] = $properties['COLOR']; } } if (isset($attr['LINE']) && $attr['LINE']) { // 0|1|on|off if ($attr['LINE'] == '1' || strtoupper($attr['LINE']) == 'ON') { $lineset = 1; } else { $lineset = 0; } $p['line'] = $lineset; } // mPDF 6 if ($tag == 'PAGEHEADER') { $this->mpdf->DefHeaderByName($pname, $p); } else { $this->mpdf->DefFooterByName($pname, $p); } break; case 'SETPAGEHEADER': // mPDF 6 case 'SETPAGEFOOTER': case 'SETHTMLPAGEHEADER': case 'SETHTMLPAGEFOOTER': $this->mpdf->ignorefollowingspaces = true; if (isset($attr['NAME']) && $attr['NAME']) { $pname = $attr['NAME']; } else if ($tag == 'SETPAGEHEADER' || $tag == 'SETPAGEFOOTER') { $pname = '_nonhtmldefault'; } // mPDF 6 else { $pname = '_default'; } if (isset($attr['PAGE']) && $attr['PAGE']) { // O|odd|even|E|ALL|[blank] if (strtoupper($attr['PAGE']) == 'O' || strtoupper($attr['PAGE']) == 'ODD') { $side = 'odd'; } else if (strtoupper($attr['PAGE']) == 'E' || strtoupper($attr['PAGE']) == 'EVEN') { $side = 'even'; } else if (strtoupper($attr['PAGE']) == 'ALL') { $side = 'both'; } else { $side = 'odd'; } } else { $side = 'odd'; } if (isset($attr['VALUE']) && $attr['VALUE']) { // -1|1|on|off if ($attr['VALUE'] == '1' || strtoupper($attr['VALUE']) == 'ON') { $set = 1; } else if ($attr['VALUE'] == '-1' || strtoupper($attr['VALUE']) == 'OFF') { $set = 0; } else { $set = 1; } } else { $set = 1; } if (isset($attr['SHOW-THIS-PAGE']) && $attr['SHOW-THIS-PAGE'] && ($tag == 'SETHTMLPAGEHEADER' || $tag == 'SETPAGEHEADER')) { $write = 1; } else { $write = 0; } if ($side == 'odd' || $side == 'both') { if ($set && ($tag == 'SETHTMLPAGEHEADER' || $tag == 'SETPAGEHEADER')) { $this->mpdf->SetHTMLHeader($this->mpdf->pageHTMLheaders[$pname], 'O', $write); } else if ($set && ($tag == 'SETHTMLPAGEFOOTER' || $tag == 'SETPAGEFOOTER')) { $this->mpdf->SetHTMLFooter($this->mpdf->pageHTMLfooters[$pname], 'O'); } else if ($tag == 'SETHTMLPAGEHEADER' || $tag == 'SETPAGEHEADER') { $this->mpdf->SetHTMLHeader('', 'O'); } else { $this->mpdf->SetHTMLFooter('', 'O'); } } if ($side == 'even' || $side == 'both') { if ($set && ($tag == 'SETHTMLPAGEHEADER' || $tag == 'SETPAGEHEADER')) { $this->mpdf->SetHTMLHeader($this->mpdf->pageHTMLheaders[$pname], 'E', $write); } else if ($set && ($tag == 'SETHTMLPAGEFOOTER' || $tag == 'SETPAGEFOOTER')) { $this->mpdf->SetHTMLFooter($this->mpdf->pageHTMLfooters[$pname], 'E'); } else if ($tag == 'SETHTMLPAGEHEADER' || $tag == 'SETPAGEHEADER') { $this->mpdf->SetHTMLHeader('', 'E'); } else { $this->mpdf->SetHTMLFooter('', 'E'); } } break; /* -- TOC -- */ case 'TOC': //added custom-tag - set Marker for insertion later of ToC if (!class_exists('tocontents', false)) { include(_MPDF_PATH . 'classes/tocontents.php'); } if (empty($this->mpdf->tocontents)) { $this->mpdf->tocontents = new tocontents($this); } $this->mpdf->tocontents->openTagTOC($attr); break; case 'TOCPAGEBREAK': // custom-tag - set Marker for insertion later of ToC AND adds PAGEBREAK if (!class_exists('tocontents', false)) { include(_MPDF_PATH . 'classes/tocontents.php'); } if (empty($this->mpdf->tocontents)) { $this->mpdf->tocontents = new tocontents($this->mpdf); } list($isbreak, $toc_id) = $this->mpdf->tocontents->openTagTOCPAGEBREAK($attr); if ($isbreak) break; if (!isset($attr['RESETPAGENUM']) || $attr['RESETPAGENUM'] < 1) { $attr['RESETPAGENUM'] = 1; } // mPDF 6 // No break - continues as PAGEBREAK... /* -- END TOC -- */ case 'PAGE_BREAK': //custom-tag case 'PAGEBREAK': //custom-tag case 'NEWPAGE': //custom-tag case 'FORMFEED': //custom-tag if (isset($attr['SHEET-SIZE'])) { // Convert to same types as accepted in initial mPDF() A4, A4-L, or array(w,h) $prop = preg_split('/\s+/', trim($attr['SHEET-SIZE'])); if (count($prop) == 2) { $newformat = array($this->mpdf->ConvertSize($prop[0]), $this->mpdf->ConvertSize($prop[1])); } else { $newformat = $attr['SHEET-SIZE']; } } else { $newformat = ''; } $save_blklvl = $this->mpdf->blklvl; $save_blk = $this->mpdf->blk; $save_silp = $this->mpdf->saveInlineProperties(); $save_ilp = $this->mpdf->InlineProperties; $save_bflp = $this->mpdf->InlineBDF; $save_bflpc = $this->mpdf->InlineBDFctr; // mPDF 6 $mgr = $mgl = $mgt = $mgb = $mgh = $mgf = ''; if (isset($attr['MARGIN-RIGHT'])) { $mgr = $this->mpdf->ConvertSize($attr['MARGIN-RIGHT'], $this->mpdf->w, $this->mpdf->FontSize, false); } if (isset($attr['MARGIN-LEFT'])) { $mgl = $this->mpdf->ConvertSize($attr['MARGIN-LEFT'], $this->mpdf->w, $this->mpdf->FontSize, false); } if (isset($attr['MARGIN-TOP'])) { $mgt = $this->mpdf->ConvertSize($attr['MARGIN-TOP'], $this->mpdf->w, $this->mpdf->FontSize, false); } if (isset($attr['MARGIN-BOTTOM'])) { $mgb = $this->mpdf->ConvertSize($attr['MARGIN-BOTTOM'], $this->mpdf->w, $this->mpdf->FontSize, false); } if (isset($attr['MARGIN-HEADER'])) { $mgh = $this->mpdf->ConvertSize($attr['MARGIN-HEADER'], $this->mpdf->w, $this->mpdf->FontSize, false); } if (isset($attr['MARGIN-FOOTER'])) { $mgf = $this->mpdf->ConvertSize($attr['MARGIN-FOOTER'], $this->mpdf->w, $this->mpdf->FontSize, false); } $ohname = $ehname = $ofname = $efname = ''; if (isset($attr['ODD-HEADER-NAME'])) { $ohname = $attr['ODD-HEADER-NAME']; } if (isset($attr['EVEN-HEADER-NAME'])) { $ehname = $attr['EVEN-HEADER-NAME']; } if (isset($attr['ODD-FOOTER-NAME'])) { $ofname = $attr['ODD-FOOTER-NAME']; } if (isset($attr['EVEN-FOOTER-NAME'])) { $efname = $attr['EVEN-FOOTER-NAME']; } $ohvalue = $ehvalue = $ofvalue = $efvalue = 0; if (isset($attr['ODD-HEADER-VALUE']) && ($attr['ODD-HEADER-VALUE'] == '1' || strtoupper($attr['ODD-HEADER-VALUE']) == 'ON')) { $ohvalue = 1; } else if (isset($attr['ODD-HEADER-VALUE']) && ($attr['ODD-HEADER-VALUE'] == '-1' || strtoupper($attr['ODD-HEADER-VALUE']) == 'OFF')) { $ohvalue = -1; } if (isset($attr['EVEN-HEADER-VALUE']) && ($attr['EVEN-HEADER-VALUE'] == '1' || strtoupper($attr['EVEN-HEADER-VALUE']) == 'ON')) { $ehvalue = 1; } else if (isset($attr['EVEN-HEADER-VALUE']) && ($attr['EVEN-HEADER-VALUE'] == '-1' || strtoupper($attr['EVEN-HEADER-VALUE']) == 'OFF')) { $ehvalue = -1; } if (isset($attr['ODD-FOOTER-VALUE']) && ($attr['ODD-FOOTER-VALUE'] == '1' || strtoupper($attr['ODD-FOOTER-VALUE']) == 'ON')) { $ofvalue = 1; } else if (isset($attr['ODD-FOOTER-VALUE']) && ($attr['ODD-FOOTER-VALUE'] == '-1' || strtoupper($attr['ODD-FOOTER-VALUE']) == 'OFF')) { $ofvalue = -1; } if (isset($attr['EVEN-FOOTER-VALUE']) && ($attr['EVEN-FOOTER-VALUE'] == '1' || strtoupper($attr['EVEN-FOOTER-VALUE']) == 'ON')) { $efvalue = 1; } else if (isset($attr['EVEN-FOOTER-VALUE']) && ($attr['EVEN-FOOTER-VALUE'] == '-1' || strtoupper($attr['EVEN-FOOTER-VALUE']) == 'OFF')) { $efvalue = -1; } if (isset($attr['ORIENTATION']) && (strtoupper($attr['ORIENTATION']) == 'L' || strtoupper($attr['ORIENTATION']) == 'LANDSCAPE')) { $orient = 'L'; } else if (isset($attr['ORIENTATION']) && (strtoupper($attr['ORIENTATION']) == 'P' || strtoupper($attr['ORIENTATION']) == 'PORTRAIT')) { $orient = 'P'; } else { $orient = $this->mpdf->CurOrientation; } if (isset($attr['PAGE-SELECTOR']) && $attr['PAGE-SELECTOR']) { $pagesel = $attr['PAGE-SELECTOR']; } else { $pagesel = ''; } // mPDF 6 pagebreaktype $pagebreaktype = $this->mpdf->defaultPagebreakType; if ($tag == 'FORMFEED') { $pagebreaktype = 'slice'; } // can be overridden by PAGE-BREAK-TYPE $startpage = $this->mpdf->page; if (isset($attr['PAGE-BREAK-TYPE'])) { if (strtolower($attr['PAGE-BREAK-TYPE']) == 'cloneall' || strtolower($attr['PAGE-BREAK-TYPE']) == 'clonebycss' || strtolower($attr['PAGE-BREAK-TYPE']) == 'slice') { $pagebreaktype = strtolower($attr['PAGE-BREAK-TYPE']); } } if ($tag == 'TOCPAGEBREAK') { $pagebreaktype = 'cloneall'; } else if ($this->mpdf->ColActive) { $pagebreaktype = 'cloneall'; } // Any change in headers/footers (may need to _getHtmlHeight), or page size/orientation, @page selector, or margins - force cloneall else if ($mgr !== '' || $mgl !== '' || $mgt !== '' || $mgb !== '' || $mgh !== '' || $mgf !== '' || $ohname !== '' || $ehname !== '' || $ofname !== '' || $efname !== '' || $ohvalue || $ehvalue || $ofvalue || $efvalue || $orient != $this->mpdf->CurOrientation || $newformat || $pagesel) { $pagebreaktype = 'cloneall'; } // mPDF 6 pagebreaktype $this->mpdf->_preForcedPagebreak($pagebreaktype); $this->mpdf->ignorefollowingspaces = true; $resetpagenum = ''; $pagenumstyle = ''; $suppress = ''; if (isset($attr['RESETPAGENUM'])) { $resetpagenum = $attr['RESETPAGENUM']; } if (isset($attr['PAGENUMSTYLE'])) { $pagenumstyle = $attr['PAGENUMSTYLE']; } if (isset($attr['SUPPRESS'])) { $suppress = $attr['SUPPRESS']; } if ($tag == 'TOCPAGEBREAK') { $type = 'NEXT-ODD'; } else if (isset($attr['TYPE'])) { $type = strtoupper($attr['TYPE']); } else { $type = ''; } if ($type == 'E' || $type == 'EVEN') { $this->mpdf->AddPage($orient, 'E', $resetpagenum, $pagenumstyle, $suppress, $mgl, $mgr, $mgt, $mgb, $mgh, $mgf, $ohname, $ehname, $ofname, $efname, $ohvalue, $ehvalue, $ofvalue, $efvalue, $pagesel, $newformat); } else if ($type == 'O' || $type == 'ODD') { $this->mpdf->AddPage($orient, 'O', $resetpagenum, $pagenumstyle, $suppress, $mgl, $mgr, $mgt, $mgb, $mgh, $mgf, $ohname, $ehname, $ofname, $efname, $ohvalue, $ehvalue, $ofvalue, $efvalue, $pagesel, $newformat); } else if ($type == 'NEXT-ODD') { $this->mpdf->AddPage($orient, 'NEXT-ODD', $resetpagenum, $pagenumstyle, $suppress, $mgl, $mgr, $mgt, $mgb, $mgh, $mgf, $ohname, $ehname, $ofname, $efname, $ohvalue, $ehvalue, $ofvalue, $efvalue, $pagesel, $newformat); } else if ($type == 'NEXT-EVEN') { $this->mpdf->AddPage($orient, 'NEXT-EVEN', $resetpagenum, $pagenumstyle, $suppress, $mgl, $mgr, $mgt, $mgb, $mgh, $mgf, $ohname, $ehname, $ofname, $efname, $ohvalue, $ehvalue, $ofvalue, $efvalue, $pagesel, $newformat); } else { $this->mpdf->AddPage($orient, '', $resetpagenum, $pagenumstyle, $suppress, $mgl, $mgr, $mgt, $mgb, $mgh, $mgf, $ohname, $ehname, $ofname, $efname, $ohvalue, $ehvalue, $ofvalue, $efvalue, $pagesel, $newformat); } /* -- TOC -- */ if ($tag == 'TOCPAGEBREAK') { if ($toc_id) { $this->mpdf->tocontents->m_TOC[$toc_id]['TOCmark'] = $this->mpdf->page; } else { $this->mpdf->tocontents->TOCmark = $this->mpdf->page; } } /* -- END TOC -- */ // mPDF 6 pagebreaktype $this->mpdf->_postForcedPagebreak($pagebreaktype, $startpage, $save_blk, $save_blklvl); $this->mpdf->InlineProperties = $save_ilp; $this->mpdf->InlineBDF = $save_bflp; $this->mpdf->InlineBDFctr = $save_bflpc; // mPDF 6 $this->mpdf->restoreInlineProperties($save_silp); break; /* -- TOC -- */ case 'TOCENTRY': if (isset($attr['CONTENT']) && $attr['CONTENT']) { $objattr = array(); $objattr['CONTENT'] = htmlspecialchars_decode($attr['CONTENT'], ENT_QUOTES); $objattr['type'] = 'toc'; $objattr['vertical-align'] = 'T'; if (isset($attr['LEVEL']) && $attr['LEVEL']) { $objattr['toclevel'] = $attr['LEVEL']; } else { $objattr['toclevel'] = 0; } if (isset($attr['NAME']) && $attr['NAME']) { $objattr['toc_id'] = $attr['NAME']; } else { $objattr['toc_id'] = 0; } $e = "\xbb\xa4\xactype=toc,objattr=" . serialize($objattr) . "\xbb\xa4\xac"; if ($this->mpdf->tableLevel) { $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['textbuffer'][] = array($e); } // *TABLES* else { // *TABLES* $this->mpdf->textbuffer[] = array($e); } // *TABLES* } break; /* -- END TOC -- */ /* -- INDEX -- */ case 'INDEXENTRY': if (isset($attr['CONTENT']) && $attr['CONTENT']) { if (isset($attr['XREF']) && $attr['XREF']) { $this->mpdf->IndexEntry(htmlspecialchars_decode($attr['CONTENT'], ENT_QUOTES), $attr['XREF']); break; } $objattr = array(); $objattr['CONTENT'] = htmlspecialchars_decode($attr['CONTENT'], ENT_QUOTES); $objattr['type'] = 'indexentry'; $objattr['vertical-align'] = 'T'; $e = "\xbb\xa4\xactype=indexentry,objattr=" . serialize($objattr) . "\xbb\xa4\xac"; if ($this->mpdf->tableLevel) { $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['textbuffer'][] = array($e); } // *TABLES* else { // *TABLES* $this->mpdf->textbuffer[] = array($e); } // *TABLES* } break; case 'INDEXINSERT': if (isset($attr['COLLATION'])) { $indexCollationLocale = $attr['COLLATION']; } else { $indexCollationLocale = ''; } if (isset($attr['COLLATION-GROUP'])) { $indexCollationGroup = $attr['COLLATION-GROUP']; } else { $indexCollationGroup = ''; } if (isset($attr['USEDIVLETTERS']) && (strtoupper($attr['USEDIVLETTERS']) == 'OFF' || $attr['USEDIVLETTERS'] == -1 || $attr['USEDIVLETTERS'] === '0')) { $usedivletters = 0; } else { $usedivletters = 1; } if (isset($attr['LINKS']) && (strtoupper($attr['LINKS']) == 'ON' || $attr['LINKS'] == 1)) { $links = true; } else { $links = false; } $this->mpdf->InsertIndex($usedivletters, $links, $indexCollationLocale, $indexCollationGroup); break; /* -- END INDEX -- */ /* -- WATERMARK -- */ case 'WATERMARKTEXT': if (isset($attr['CONTENT']) && $attr['CONTENT']) { $txt = htmlspecialchars_decode($attr['CONTENT'], ENT_QUOTES); } else { $txt = ''; } if (isset($attr['ALPHA']) && $attr['ALPHA'] > 0) { $alpha = $attr['ALPHA']; } else { $alpha = -1; } $this->mpdf->SetWatermarkText($txt, $alpha); break; case 'WATERMARKIMAGE': if (isset($attr['SRC'])) { $src = $attr['SRC']; } else { $src = ''; } if (isset($attr['ALPHA']) && $attr['ALPHA'] > 0) { $alpha = $attr['ALPHA']; } else { $alpha = -1; } if (isset($attr['SIZE']) && $attr['SIZE']) { $size = $attr['SIZE']; if (strpos($size, ',')) { $size = explode(',', $size); } } else { $size = 'D'; } if (isset($attr['POSITION']) && $attr['POSITION']) { // mPDF 5.7.2 $pos = $attr['POSITION']; if (strpos($pos, ',')) { $pos = explode(',', $pos); } } else { $pos = 'P'; } $this->mpdf->SetWatermarkImage($src, $alpha, $size, $pos); break; /* -- END WATERMARK -- */ /* -- BOOKMARKS -- */ case 'BOOKMARK': if (isset($attr['CONTENT'])) { $objattr = array(); $objattr['CONTENT'] = htmlspecialchars_decode($attr['CONTENT'], ENT_QUOTES); $objattr['type'] = 'bookmark'; if (isset($attr['LEVEL']) && $attr['LEVEL']) { $objattr['bklevel'] = $attr['LEVEL']; } else { $objattr['bklevel'] = 0; } $e = "\xbb\xa4\xactype=bookmark,objattr=" . serialize($objattr) . "\xbb\xa4\xac"; if ($this->mpdf->tableLevel) { $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['textbuffer'][] = array($e); } // *TABLES* else { // *TABLES* $this->mpdf->textbuffer[] = array($e); } // *TABLES* } break; /* -- END BOOKMARKS -- */ /* -- ANNOTATIONS -- */ case 'ANNOTATION': //if (isset($attr['CONTENT']) && !$this->mpdf->writingHTMLheader && !$this->mpdf->writingHTMLfooter) { // Stops annotations in FixedPos if (isset($attr['CONTENT'])) { $objattr = array(); $objattr['margin_top'] = 0; $objattr['margin_bottom'] = 0; $objattr['margin_left'] = 0; $objattr['margin_right'] = 0; $objattr['width'] = 0; $objattr['height'] = 0; $objattr['border_top']['w'] = 0; $objattr['border_bottom']['w'] = 0; $objattr['border_left']['w'] = 0; $objattr['border_right']['w'] = 0; $objattr['CONTENT'] = htmlspecialchars_decode($attr['CONTENT'], ENT_QUOTES); $objattr['type'] = 'annot'; $objattr['POPUP'] = ''; } else { break; } if (isset($attr['POS-X'])) { $objattr['POS-X'] = $attr['POS-X']; } else { $objattr['POS-X'] = 0; } if (isset($attr['POS-Y'])) { $objattr['POS-Y'] = $attr['POS-Y']; } else { $objattr['POS-Y'] = 0; } if (isset($attr['ICON'])) { $objattr['ICON'] = $attr['ICON']; } else { $objattr['ICON'] = 'Note'; } if (isset($attr['AUTHOR'])) { $objattr['AUTHOR'] = $attr['AUTHOR']; } else if (isset($attr['TITLE'])) { $objattr['AUTHOR'] = $attr['TITLE']; } else { $objattr['AUTHOR'] = ''; } if (isset($attr['FILE'])) { $objattr['FILE'] = $attr['FILE']; } else { $objattr['FILE'] = ''; } if (isset($attr['SUBJECT'])) { $objattr['SUBJECT'] = $attr['SUBJECT']; } else { $objattr['SUBJECT'] = ''; } if (isset($attr['OPACITY']) && $attr['OPACITY'] > 0 && $attr['OPACITY'] <= 1) { $objattr['OPACITY'] = $attr['OPACITY']; } else if ($this->mpdf->annotMargin) { $objattr['OPACITY'] = 1; } else { $objattr['OPACITY'] = $this->mpdf->annotOpacity; } if (isset($attr['COLOR'])) { $cor = $this->mpdf->ConvertColor($attr['COLOR']); if ($cor) { $objattr['COLOR'] = $cor; } else { $objattr['COLOR'] = $this->mpdf->ConvertColor('yellow'); } } else { $objattr['COLOR'] = $this->mpdf->ConvertColor('yellow'); } if (isset($attr['POPUP']) && !empty($attr['POPUP'])) { $pop = preg_split('/\s+/', trim($attr['POPUP'])); if (count($pop) > 1) { $objattr['POPUP'] = $pop; } else { $objattr['POPUP'] = true; } } $e = "\xbb\xa4\xactype=annot,objattr=" . serialize($objattr) . "\xbb\xa4\xac"; if ($this->mpdf->tableLevel) { $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['textbuffer'][] = array($e); } // *TABLES* else { // *TABLES* $this->mpdf->textbuffer[] = array($e); } // *TABLES* break; /* -- END ANNOTATIONS -- */ /* -- COLUMNS -- */ case 'COLUMNS': //added custom-tag if (isset($attr['COLUMN-COUNT']) && ($attr['COLUMN-COUNT'] || $attr['COLUMN-COUNT'] === '0')) { // Close any open block tags for ($b = $this->mpdf->blklvl; $b > 0; $b--) { $this->CloseTag($this->mpdf->blk[$b]['tag'], $ahtml, $ihtml); } if (!empty($this->mpdf->textbuffer)) { //Output previously buffered content $this->mpdf->printbuffer($this->mpdf->textbuffer); $this->mpdf->textbuffer = array(); } if (isset($attr['VALIGN']) && $attr['VALIGN']) { if ($attr['VALIGN'] == 'J') { $valign = 'J'; } else { $valign = $align[$attr['VALIGN']]; } } else { $valign = ''; } if (isset($attr['COLUMN-GAP']) && $attr['COLUMN-GAP']) { $this->mpdf->SetColumns($attr['COLUMN-COUNT'], $valign, $attr['COLUMN-GAP']); } else { $this->mpdf->SetColumns($attr['COLUMN-COUNT'], $valign); } } $this->mpdf->ignorefollowingspaces = true; break; case 'COLUMN_BREAK': //custom-tag case 'COLUMNBREAK': //custom-tag case 'NEWCOLUMN': //custom-tag $this->mpdf->ignorefollowingspaces = true; $this->mpdf->NewColumn(); $this->mpdf->ColumnAdjust = false; // disables all column height adjustment for the page. break; /* -- END COLUMNS -- */ case 'TTZ': $this->mpdf->ttz = true; $this->mpdf->InlineProperties[$tag] = $this->mpdf->saveInlineProperties(); $this->mpdf->setCSS(array('FONT-FAMILY' => 'czapfdingbats', 'FONT-WEIGHT' => 'normal', 'FONT-STYLE' => 'normal'), 'INLINE'); break; case 'TTS': $this->mpdf->tts = true; $this->mpdf->InlineProperties[$tag] = $this->mpdf->saveInlineProperties(); $this->mpdf->setCSS(array('FONT-FAMILY' => 'csymbol', 'FONT-WEIGHT' => 'normal', 'FONT-STYLE' => 'normal'), 'INLINE'); break; case 'TTA': $this->mpdf->tta = true; $this->mpdf->InlineProperties[$tag] = $this->mpdf->saveInlineProperties(); if (in_array($this->mpdf->FontFamily, $this->mpdf->mono_fonts)) { $this->mpdf->setCSS(array('FONT-FAMILY' => 'ccourier'), 'INLINE'); } else if (in_array($this->mpdf->FontFamily, $this->mpdf->serif_fonts)) { $this->mpdf->setCSS(array('FONT-FAMILY' => 'ctimes'), 'INLINE'); } else { $this->mpdf->setCSS(array('FONT-FAMILY' => 'chelvetica'), 'INLINE'); } break; // INLINE PHRASES OR STYLES case 'SUB': case 'SUP': case 'ACRONYM': case 'BIG': case 'SMALL': case 'INS': case 'S': case 'STRIKE': case 'DEL': case 'STRONG': case 'CITE': case 'Q': case 'EM': case 'B': case 'I': case 'U': case 'SAMP': case 'CODE': case 'KBD': case 'TT': case 'VAR': case 'FONT': case 'MARK': case 'TIME': case 'BDO': // mPDF 6 case 'BDI': // mPDF 6 case 'SPAN': /* -- ANNOTATIONS -- */ if ($this->mpdf->title2annots && isset($attr['TITLE'])) { $objattr = array(); $objattr['margin_top'] = 0; $objattr['margin_bottom'] = 0; $objattr['margin_left'] = 0; $objattr['margin_right'] = 0; $objattr['width'] = 0; $objattr['height'] = 0; $objattr['border_top']['w'] = 0; $objattr['border_bottom']['w'] = 0; $objattr['border_left']['w'] = 0; $objattr['border_right']['w'] = 0; $objattr['CONTENT'] = $attr['TITLE']; $objattr['type'] = 'annot'; $objattr['POS-X'] = 0; $objattr['POS-Y'] = 0; $objattr['ICON'] = 'Comment'; $objattr['AUTHOR'] = ''; $objattr['SUBJECT'] = ''; $objattr['OPACITY'] = $this->mpdf->annotOpacity; $objattr['COLOR'] = $this->mpdf->ConvertColor('yellow'); $annot = "\xbb\xa4\xactype=annot,objattr=" . serialize($objattr) . "\xbb\xa4\xac"; } /* -- END ANNOTATIONS -- */ // mPDF 5.7.3 Inline tags if (!isset($this->mpdf->InlineProperties[$tag])) { $this->mpdf->InlineProperties[$tag] = array($this->mpdf->saveInlineProperties()); } else { $this->mpdf->InlineProperties[$tag][] = $this->mpdf->saveInlineProperties(); } if (isset($annot)) { // *ANNOTATIONS* if (!isset($this->mpdf->InlineAnnots[$tag])) { $this->mpdf->InlineAnnots[$tag] = array($annot); } // *ANNOTATIONS* else { $this->mpdf->InlineAnnots[$tag][] = $annot; } // *ANNOTATIONS* } // *ANNOTATIONS* $properties = $this->mpdf->cssmgr->MergeCSS('INLINE', $tag, $attr); if (!empty($properties)) $this->mpdf->setCSS($properties, 'INLINE'); // mPDF 6 Bidirectional formatting for inline elements $bdf = false; $bdf2 = ''; $popd = ''; // Get current direction if (isset($this->mpdf->blk[$this->mpdf->blklvl]['direction'])) { $currdir = $this->mpdf->blk[$this->mpdf->blklvl]['direction']; } else { $currdir = 'ltr'; } if ($this->mpdf->tableLevel && isset($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['direction']) && $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['direction'] == 'rtl') { $currdir = 'rtl'; } if (isset($attr['DIR']) and $attr['DIR'] != '') { $currdir = strtolower($attr['DIR']); } if (isset($properties['DIRECTION'])) { $currdir = strtolower($properties['DIRECTION']); } // mPDF 6 bidi // cf. http://www.w3.org/TR/css3-writing-modes/#unicode-bidi if ($tag == 'BDO') { if (isset($attr['DIR']) and strtolower($attr['DIR']) == 'rtl') { $bdf = 0x202E; $popd = 'RLOPDF'; } // U+202E RLO else if (isset($attr['DIR']) and strtolower($attr['DIR']) == 'ltr') { $bdf = 0x202D; $popd = 'LROPDF'; } // U+202D LRO } else if ($tag == 'BDI') { if (isset($attr['DIR']) and strtolower($attr['DIR']) == 'rtl') { $bdf = 0x2067; $popd = 'RLIPDI'; } // U+2067 RLI else if (isset($attr['DIR']) and strtolower($attr['DIR']) == 'ltr') { $bdf = 0x2066; $popd = 'LRIPDI'; } // U+2066 LRI else { $bdf = 0x2068; $popd = 'FSIPDI'; } // U+2068 FSI } else if (isset($properties ['UNICODE-BIDI']) && strtolower($properties ['UNICODE-BIDI']) == 'bidi-override') { if ($currdir == 'rtl') { $bdf = 0x202E; $popd = 'RLOPDF'; } // U+202E RLO else { $bdf = 0x202D; $popd = 'LROPDF'; } // U+202D LRO } else if (isset($properties ['UNICODE-BIDI']) && strtolower($properties ['UNICODE-BIDI']) == 'embed') { if ($currdir == 'rtl') { $bdf = 0x202B; $popd = 'RLEPDF'; } // U+202B RLE else { $bdf = 0x202A; $popd = 'LREPDF'; } // U+202A LRE } else if (isset($properties ['UNICODE-BIDI']) && strtolower($properties ['UNICODE-BIDI']) == 'isolate') { if ($currdir == 'rtl') { $bdf = 0x2067; $popd = 'RLIPDI'; } // U+2067 RLI else { $bdf = 0x2066; $popd = 'LRIPDI'; } // U+2066 LRI } else if (isset($properties ['UNICODE-BIDI']) && strtolower($properties ['UNICODE-BIDI']) == 'isolate-override') { if ($currdir == 'rtl') { $bdf = 0x2067; $bdf2 = 0x202E; $popd = 'RLIRLOPDFPDI'; } // U+2067 RLI // U+202E RLO else { $bdf = 0x2066; $bdf2 = 0x202D; $popd = 'LRILROPDFPDI'; } // U+2066 LRI // U+202D LRO } else if (isset($properties ['UNICODE-BIDI']) && strtolower($properties ['UNICODE-BIDI']) == 'plaintext') { $bdf = 0x2068; $popd = 'FSIPDI'; // U+2068 FSI } else { if (isset($attr['DIR']) and strtolower($attr['DIR']) == 'rtl') { $bdf = 0x202B; $popd = 'RLEPDF'; } // U+202B RLE else if (isset($attr['DIR']) and strtolower($attr['DIR']) == 'ltr') { $bdf = 0x202A; $popd = 'LREPDF'; } // U+202A LRE } if ($bdf) { // mPDF 5.7.3 Inline tags if (!isset($this->mpdf->InlineBDF[$tag])) { $this->mpdf->InlineBDF[$tag] = array(array($popd, $this->mpdf->InlineBDFctr)); } else { $this->mpdf->InlineBDF[$tag][] = array($popd, $this->mpdf->InlineBDFctr); } $this->mpdf->InlineBDFctr++; if ($bdf2) { $bdf2 = code2utf($bdf); } $this->mpdf->OTLdata = array(); if ($this->mpdf->tableLevel) { $this->mpdf->_saveCellTextBuffer(code2utf($bdf) . $bdf2); } else { $this->mpdf->_saveTextBuffer(code2utf($bdf) . $bdf2); } $this->mpdf->biDirectional = true; } break; case 'A': if (isset($attr['NAME']) and $attr['NAME'] != '') { $e = ''; /* -- BOOKMARKS -- */ if ($this->mpdf->anchor2Bookmark) { $objattr = array(); $objattr['CONTENT'] = htmlspecialchars_decode($attr['NAME'], ENT_QUOTES); $objattr['type'] = 'bookmark'; if (isset($attr['LEVEL']) && $attr['LEVEL']) { $objattr['bklevel'] = $attr['LEVEL']; } else { $objattr['bklevel'] = 0; } $e = "\xbb\xa4\xactype=bookmark,objattr=" . serialize($objattr) . "\xbb\xa4\xac"; } /* -- END BOOKMARKS -- */ if ($this->mpdf->tableLevel) { // *TABLES* $this->mpdf->_saveCellTextBuffer($e, '', $attr['NAME']); // *TABLES* } // *TABLES* else { // *TABLES* $this->mpdf->_saveTextBuffer($e, '', $attr['NAME']); //an internal link (adds a space for recognition) } // *TABLES* } if (isset($attr['HREF'])) { $this->mpdf->InlineProperties['A'] = $this->mpdf->saveInlineProperties(); $properties = $this->mpdf->cssmgr->MergeCSS('INLINE', $tag, $attr); if (!empty($properties)) $this->mpdf->setCSS($properties, 'INLINE'); $this->mpdf->HREF = $attr['HREF']; // mPDF 5.7.4 URLs } break; case 'LEGEND': $this->mpdf->InlineProperties['LEGEND'] = $this->mpdf->saveInlineProperties(); $properties = $this->mpdf->cssmgr->MergeCSS('INLINE', $tag, $attr); if (!empty($properties)) $this->mpdf->setCSS($properties, 'INLINE'); break; case 'PROGRESS': case 'METER': $this->mpdf->inMeter = true; if (isset($attr['MAX']) && $attr['MAX']) { $max = $attr['MAX']; } else { $max = 1; } if (isset($attr['MIN']) && $attr['MIN'] && $tag == 'METER') { $min = $attr['MIN']; } else { $min = 0; } if ($max < $min) { $max = $min; } if (isset($attr['VALUE']) && ($attr['VALUE'] || $attr['VALUE'] === '0')) { $value = $attr['VALUE']; if ($value < $min) { $value = $min; } else if ($value > $max) { $value = $max; } } else { $value = ''; } if (isset($attr['LOW']) && $attr['LOW']) { $low = $attr['LOW']; } else { $low = $min; } if ($low < $min) { $low = $min; } else if ($low > $max) { $low = $max; } if (isset($attr['HIGH']) && $attr['HIGH']) { $high = $attr['HIGH']; } else { $high = $max; } if ($high < $low) { $high = $low; } else if ($high > $max) { $high = $max; } if (isset($attr['OPTIMUM']) && $attr['OPTIMUM']) { $optimum = $attr['OPTIMUM']; } else { $optimum = $min + (($max - $min) / 2); } if ($optimum < $min) { $optimum = $min; } else if ($optimum > $max) { $optimum = $max; } if (isset($attr['TYPE']) && $attr['TYPE']) { $type = $attr['TYPE']; } else { $type = ''; } $objattr = array(); $objattr['margin_top'] = 0; $objattr['margin_bottom'] = 0; $objattr['margin_left'] = 0; $objattr['margin_right'] = 0; $objattr['padding_top'] = 0; $objattr['padding_bottom'] = 0; $objattr['padding_left'] = 0; $objattr['padding_right'] = 0; $objattr['width'] = 0; $objattr['height'] = 0; $objattr['border_top']['w'] = 0; $objattr['border_bottom']['w'] = 0; $objattr['border_left']['w'] = 0; $objattr['border_right']['w'] = 0; $properties = $this->mpdf->cssmgr->MergeCSS('INLINE', $tag, $attr); if (isset($properties ['DISPLAY']) && strtolower($properties ['DISPLAY']) == 'none') { return; } $objattr['visibility'] = 'visible'; if (isset($properties['VISIBILITY'])) { $v = strtolower($properties['VISIBILITY']); if (($v == 'hidden' || $v == 'printonly' || $v == 'screenonly') && $this->mpdf->visibility == 'visible') { $objattr['visibility'] = $v; } } if (isset($properties['MARGIN-TOP'])) { $objattr['margin_top'] = $this->mpdf->ConvertSize($properties['MARGIN-TOP'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['MARGIN-BOTTOM'])) { $objattr['margin_bottom'] = $this->mpdf->ConvertSize($properties['MARGIN-BOTTOM'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['MARGIN-LEFT'])) { $objattr['margin_left'] = $this->mpdf->ConvertSize($properties['MARGIN-LEFT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['MARGIN-RIGHT'])) { $objattr['margin_right'] = $this->mpdf->ConvertSize($properties['MARGIN-RIGHT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['PADDING-TOP'])) { $objattr['padding_top'] = $this->mpdf->ConvertSize($properties['PADDING-TOP'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['PADDING-BOTTOM'])) { $objattr['padding_bottom'] = $this->mpdf->ConvertSize($properties['PADDING-BOTTOM'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['PADDING-LEFT'])) { $objattr['padding_left'] = $this->mpdf->ConvertSize($properties['PADDING-LEFT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['PADDING-RIGHT'])) { $objattr['padding_right'] = $this->mpdf->ConvertSize($properties['PADDING-RIGHT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['BORDER-TOP'])) { $objattr['border_top'] = $this->mpdf->border_details($properties['BORDER-TOP']); } if (isset($properties['BORDER-BOTTOM'])) { $objattr['border_bottom'] = $this->mpdf->border_details($properties['BORDER-BOTTOM']); } if (isset($properties['BORDER-LEFT'])) { $objattr['border_left'] = $this->mpdf->border_details($properties['BORDER-LEFT']); } if (isset($properties['BORDER-RIGHT'])) { $objattr['border_right'] = $this->mpdf->border_details($properties['BORDER-RIGHT']); } if (isset($properties['VERTICAL-ALIGN'])) { $objattr['vertical-align'] = $align[strtolower($properties['VERTICAL-ALIGN'])]; } $w = 0; $h = 0; if (isset($properties['WIDTH'])) $w = $this->mpdf->ConvertSize($properties['WIDTH'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); else if (isset($attr['WIDTH'])) $w = $this->mpdf->ConvertSize($attr['WIDTH'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); if (isset($properties['HEIGHT'])) $h = $this->mpdf->ConvertSize($properties['HEIGHT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); else if (isset($attr['HEIGHT'])) $h = $this->mpdf->ConvertSize($attr['HEIGHT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); if (isset($properties['OPACITY']) && $properties['OPACITY'] > 0 && $properties['OPACITY'] <= 1) { $objattr['opacity'] = $properties['OPACITY']; } if ($this->mpdf->HREF) { if (strpos($this->mpdf->HREF, ".") === false && strpos($this->mpdf->HREF, "@") !== 0) { $href = $this->mpdf->HREF; while (array_key_exists($href, $this->mpdf->internallink)) $href = "#" . $href; $this->mpdf->internallink[$href] = $this->mpdf->AddLink(); $objattr['link'] = $this->mpdf->internallink[$href]; } else { $objattr['link'] = $this->mpdf->HREF; } } $extraheight = $objattr['padding_top'] + $objattr['padding_bottom'] + $objattr['margin_top'] + $objattr['margin_bottom'] + $objattr['border_top']['w'] + $objattr['border_bottom']['w']; $extrawidth = $objattr['padding_left'] + $objattr['padding_right'] + $objattr['margin_left'] + $objattr['margin_right'] + $objattr['border_left']['w'] + $objattr['border_right']['w']; // Image file if (!class_exists('meter', false)) { include(_MPDF_PATH . 'classes/meter.php'); } $this->mpdf->meter = new meter(); $svg = $this->mpdf->meter->makeSVG(strtolower($tag), $type, $value, $max, $min, $optimum, $low, $high); //Save to local file $srcpath = _MPDF_TEMP_PATH . '_tempSVG' . uniqid(rand(1, 100000), true) . '_' . strtolower($tag) . '.svg'; file_put_contents($srcpath, $svg); $orig_srcpath = $srcpath; $this->mpdf->GetFullPath($srcpath); $info = $this->mpdf->_getImage($srcpath, true, true, $orig_srcpath); if (!$info) { $info = $this->mpdf->_getImage($this->mpdf->noImageFile); if ($info) { $srcpath = $this->mpdf->noImageFile; $w = ($info['w'] * (25.4 / $this->mpdf->dpi)); $h = ($info['h'] * (25.4 / $this->mpdf->dpi)); } } if (!$info) break; $objattr['file'] = $srcpath; //Default width and height calculation if needed if ($w == 0 and $h == 0) { // SVG units are pixels $w = $this->mpdf->FontSize / (10 / _MPDFK) * abs($info['w']) / _MPDFK; $h = $this->mpdf->FontSize / (10 / _MPDFK) * abs($info['h']) / _MPDFK; } // IF WIDTH OR HEIGHT SPECIFIED if ($w == 0) $w = abs($h * $info['w'] / $info['h']); if ($h == 0) $h = abs($w * $info['h'] / $info['w']); // Resize to maximum dimensions of page $maxWidth = $this->mpdf->blk[$this->mpdf->blklvl]['inner_width']; $maxHeight = $this->mpdf->h - ($this->mpdf->tMargin + $this->mpdf->bMargin + 1); if ($this->mpdf->fullImageHeight) { $maxHeight = $this->mpdf->fullImageHeight; } if (($w + $extrawidth) > ($maxWidth + 0.0001)) { // mPDF 5.7.4 0.0001 to allow for rounding errors when w==maxWidth $w = $maxWidth - $extrawidth; $h = abs($w * $info['h'] / $info['w']); } if ($h + $extraheight > $maxHeight) { $h = $maxHeight - $extraheight; $w = abs($h * $info['w'] / $info['h']); } $objattr['type'] = 'image'; $objattr['itype'] = $info['type']; $objattr['orig_h'] = $info['h']; $objattr['orig_w'] = $info['w']; $objattr['wmf_x'] = $info['x']; $objattr['wmf_y'] = $info['y']; $objattr['height'] = $h + $extraheight; $objattr['width'] = $w + $extrawidth; $objattr['image_height'] = $h; $objattr['image_width'] = $w; $e = "\xbb\xa4\xactype=image,objattr=" . serialize($objattr) . "\xbb\xa4\xac"; $properties = array(); if ($this->mpdf->tableLevel) { $this->mpdf->_saveCellTextBuffer($e, $this->mpdf->HREF); $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s'] += $objattr['width']; } else { $this->mpdf->_saveTextBuffer($e, $this->mpdf->HREF); } break; case 'BR': // Added mPDF 3.0 Float DIV - CLEAR if (isset($attr['STYLE'])) { $properties = $this->mpdf->cssmgr->readInlineCSS($attr['STYLE']); if (isset($properties['CLEAR'])) { $this->mpdf->ClearFloats(strtoupper($properties['CLEAR']), $this->mpdf->blklvl); } // *CSS-FLOAT* } // mPDF 6 bidi // Inline // If unicode-bidi set, any embedding levels, isolates, or overrides started by the inline box are closed at the br and reopened on the other side $blockpre = ''; $blockpost = ''; if (isset($this->mpdf->blk[$this->mpdf->blklvl]['bidicode'])) { $blockpre = $this->mpdf->_setBidiCodes('end', $this->mpdf->blk[$this->mpdf->blklvl]['bidicode']); $blockpost = $this->mpdf->_setBidiCodes('start', $this->mpdf->blk[$this->mpdf->blklvl]['bidicode']); } // Inline // If unicode-bidi set, any embedding levels, isolates, or overrides started by the inline box are closed at the br and reopened on the other side $inlinepre = ''; $inlinepost = ''; $iBDF = array(); if (count($this->mpdf->InlineBDF)) { foreach ($this->mpdf->InlineBDF AS $k => $ib) { foreach ($ib AS $ib2) { $iBDF[$ib2[1]] = $ib2[0]; } } if (count($iBDF)) { ksort($iBDF); for ($i = count($iBDF) - 1; $i >= 0; $i--) { $inlinepre .= $this->mpdf->_setBidiCodes('end', $iBDF[$i]); } for ($i = 0; $i < count($iBDF); $i++) { $inlinepost .= $this->mpdf->_setBidiCodes('start', $iBDF[$i]); } } } /* -- TABLES -- */ if ($this->mpdf->tableLevel) { if ($this->mpdf->blockjustfinished) { $this->mpdf->_saveCellTextBuffer($blockpre . $inlinepre . "\n" . $inlinepost . $blockpost); } $this->mpdf->_saveCellTextBuffer($blockpre . $inlinepre . "\n" . $inlinepost . $blockpost); if (!isset($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'])) { $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'] = $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s']; } elseif ($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'] < $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s']) { $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'] = $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s']; } $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s'] = 0; // reset } else { /* -- END TABLES -- */ if (count($this->mpdf->textbuffer)) { $this->mpdf->textbuffer[count($this->mpdf->textbuffer) - 1][0] = preg_replace('/ $/', '', $this->mpdf->textbuffer[count($this->mpdf->textbuffer) - 1][0]); if (!empty($this->mpdf->textbuffer[count($this->mpdf->textbuffer) - 1][18])) { $this->mpdf->otl->trimOTLdata($this->mpdf->textbuffer[count($this->mpdf->textbuffer) - 1][18], false, true); } // *OTL* } $this->mpdf->_saveTextBuffer($blockpre . $inlinepre . "\n" . $inlinepost . $blockpost); } // *TABLES* $this->mpdf->ignorefollowingspaces = true; $this->mpdf->blockjustfinished = false; $this->mpdf->linebreakjustfinished = true; break; // *********** BLOCKS ******************** case 'PRE': $this->mpdf->ispre = true; // ADDED - Prevents left trim of textbuffer in printbuffer() case 'DIV': case 'FORM': case 'CENTER': case 'BLOCKQUOTE': case 'ADDRESS': case 'CAPTION': case 'P': case 'H1': case 'H2': case 'H3': case 'H4': case 'H5': case 'H6': case 'DL': case 'DT': case 'DD': case 'UL': // mPDF 6 Lists case 'OL': // mPDF 6 case 'LI': // mPDF 6 case 'FIELDSET': case 'DETAILS': case 'SUMMARY': case 'ARTICLE': case 'ASIDE': case 'FIGURE': case 'FIGCAPTION': case 'FOOTER': case 'HEADER': case 'HGROUP': case 'NAV': case 'SECTION': case 'MAIN': // mPDF 6 Lists $this->mpdf->lastoptionaltag = ''; // mPDF 6 bidi // Block // If unicode-bidi set on current clock, any embedding levels, isolates, or overrides are closed (not inherited) if (isset($this->mpdf->blk[$this->mpdf->blklvl]['bidicode'])) { $blockpost = $this->mpdf->_setBidiCodes('end', $this->mpdf->blk[$this->mpdf->blklvl]['bidicode']); if ($blockpost) { $this->mpdf->OTLdata = array(); if ($this->mpdf->tableLevel) { $this->mpdf->_saveCellTextBuffer($blockpost); } else { $this->mpdf->_saveTextBuffer($blockpost); } } } $p = $this->mpdf->cssmgr->PreviewBlockCSS($tag, $attr); if (isset($p['DISPLAY']) && strtolower($p['DISPLAY']) == 'none') { $this->mpdf->blklvl++; $this->mpdf->blk[$this->mpdf->blklvl]['hide'] = true; $this->mpdf->blk[$this->mpdf->blklvl]['tag'] = $tag; // mPDF 6 return; } if ($tag == 'CAPTION') { // position is written in AdjstHTML if (isset($attr['POSITION']) && strtolower($attr['POSITION']) == 'bottom') { $divpos = 'B'; } else { $divpos = 'T'; } if (isset($attr['ALIGN']) && strtolower($attr['ALIGN']) == 'bottom') { $cappos = 'B'; } else if (isset($p['CAPTION-SIDE']) && strtolower($p['CAPTION-SIDE']) == 'bottom') { $cappos = 'B'; } else { $cappos = 'T'; } if (isset($attr['ALIGN'])) { unset($attr['ALIGN']); } if ($cappos != $divpos) { $this->mpdf->blklvl++; $this->mpdf->blk[$this->mpdf->blklvl]['hide'] = true; $this->mpdf->blk[$this->mpdf->blklvl]['tag'] = $tag; // mPDF 6 return; } } /* -- FORMS -- */ if ($tag == 'FORM') { if (isset($attr['METHOD']) && strtolower($attr['METHOD']) == 'get') { $this->mpdf->mpdfform->formMethod = 'GET'; } else { $this->mpdf->mpdfform->formMethod = 'POST'; } if (isset($attr['ACTION'])) { $this->mpdf->mpdfform->formAction = $attr['ACTION']; } else { $this->mpdf->mpdfform->formAction = ''; } } /* -- END FORMS -- */ /* -- CSS-POSITION -- */ if ((isset($p['POSITION']) && (strtolower($p['POSITION']) == 'fixed' || strtolower($p['POSITION']) == 'absolute')) && $this->mpdf->blklvl == 0) { if ($this->mpdf->inFixedPosBlock) { throw new MpdfException("Cannot nest block with position:fixed or position:absolute"); } $this->mpdf->inFixedPosBlock = true; return; } /* -- END CSS-POSITION -- */ // Start Block $this->mpdf->ignorefollowingspaces = true; if ($this->mpdf->blockjustfinished && !count($this->mpdf->textbuffer) && $this->mpdf->y != $this->mpdf->tMargin && $this->mpdf->collapseBlockMargins) { $lastbottommargin = $this->mpdf->lastblockbottommargin; } else { $lastbottommargin = 0; } $this->mpdf->lastblockbottommargin = 0; $this->mpdf->blockjustfinished = false; $this->mpdf->InlineBDF = array(); // mPDF 6 $this->mpdf->InlineBDFctr = 0; // mPDF 6 $this->mpdf->InlineProperties = array(); $this->mpdf->divbegin = true; $this->mpdf->linebreakjustfinished = false; /* -- TABLES -- */ if ($this->mpdf->tableLevel) { // If already something on the line if ($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s'] > 0 && !$this->mpdf->nestedtablejustfinished) { $this->mpdf->_saveCellTextBuffer("\n"); if (!isset($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'])) { $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'] = $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s']; } elseif ($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'] < $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s']) { $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'] = $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s']; } $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s'] = 0; // reset } // Cannot set block properties inside table - use Bold to indicate h1-h6 if ($tag == 'CENTER' && $this->mpdf->tdbegin) { $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['a'] = $align['center']; } $this->mpdf->InlineProperties['BLOCKINTABLE'] = $this->mpdf->saveInlineProperties(); $properties = $this->mpdf->cssmgr->MergeCSS('', $tag, $attr); if (!empty($properties)) $this->mpdf->setCSS($properties, 'INLINE'); // mPDF 6 Lists if ($tag == 'UL' || $tag == 'OL') { $this->mpdf->listlvl++; if (isset($attr['START'])) { $this->mpdf->listcounter[$this->mpdf->listlvl] = intval($attr['START']) - 1; } else { $this->mpdf->listcounter[$this->mpdf->listlvl] = 0; } $this->mpdf->listitem = array(); if ($tag == 'OL') $this->mpdf->listtype[$this->mpdf->listlvl] = 'decimal'; else if ($tag == 'UL') { if ($this->mpdf->listlvl % 3 == 1) $this->mpdf->listtype[$this->mpdf->listlvl] = 'disc'; elseif ($this->mpdf->listlvl % 3 == 2) $this->mpdf->listtype[$this->mpdf->listlvl] = 'circle'; else $this->mpdf->listtype[$this->mpdf->listlvl] = 'square'; } } // mPDF 6 Lists - in Tables if ($tag == 'LI') { if ($this->mpdf->listlvl == 0) { //in case of malformed HTML code. Example:(...)</p><li>Content</li><p>Paragraph1</p>(...) $this->mpdf->listlvl++; // first depth level $this->mpdf->listcounter[$this->mpdf->listlvl] = 0; } $this->mpdf->listcounter[$this->mpdf->listlvl] ++; $this->mpdf->listitem = array(); //if in table - output here as a tabletextbuffer //position:inside OR position:outside (always output in table as position:inside) switch ($this->mpdf->listtype[$this->mpdf->listlvl]) { case 'upper-alpha': case 'upper-latin': case 'A': $blt = $this->mpdf->dec2alpha($this->mpdf->listcounter[$this->mpdf->listlvl], true) . $this->mpdf->list_number_suffix; break; case 'lower-alpha': case 'lower-latin': case 'a': $blt = $this->mpdf->dec2alpha($this->mpdf->listcounter[$this->mpdf->listlvl], false) . $this->mpdf->list_number_suffix; break; case 'upper-roman': case 'I': $blt = $this->mpdf->dec2roman($this->mpdf->listcounter[$this->mpdf->listlvl], true) . $this->mpdf->list_number_suffix; break; case 'lower-roman': case 'i': $blt = $this->mpdf->dec2roman($this->mpdf->listcounter[$this->mpdf->listlvl], false) . $this->mpdf->list_number_suffix; break; case 'decimal': case '1': $blt = $this->mpdf->listcounter[$this->mpdf->listlvl] . $this->mpdf->list_number_suffix; break; default: if ($this->mpdf->listlvl % 3 == 1 && $this->mpdf->_charDefined($this->mpdf->CurrentFont['cw'], 8226)) { $blt = "\xe2\x80\xa2"; } // &#8226; else if ($this->mpdf->listlvl % 3 == 2 && $this->mpdf->_charDefined($this->mpdf->CurrentFont['cw'], 9900)) { $blt = "\xe2\x9a\xac"; } // &#9900; else if ($this->mpdf->listlvl % 3 == 0 && $this->mpdf->_charDefined($this->mpdf->CurrentFont['cw'], 9642)) { $blt = "\xe2\x96\xaa"; } // &#9642; else { $blt = '-'; } break; } // change to &nbsp; spaces if ($this->mpdf->usingCoreFont) { $ls = str_repeat(chr(160) . chr(160), ($this->mpdf->listlvl - 1) * 2) . $blt . ' '; } else { $ls = str_repeat("\xc2\xa0\xc2\xa0", ($this->mpdf->listlvl - 1) * 2) . $blt . ' '; } $this->mpdf->_saveCellTextBuffer($ls); $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s'] += $this->mpdf->GetStringWidth($ls); } break; } /* -- END TABLES -- */ if ($this->mpdf->lastblocklevelchange == 1) { $blockstate = 1; } // Top margins/padding only else if ($this->mpdf->lastblocklevelchange < 1) { $blockstate = 0; } // NO margins/padding $this->mpdf->printbuffer($this->mpdf->textbuffer, $blockstate); $this->mpdf->textbuffer = array(); $save_blklvl = $this->mpdf->blklvl; $save_blk = $this->mpdf->blk; $this->mpdf->Reset(); $pagesel = ''; /* -- CSS-PAGE -- */ if (isset($p['PAGE'])) { $pagesel = $p['PAGE']; } // mPDF 6 (uses $p - preview of properties so blklvl can be incremented after page-break) /* -- END CSS-PAGE -- */ // If page-box has changed AND/OR PAGE-BREAK-BEFORE // mPDF 6 (uses $p - preview of properties so blklvl can be imcremented after page-break) if (!$this->mpdf->tableLevel && (($pagesel && (!isset($this->mpdf->page_box['current']) || $pagesel != $this->mpdf->page_box['current'])) || (isset($p['PAGE-BREAK-BEFORE']) && $p['PAGE-BREAK-BEFORE']))) { // mPDF 6 pagebreaktype $startpage = $this->mpdf->page; $pagebreaktype = $this->mpdf->defaultPagebreakType; $this->mpdf->lastblocklevelchange = -1; if ($this->mpdf->ColActive) { $pagebreaktype = 'cloneall'; } if ($pagesel && (!isset($this->mpdf->page_box['current']) || $pagesel != $this->mpdf->page_box['current'])) { $pagebreaktype = 'cloneall'; } $this->mpdf->_preForcedPagebreak($pagebreaktype); if (isset($p['PAGE-BREAK-BEFORE'])) { if (strtoupper($p['PAGE-BREAK-BEFORE']) == 'RIGHT') { $this->mpdf->AddPage($this->mpdf->CurOrientation, 'NEXT-ODD', '', '', '', '', '', '', '', '', '', '', '', '', '', 0, 0, 0, 0, $pagesel); } else if (strtoupper($p['PAGE-BREAK-BEFORE']) == 'LEFT') { $this->mpdf->AddPage($this->mpdf->CurOrientation, 'NEXT-EVEN', '', '', '', '', '', '', '', '', '', '', '', '', '', 0, 0, 0, 0, $pagesel); } else if (strtoupper($p['PAGE-BREAK-BEFORE']) == 'ALWAYS') { $this->mpdf->AddPage($this->mpdf->CurOrientation, '', '', '', '', '', '', '', '', '', '', '', '', '', '', 0, 0, 0, 0, $pagesel); } else if ($this->mpdf->page_box['current'] != $pagesel) { $this->mpdf->AddPage($this->mpdf->CurOrientation, '', '', '', '', '', '', '', '', '', '', '', '', '', '', 0, 0, 0, 0, $pagesel); } // *CSS-PAGE* } /* -- CSS-PAGE -- */ // Must Add new page if changed page properties else if (!isset($this->mpdf->page_box['current']) || $pagesel != $this->mpdf->page_box['current']) { $this->mpdf->AddPage($this->mpdf->CurOrientation, '', '', '', '', '', '', '', '', '', '', '', '', '', '', 0, 0, 0, 0, $pagesel); } /* -- END CSS-PAGE -- */ // mPDF 6 pagebreaktype $this->mpdf->_postForcedPagebreak($pagebreaktype, $startpage, $save_blk, $save_blklvl); } // mPDF 6 pagebreaktype - moved after pagebreak $this->mpdf->blklvl++; $currblk = & $this->mpdf->blk[$this->mpdf->blklvl]; $this->mpdf->initialiseBlock($currblk); $prevblk = & $this->mpdf->blk[$this->mpdf->blklvl - 1]; $currblk['tag'] = $tag; $currblk['attr'] = $attr; $properties = $this->mpdf->cssmgr->MergeCSS('BLOCK', $tag, $attr); // mPDF 6 - moved to after page-break-before // mPDF 6 page-break-inside:avoid if (isset($properties['PAGE-BREAK-INSIDE']) && strtoupper($properties['PAGE-BREAK-INSIDE']) == 'AVOID' && !$this->mpdf->ColActive && !$this->mpdf->keep_block_together && !isset($attr['PAGEBREAKAVOIDCHECKED'])) { // avoid re-iterating using PAGEBREAKAVOIDCHECKED; set in CloseTag $currblk['keep_block_together'] = 1; $currblk['array_i'] = $ihtml; // mPDF 6 $this->mpdf->kt_y00 = $this->mpdf->y; $this->mpdf->kt_p00 = $this->mpdf->page; $this->mpdf->keep_block_together = 1; } if ($lastbottommargin && isset($properties['MARGIN-TOP']) && $properties['MARGIN-TOP'] && empty($properties['FLOAT'])) { $currblk['lastbottommargin'] = $lastbottommargin; } if (isset($properties['Z-INDEX']) && $this->mpdf->current_layer == 0) { $v = intval($properties['Z-INDEX']); if ($v > 0) { $currblk['z-index'] = $v; $this->mpdf->BeginLayer($v); } } // mPDF 6 Lists // List-type set by attribute if ($tag == 'OL' || $tag == 'UL' || $tag == 'LI') { if (isset($attr['TYPE']) && $attr['TYPE']) { $listtype = $attr['TYPE']; switch ($listtype) { case 'A': $listtype = 'upper-latin'; break; case 'a': $listtype = 'lower-latin'; break; case 'I': $listtype = 'upper-roman'; break; case 'i': $listtype = 'lower-roman'; break; case '1': $listtype = 'decimal'; break; } $currblk['list_style_type'] = $listtype; } } $this->mpdf->setCSS($properties, 'BLOCK', $tag); //name(id/class/style) found in the CSS array! $currblk['InlineProperties'] = $this->mpdf->saveInlineProperties(); if (isset($properties['VISIBILITY'])) { $v = strtolower($properties['VISIBILITY']); if (($v == 'hidden' || $v == 'printonly' || $v == 'screenonly') && $this->mpdf->visibility == 'visible' && !$this->mpdf->tableLevel) { $currblk['visibility'] = $v; $this->mpdf->SetVisibility($v); } } // mPDF 6 if (isset($attr['ALIGN']) && $attr['ALIGN']) { $currblk['block-align'] = $align[strtolower($attr['ALIGN'])]; } if (isset($properties['HEIGHT'])) { $currblk['css_set_height'] = $this->mpdf->ConvertSize($properties['HEIGHT'], ($this->mpdf->h - $this->mpdf->tMargin - $this->mpdf->bMargin), $this->mpdf->FontSize, false); if (($currblk['css_set_height'] + $this->mpdf->y) > $this->mpdf->PageBreakTrigger && $this->mpdf->y > $this->mpdf->tMargin + 5 && $currblk['css_set_height'] < ($this->mpdf->h - ($this->mpdf->tMargin + $this->mpdf->bMargin))) { $this->mpdf->AddPage($this->mpdf->CurOrientation); } } else { $currblk['css_set_height'] = false; } // Added mPDF 3.0 Float DIV if (isset($prevblk['blockContext'])) { $currblk['blockContext'] = $prevblk['blockContext']; } // *CSS-FLOAT* if (isset($properties['CLEAR'])) { $this->mpdf->ClearFloats(strtoupper($properties['CLEAR']), $this->mpdf->blklvl - 1); } // *CSS-FLOAT* $container_w = $prevblk['inner_width']; $bdr = $currblk['border_right']['w']; $bdl = $currblk['border_left']['w']; $pdr = $currblk['padding_right']; $pdl = $currblk['padding_left']; if (isset($currblk['css_set_width'])) { $setwidth = $currblk['css_set_width']; } else { $setwidth = 0; } /* -- CSS-FLOAT -- */ if (isset($properties['FLOAT']) && strtoupper($properties['FLOAT']) == 'RIGHT' && !$this->mpdf->ColActive) { // Cancel Keep-Block-together $currblk['keep_block_together'] = false; $this->mpdf->kt_y00 = ''; $this->mpdf->keep_block_together = 0; $this->mpdf->blockContext++; $currblk['blockContext'] = $this->mpdf->blockContext; list($l_exists, $r_exists, $l_max, $r_max, $l_width, $r_width) = $this->mpdf->GetFloatDivInfo($this->mpdf->blklvl - 1); // DIV is too narrow for text to fit! $maxw = $container_w - $l_width - $r_width; if (($setwidth + $currblk['margin_right'] + $bdl + $pdl + $bdr + $pdr) > $maxw || ($maxw - ($currblk['margin_right'] + $bdl + $pdl + $bdr + $pdr)) < (2 * $this->mpdf->GetCharWidth('W', false))) { // Too narrow to fit - try to move down past L or R float if ($l_max < $r_max && ($setwidth + $currblk['margin_right'] + $bdl + $pdl + $bdr + $pdr) <= ($container_w - $r_width) && (($container_w - $r_width) - ($currblk['margin_right'] + $bdl + $pdl + $bdr + $pdr)) > (2 * $this->mpdf->GetCharWidth('W', false))) { $this->mpdf->ClearFloats('LEFT', $this->mpdf->blklvl - 1); } else if ($r_max < $l_max && ($setwidth + $currblk['margin_right'] + $bdl + $pdl + $bdr + $pdr) <= ($container_w - $l_width) && (($container_w - $l_width) - ($currblk['margin_right'] + $bdl + $pdl + $bdr + $pdr)) > (2 * $this->mpdf->GetCharWidth('W', false))) { $this->mpdf->ClearFloats('RIGHT', $this->mpdf->blklvl - 1); } else { $this->mpdf->ClearFloats('BOTH', $this->mpdf->blklvl - 1); } list($l_exists, $r_exists, $l_max, $r_max, $l_width, $r_width) = $this->mpdf->GetFloatDivInfo($this->mpdf->blklvl - 1); } if ($r_exists) { $currblk['margin_right'] += $r_width; } $currblk['float'] = 'R'; $currblk['float_start_y'] = $this->mpdf->y; if ($currblk['css_set_width']) { $currblk['margin_left'] = $container_w - ($setwidth + $bdl + $pdl + $bdr + $pdr + $currblk['margin_right']); $currblk['float_width'] = ($setwidth + $bdl + $pdl + $bdr + $pdr + $currblk['margin_right']); } else { // *** If no width set - would need to buffer and keep track of max width, then Right-align if not full width // and do borders and backgrounds - For now - just set to maximum width left if ($l_exists) { $currblk['margin_left'] += $l_width; } $currblk['css_set_width'] = $container_w - ($currblk['margin_left'] + $currblk['margin_right'] + $bdl + $pdl + $bdr + $pdr); $currblk['float_width'] = ($currblk['css_set_width'] + $bdl + $pdl + $bdr + $pdr + $currblk['margin_right']); } } else if (isset($properties['FLOAT']) && strtoupper($properties['FLOAT']) == 'LEFT' && !$this->mpdf->ColActive) { // Cancel Keep-Block-together $currblk['keep_block_together'] = false; $this->mpdf->kt_y00 = ''; $this->mpdf->keep_block_together = 0; $this->mpdf->blockContext++; $currblk['blockContext'] = $this->mpdf->blockContext; list($l_exists, $r_exists, $l_max, $r_max, $l_width, $r_width) = $this->mpdf->GetFloatDivInfo($this->mpdf->blklvl - 1); // DIV is too narrow for text to fit! $maxw = $container_w - $l_width - $r_width; if (($setwidth + $currblk['margin_left'] + $bdl + $pdl + $bdr + $pdr) > $maxw || ($maxw - ($currblk['margin_left'] + $bdl + $pdl + $bdr + $pdr)) < (2 * $this->mpdf->GetCharWidth('W', false))) { // Too narrow to fit - try to move down past L or R float if ($l_max < $r_max && ($setwidth + $currblk['margin_right'] + $bdl + $pdl + $bdr + $pdr) <= ($container_w - $r_width) && (($container_w - $r_width) - ($currblk['margin_right'] + $bdl + $pdl + $bdr + $pdr)) > (2 * $this->mpdf->GetCharWidth('W', false))) { $this->mpdf->ClearFloats('LEFT', $this->mpdf->blklvl - 1); } else if ($r_max < $l_max && ($setwidth + $currblk['margin_right'] + $bdl + $pdl + $bdr + $pdr) <= ($container_w - $l_width) && (($container_w - $l_width) - ($currblk['margin_right'] + $bdl + $pdl + $bdr + $pdr)) > (2 * $this->mpdf->GetCharWidth('W', false))) { $this->mpdf->ClearFloats('RIGHT', $this->mpdf->blklvl - 1); } else { $this->mpdf->ClearFloats('BOTH', $this->mpdf->blklvl - 1); } list($l_exists, $r_exists, $l_max, $r_max, $l_width, $r_width) = $this->mpdf->GetFloatDivInfo($this->mpdf->blklvl - 1); } if ($l_exists) { $currblk['margin_left'] += $l_width; } $currblk['float'] = 'L'; $currblk['float_start_y'] = $this->mpdf->y; if ($setwidth) { $currblk['margin_right'] = $container_w - ($setwidth + $bdl + $pdl + $bdr + $pdr + $currblk['margin_left']); $currblk['float_width'] = ($setwidth + $bdl + $pdl + $bdr + $pdr + $currblk['margin_left']); } else { // *** If no width set - would need to buffer and keep track of max width, then Right-align if not full width // and do borders and backgrounds - For now - just set to maximum width left if ($r_exists) { $currblk['margin_right'] += $r_width; } $currblk['css_set_width'] = $container_w - ($currblk['margin_left'] + $currblk['margin_right'] + $bdl + $pdl + $bdr + $pdr); $currblk['float_width'] = ($currblk['css_set_width'] + $bdl + $pdl + $bdr + $pdr + $currblk['margin_left']); } } else { // Don't allow overlap - if floats present - adjust padding to avoid overlap with Floats list($l_exists, $r_exists, $l_max, $r_max, $l_width, $r_width) = $this->mpdf->GetFloatDivInfo($this->mpdf->blklvl - 1); $maxw = $container_w - $l_width - $r_width; if (($setwidth + $currblk['margin_left'] + $currblk['margin_right'] + $bdl + $pdl + $bdr + $pdr) > $maxw || ($maxw - ($currblk['margin_right'] + $currblk['margin_left'] + $bdl + $pdl + $bdr + $pdr)) < (2 * $this->mpdf->GetCharWidth('W', false))) { // Too narrow to fit - try to move down past L or R float if ($l_max < $r_max && ($setwidth + $currblk['margin_left'] + $currblk['margin_right'] + $bdl + $pdl + $bdr + $pdr) <= ($container_w - $r_width) && (($container_w - $r_width) - ($currblk['margin_right'] + $currblk['margin_left'] + $bdl + $pdl + $bdr + $pdr)) > (2 * $this->mpdf->GetCharWidth('W', false))) { $this->mpdf->ClearFloats('LEFT', $this->mpdf->blklvl - 1); } else if ($r_max < $l_max && ($setwidth + $currblk['margin_left'] + $currblk['margin_right'] + $bdl + $pdl + $bdr + $pdr) <= ($container_w - $l_width) && (($container_w - $l_width) - ($currblk['margin_right'] + $currblk['margin_left'] + $bdl + $pdl + $bdr + $pdr)) > (2 * $this->mpdf->GetCharWidth('W', false))) { $this->mpdf->ClearFloats('RIGHT', $this->mpdf->blklvl - 1); } else { $this->mpdf->ClearFloats('BOTH', $this->mpdf->blklvl - 1); } list($l_exists, $r_exists, $l_max, $r_max, $l_width, $r_width) = $this->mpdf->GetFloatDivInfo($this->mpdf->blklvl - 1); } if ($r_exists) { $currblk['padding_right'] = max(($r_width - $currblk['margin_right'] - $bdr), $pdr); } if ($l_exists) { $currblk['padding_left'] = max(($l_width - $currblk['margin_left'] - $bdl), $pdl); } } /* -- END CSS-FLOAT -- */ /* -- BORDER-RADIUS -- */ // Automatically increase padding if required for border-radius if ($this->mpdf->autoPadding && !$this->mpdf->ColActive) { if ($currblk['border_radius_TL_H'] > $currblk['padding_left'] && $currblk['border_radius_TL_V'] > $currblk['padding_top']) { if ($currblk['border_radius_TL_H'] > $currblk['border_radius_TL_V']) { $this->mpdf->_borderPadding($currblk['border_radius_TL_H'], $currblk['border_radius_TL_V'], $currblk['padding_left'], $currblk['padding_top']); } else { $this->mpdf->_borderPadding($currblk['border_radius_TL_V'], $currblk['border_radius_TL_H'], $currblk['padding_top'], $currblk['padding_left']); } } if ($currblk['border_radius_TR_H'] > $currblk['padding_right'] && $currblk['border_radius_TR_V'] > $currblk['padding_top']) { if ($currblk['border_radius_TR_H'] > $currblk['border_radius_TR_V']) { $this->mpdf->_borderPadding($currblk['border_radius_TR_H'], $currblk['border_radius_TR_V'], $currblk['padding_right'], $currblk['padding_top']); } else { $this->mpdf->_borderPadding($currblk['border_radius_TR_V'], $currblk['border_radius_TR_H'], $currblk['padding_top'], $currblk['padding_right']); } } if ($currblk['border_radius_BL_H'] > $currblk['padding_left'] && $currblk['border_radius_BL_V'] > $currblk['padding_bottom']) { if ($currblk['border_radius_BL_H'] > $currblk['border_radius_BL_V']) { $this->mpdf->_borderPadding($currblk['border_radius_BL_H'], $currblk['border_radius_BL_V'], $currblk['padding_left'], $currblk['padding_bottom']); } else { $this->mpdf->_borderPadding($currblk['border_radius_BL_V'], $currblk['border_radius_BL_H'], $currblk['padding_bottom'], $currblk['padding_left']); } } if ($currblk['border_radius_BR_H'] > $currblk['padding_right'] && $currblk['border_radius_BR_V'] > $currblk['padding_bottom']) { if ($currblk['border_radius_BR_H'] > $currblk['border_radius_BR_V']) { $this->mpdf->_borderPadding($currblk['border_radius_BR_H'], $currblk['border_radius_BR_V'], $currblk['padding_right'], $currblk['padding_bottom']); } else { $this->mpdf->_borderPadding($currblk['border_radius_BR_V'], $currblk['border_radius_BR_H'], $currblk['padding_bottom'], $currblk['padding_right']); } } } /* -- END BORDER-RADIUS -- */ // Hanging indent - if negative indent: ensure padding is >= indent if (!isset($currblk['text_indent'])) { $currblk['text_indent'] = null; } if (!isset($currblk['inner_width'])) { $currblk['inner_width'] = null; } $cbti = $this->mpdf->ConvertSize($currblk['text_indent'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); if ($cbti < 0) { $hangind = -($cbti); if (isset($currblk['direction']) && $currblk['direction'] == 'rtl') { // *OTL* $currblk['padding_right'] = max($currblk['padding_right'], $hangind); // *OTL* } // *OTL* else { // *OTL* $currblk['padding_left'] = max($currblk['padding_left'], $hangind); } // *OTL* } if (isset($currblk['css_set_width'])) { if (isset($properties['MARGIN-LEFT']) && isset($properties['MARGIN-RIGHT']) && strtolower($properties['MARGIN-LEFT']) == 'auto' && strtolower($properties['MARGIN-RIGHT']) == 'auto') { // Try to reduce margins to accomodate - if still too wide, set margin-right/left=0 (reduces width) $anyextra = $prevblk['inner_width'] - ($currblk['css_set_width'] + $currblk['border_left']['w'] + $currblk['padding_left'] + $currblk['border_right']['w'] + $currblk['padding_right']); if ($anyextra > 0) { $currblk['margin_left'] = $currblk['margin_right'] = $anyextra / 2; } else { $currblk['margin_left'] = $currblk['margin_right'] = 0; } } else if (isset($properties['MARGIN-LEFT']) && strtolower($properties['MARGIN-LEFT']) == 'auto') { // Try to reduce margin-left to accomodate - if still too wide, set margin-left=0 (reduces width) $currblk['margin_left'] = $prevblk['inner_width'] - ($currblk['css_set_width'] + $currblk['border_left']['w'] + $currblk['padding_left'] + $currblk['border_right']['w'] + $currblk['padding_right'] + $currblk['margin_right']); if ($currblk['margin_left'] < 0) { $currblk['margin_left'] = 0; } } else if (isset($properties['MARGIN-RIGHT']) && strtolower($properties['MARGIN-RIGHT']) == 'auto') { // Try to reduce margin-right to accomodate - if still too wide, set margin-right=0 (reduces width) $currblk['margin_right'] = $prevblk['inner_width'] - ($currblk['css_set_width'] + $currblk['border_left']['w'] + $currblk['padding_left'] + $currblk['border_right']['w'] + $currblk['padding_right'] + $currblk['margin_left']); if ($currblk['margin_right'] < 0) { $currblk['margin_right'] = 0; } } else { if ($currblk['direction'] == 'rtl') { // *OTL* // Try to reduce margin-left to accomodate - if still too wide, set margin-left=0 (reduces width) $currblk['margin_left'] = $prevblk['inner_width'] - ($currblk['css_set_width'] + $currblk['border_left']['w'] + $currblk['padding_left'] + $currblk['border_right']['w'] + $currblk['padding_right'] + $currblk['margin_right']); // *OTL* if ($currblk['margin_left'] < 0) { // *OTL* $currblk['margin_left'] = 0; // *OTL* } // *OTL* } // *OTL* else { // *OTL* // Try to reduce margin-right to accomodate - if still too wide, set margin-right=0 (reduces width) $currblk['margin_right'] = $prevblk['inner_width'] - ($currblk['css_set_width'] + $currblk['border_left']['w'] + $currblk['padding_left'] + $currblk['border_right']['w'] + $currblk['padding_right'] + $currblk['margin_left']); if ($currblk['margin_right'] < 0) { $currblk['margin_right'] = 0; } } // *OTL* } } $currblk['outer_left_margin'] = $prevblk['outer_left_margin'] + $currblk['margin_left'] + $prevblk['border_left']['w'] + $prevblk['padding_left']; $currblk['outer_right_margin'] = $prevblk['outer_right_margin'] + $currblk['margin_right'] + $prevblk['border_right']['w'] + $prevblk['padding_right']; $currblk['width'] = $this->mpdf->pgwidth - ($currblk['outer_right_margin'] + $currblk['outer_left_margin']); $currblk['inner_width'] = $currblk['width'] - ($currblk['border_left']['w'] + $currblk['padding_left'] + $currblk['border_right']['w'] + $currblk['padding_right']); // Check DIV is not now too narrow to fit text $mw = 2 * $this->mpdf->GetCharWidth('W', false); if ($currblk['inner_width'] < $mw) { $currblk['padding_left'] = 0; $currblk['padding_right'] = 0; $currblk['border_left']['w'] = 0.2; $currblk['border_right']['w'] = 0.2; $currblk['margin_left'] = 0; $currblk['margin_right'] = 0; $currblk['outer_left_margin'] = $prevblk['outer_left_margin'] + $currblk['margin_left'] + $prevblk['border_left']['w'] + $prevblk['padding_left']; $currblk['outer_right_margin'] = $prevblk['outer_right_margin'] + $currblk['margin_right'] + $prevblk['border_right']['w'] + $prevblk['padding_right']; $currblk['width'] = $this->mpdf->pgwidth - ($currblk['outer_right_margin'] + $currblk['outer_left_margin']); $currblk['inner_width'] = $this->mpdf->pgwidth - ($currblk['outer_right_margin'] + $currblk['outer_left_margin'] + $currblk['border_left']['w'] + $currblk['padding_left'] + $currblk['border_right']['w'] + $currblk['padding_right']); // if ($currblk['inner_width'] < $mw) { throw new MpdfException("DIV is too narrow for text to fit!"); } } $this->mpdf->x = $this->mpdf->lMargin + $currblk['outer_left_margin']; /* -- BACKGROUNDS -- */ if (isset($properties['BACKGROUND-IMAGE']) && $properties['BACKGROUND-IMAGE'] && !$this->mpdf->kwt && !$this->mpdf->ColActive && !$this->mpdf->keep_block_together) { $ret = $this->mpdf->SetBackground($properties, $currblk['inner_width']); if ($ret) { $currblk['background-image'] = $ret; } } /* -- END BACKGROUNDS -- */ /* -- TABLES -- */ if ($this->mpdf->use_kwt && isset($attr['KEEP-WITH-TABLE']) && !$this->mpdf->ColActive && !$this->mpdf->keep_block_together) { $this->mpdf->kwt = true; $this->mpdf->kwt_y0 = $this->mpdf->y; //$this->mpdf->kwt_x0 = $this->mpdf->x; $this->mpdf->kwt_x0 = $this->mpdf->lMargin; // mPDF 6 $this->mpdf->kwt_height = 0; $this->mpdf->kwt_buffer = array(); $this->mpdf->kwt_Links = array(); $this->mpdf->kwt_Annots = array(); $this->mpdf->kwt_moved = false; $this->mpdf->kwt_saved = false; $this->mpdf->kwt_Reference = array(); $this->mpdf->kwt_BMoutlines = array(); $this->mpdf->kwt_toc = array(); } else { /* -- END TABLES -- */ $this->mpdf->kwt = false; } // *TABLES* //Save x,y coords in case we need to print borders... $currblk['y0'] = $this->mpdf->y; $currblk['initial_y0'] = $this->mpdf->y; // mPDF 6 $currblk['x0'] = $this->mpdf->x; $currblk['initial_x0'] = $this->mpdf->x; // mPDF 6 $currblk['initial_startpage'] = $this->mpdf->page; $currblk['startpage'] = $this->mpdf->page; // mPDF 6 $this->mpdf->oldy = $this->mpdf->y; $this->mpdf->lastblocklevelchange = 1; // mPDF 6 Lists if ($tag == 'OL' || $tag == 'UL') { $this->mpdf->listlvl++; if (isset($attr['START']) && $attr['START']) { $this->mpdf->listcounter[$this->mpdf->listlvl] = intval($attr['START']) - 1; } else { $this->mpdf->listcounter[$this->mpdf->listlvl] = 0; } $this->mpdf->listitem = array(); // List-type if (!isset($currblk['list_style_type']) || !$currblk['list_style_type']) { if ($tag == 'OL') $currblk['list_style_type'] = 'decimal'; else if ($tag == 'UL') { if ($this->mpdf->listlvl % 3 == 1) $currblk['list_style_type'] = 'disc'; elseif ($this->mpdf->listlvl % 3 == 2) $currblk['list_style_type'] = 'circle'; else $currblk['list_style_type'] = 'square'; } } // List-image if (!isset($currblk['list_style_image']) || !$currblk['list_style_image']) { $currblk['list_style_image'] = 'none'; } // List-position if (!isset($currblk['list_style_position']) || !$currblk['list_style_position']) { $currblk['list_style_position'] = 'outside'; } // Default indentation using padding if (strtolower($this->mpdf->list_auto_mode) == 'mpdf' && isset($currblk['list_style_position']) && $currblk['list_style_position'] == 'outside' && isset($currblk['list_style_image']) && $currblk['list_style_image'] == 'none' && (!isset($currblk['list_style_type']) || !preg_match('/U\+([a-fA-F0-9]+)/i', $currblk['list_style_type']))) { $autopadding = $this->mpdf->_getListMarkerWidth($currblk, $ahtml, $ihtml); if ($this->mpdf->listlvl > 1 || $this->mpdf->list_indent_first_level) { $autopadding += $this->mpdf->ConvertSize($this->mpdf->list_indent_default_mpdf, $currblk['inner_width'], $this->mpdf->FontSize, false); } // autopadding value is applied to left or right according // to dir of block. Once a CSS value is set for padding it overrides this default value. if (isset($properties['PADDING-RIGHT']) && $properties['PADDING-RIGHT'] == 'auto' && isset($currblk['direction']) && $currblk['direction'] == 'rtl') { $currblk['padding_right'] = $autopadding; } else if (isset($properties['PADDING-LEFT']) && $properties['PADDING-LEFT'] == 'auto') { $currblk['padding_left'] = $autopadding; } } else { // Initial default value is set by $this->mpdf->list_indent_default in config.php; this value is applied to left or right according // to dir of block. Once a CSS value is set for padding it overrides this default value. if (isset($properties['PADDING-RIGHT']) && $properties['PADDING-RIGHT'] == 'auto' && isset($currblk['direction']) && $currblk['direction'] == 'rtl') { $currblk['padding_right'] = $this->mpdf->ConvertSize($this->mpdf->list_indent_default, $currblk['inner_width'], $this->mpdf->FontSize, false); } else if (isset($properties['PADDING-LEFT']) && $properties['PADDING-LEFT'] == 'auto') { $currblk['padding_left'] = $this->mpdf->ConvertSize($this->mpdf->list_indent_default, $currblk['inner_width'], $this->mpdf->FontSize, false); } } } // mPDF 6 Lists if ($tag == 'LI') { if ($this->mpdf->listlvl == 0) { //in case of malformed HTML code. Example:(...)</p><li>Content</li><p>Paragraph1</p>(...) $this->mpdf->listlvl++; // first depth level $this->mpdf->listcounter[$this->mpdf->listlvl] = 0; } $this->mpdf->listcounter[$this->mpdf->listlvl] ++; $this->mpdf->listitem = array(); // Listitem-type $this->mpdf->_setListMarker($currblk['list_style_type'], $currblk['list_style_image'], $currblk['list_style_position']); } // mPDF 6 Bidirectional formatting for block elements $bdf = false; $bdf2 = ''; $popd = ''; // Get current direction if (isset($currblk['direction'])) { $currdir = $currblk['direction']; } else { $currdir = 'ltr'; } if (isset($attr['DIR']) and $attr['DIR'] != '') { $currdir = strtolower($attr['DIR']); } if (isset($properties['DIRECTION'])) { $currdir = strtolower($properties['DIRECTION']); } // mPDF 6 bidi // cf. http://www.w3.org/TR/css3-writing-modes/#unicode-bidi if (isset($properties ['UNICODE-BIDI']) && (strtolower($properties ['UNICODE-BIDI']) == 'bidi-override' || strtolower($properties ['UNICODE-BIDI']) == 'isolate-override')) { if ($currdir == 'rtl') { $bdf = 0x202E; $popd = 'RLOPDF'; } // U+202E RLO else { $bdf = 0x202D; $popd = 'LROPDF'; } // U+202D LRO } else if (isset($properties ['UNICODE-BIDI']) && strtolower($properties ['UNICODE-BIDI']) == 'plaintext') { $bdf = 0x2068; $popd = 'FSIPDI'; // U+2068 FSI } if ($bdf) { if ($bdf2) { $bdf2 = code2utf($bdf); } $this->mpdf->OTLdata = array(); if ($this->mpdf->tableLevel) { $this->mpdf->_saveCellTextBuffer(code2utf($bdf) . $bdf2); } else { $this->mpdf->_saveTextBuffer(code2utf($bdf) . $bdf2); } $this->mpdf->biDirectional = true; $currblk['bidicode'] = $popd; } break; case 'HR': // Added mPDF 3.0 Float DIV - CLEAR if (isset($attr['STYLE'])) { $properties = $this->mpdf->cssmgr->readInlineCSS($attr['STYLE']); if (isset($properties['CLEAR'])) { $this->mpdf->ClearFloats(strtoupper($properties['CLEAR']), $this->mpdf->blklvl); } // *CSS-FLOAT* } $this->mpdf->ignorefollowingspaces = true; $objattr = array(); $objattr['margin_top'] = 0; $objattr['margin_bottom'] = 0; $objattr['margin_left'] = 0; $objattr['margin_right'] = 0; $objattr['width'] = 0; $objattr['height'] = 0; $objattr['border_top']['w'] = 0; $objattr['border_bottom']['w'] = 0; $objattr['border_left']['w'] = 0; $objattr['border_right']['w'] = 0; $properties = $this->mpdf->cssmgr->MergeCSS('', $tag, $attr); if (isset($properties['MARGIN-TOP'])) { $objattr['margin_top'] = $this->mpdf->ConvertSize($properties['MARGIN-TOP'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['MARGIN-BOTTOM'])) { $objattr['margin_bottom'] = $this->mpdf->ConvertSize($properties['MARGIN-BOTTOM'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['WIDTH'])) { $objattr['width'] = $this->mpdf->ConvertSize($properties['WIDTH'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width']); } else if (isset($attr['WIDTH']) && $attr['WIDTH'] != '') $objattr['width'] = $this->mpdf->ConvertSize($attr['WIDTH'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width']); if (isset($properties['TEXT-ALIGN'])) { $objattr['align'] = $align[strtolower($properties['TEXT-ALIGN'])]; } else if (isset($attr['ALIGN']) && $attr['ALIGN'] != '') $objattr['align'] = $align[strtolower($attr['ALIGN'])]; if (isset($properties['MARGIN-LEFT']) && strtolower($properties['MARGIN-LEFT']) == 'auto') { $objattr['align'] = 'R'; } if (isset($properties['MARGIN-RIGHT']) && strtolower($properties['MARGIN-RIGHT']) == 'auto') { $objattr['align'] = 'L'; if (isset($properties['MARGIN-RIGHT']) && strtolower($properties['MARGIN-RIGHT']) == 'auto' && isset($properties['MARGIN-LEFT']) && strtolower($properties['MARGIN-LEFT']) == 'auto') { $objattr['align'] = 'C'; } } if (isset($properties['COLOR'])) { $objattr['color'] = $this->mpdf->ConvertColor($properties['COLOR']); } else if (isset($attr['COLOR']) && $attr['COLOR'] != '') $objattr['color'] = $this->mpdf->ConvertColor($attr['COLOR']); if (isset($properties['HEIGHT'])) { $objattr['linewidth'] = $this->mpdf->ConvertSize($properties['HEIGHT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } /* -- TABLES -- */ if ($this->mpdf->tableLevel) { $objattr['W-PERCENT'] = 100; if (isset($properties['WIDTH']) && stristr($properties['WIDTH'], '%')) { $properties['WIDTH'] += 0; //make "90%" become simply "90" $objattr['W-PERCENT'] = $properties['WIDTH']; } if (isset($attr['WIDTH']) && stristr($attr['WIDTH'], '%')) { $attr['WIDTH'] += 0; //make "90%" become simply "90" $objattr['W-PERCENT'] = $attr['WIDTH']; } } /* -- END TABLES -- */ $objattr['type'] = 'hr'; $objattr['height'] = $objattr['linewidth'] + $objattr['margin_top'] + $objattr['margin_bottom']; $e = "\xbb\xa4\xactype=image,objattr=" . serialize($objattr) . "\xbb\xa4\xac"; // Clear properties - tidy up $properties = array(); /* -- TABLES -- */ // Output it to buffers if ($this->mpdf->tableLevel) { if (!isset($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'])) { $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'] = $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s']; } elseif ($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'] < $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s']) { $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'] = $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s']; } $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s'] = 0; // reset $this->mpdf->_saveCellTextBuffer($e, $this->mpdf->HREF); } else { /* -- END TABLES -- */ $this->mpdf->_saveTextBuffer($e, $this->mpdf->HREF); } // *TABLES* break; /* -- BARCODES -- */ case 'BARCODE': $this->mpdf->ignorefollowingspaces = false; if (isset($attr['CODE']) && $attr['CODE']) { $objattr = array(); $objattr['margin_top'] = 0; $objattr['margin_bottom'] = 0; $objattr['margin_left'] = 0; $objattr['margin_right'] = 0; $objattr['padding_top'] = 0; $objattr['padding_bottom'] = 0; $objattr['padding_left'] = 0; $objattr['padding_right'] = 0; $objattr['width'] = 0; $objattr['height'] = 0; $objattr['border_top']['w'] = 0; $objattr['border_bottom']['w'] = 0; $objattr['border_left']['w'] = 0; $objattr['border_right']['w'] = 0; $objattr['code'] = $attr['CODE']; if (isset($attr['TYPE'])) { $objattr['btype'] = trim(strtoupper($attr['TYPE'])); } else { $objattr['btype'] = 'EAN13'; } // default if (preg_match('/^(EAN13|ISBN|ISSN|EAN8|UPCA|UPCE)P([25])$/', $objattr['btype'], $m)) { $objattr['btype'] = $m[1]; $objattr['bsupp'] = $m[2]; if (preg_match('/^(\S+)\s+(.*)$/', $objattr['code'], $mm)) { $objattr['code'] = $mm[1]; $objattr['bsupp_code'] = $mm[2]; } } else { $objattr['bsupp'] = 0; } if (isset($attr['TEXT']) && $attr['TEXT'] == 1) { $objattr['showtext'] = 1; } else { $objattr['showtext'] = 0; } if (isset($attr['SIZE']) && $attr['SIZE'] > 0) { $objattr['bsize'] = $attr['SIZE']; } else { $objattr['bsize'] = 1; } if (isset($attr['HEIGHT']) && $attr['HEIGHT'] > 0) { $objattr['bheight'] = $attr['HEIGHT']; } else { $objattr['bheight'] = 1; } if (isset($attr['PR']) && $attr['PR'] > 0) { $objattr['pr_ratio'] = $attr['PR']; } else { $objattr['pr_ratio'] = ''; } $properties = $this->mpdf->cssmgr->MergeCSS('', $tag, $attr); if (isset($properties ['DISPLAY']) && strtolower($properties ['DISPLAY']) == 'none') { return; } if (isset($properties['MARGIN-TOP'])) { $objattr['margin_top'] = $this->mpdf->ConvertSize($properties['MARGIN-TOP'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['MARGIN-BOTTOM'])) { $objattr['margin_bottom'] = $this->mpdf->ConvertSize($properties['MARGIN-BOTTOM'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['MARGIN-LEFT'])) { $objattr['margin_left'] = $this->mpdf->ConvertSize($properties['MARGIN-LEFT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['MARGIN-RIGHT'])) { $objattr['margin_right'] = $this->mpdf->ConvertSize($properties['MARGIN-RIGHT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['PADDING-TOP'])) { $objattr['padding_top'] = $this->mpdf->ConvertSize($properties['PADDING-TOP'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['PADDING-BOTTOM'])) { $objattr['padding_bottom'] = $this->mpdf->ConvertSize($properties['PADDING-BOTTOM'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['PADDING-LEFT'])) { $objattr['padding_left'] = $this->mpdf->ConvertSize($properties['PADDING-LEFT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['PADDING-RIGHT'])) { $objattr['padding_right'] = $this->mpdf->ConvertSize($properties['PADDING-RIGHT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['BORDER-TOP'])) { $objattr['border_top'] = $this->mpdf->border_details($properties['BORDER-TOP']); } if (isset($properties['BORDER-BOTTOM'])) { $objattr['border_bottom'] = $this->mpdf->border_details($properties['BORDER-BOTTOM']); } if (isset($properties['BORDER-LEFT'])) { $objattr['border_left'] = $this->mpdf->border_details($properties['BORDER-LEFT']); } if (isset($properties['BORDER-RIGHT'])) { $objattr['border_right'] = $this->mpdf->border_details($properties['BORDER-RIGHT']); } if (isset($properties['VERTICAL-ALIGN'])) { $objattr['vertical-align'] = $align[strtolower($properties['VERTICAL-ALIGN'])]; } if (isset($properties['COLOR']) && $properties['COLOR'] != '') { $objattr['color'] = $this->mpdf->ConvertColor($properties['COLOR']); } else { $objattr['color'] = false; } if (isset($properties['BACKGROUND-COLOR']) && $properties['BACKGROUND-COLOR'] != '') { $objattr['bgcolor'] = $this->mpdf->ConvertColor($properties['BACKGROUND-COLOR']); } else { $objattr['bgcolor'] = false; } if (!class_exists('PDFBarcode', false)) { include(_MPDF_PATH . 'classes/barcode.php'); } $this->mpdf->barcode = new PDFBarcode(); if ($objattr['btype'] == 'EAN13' || $objattr['btype'] == 'ISBN' || $objattr['btype'] == 'ISSN' || $objattr['btype'] == 'UPCA' || $objattr['btype'] == 'UPCE' || $objattr['btype'] == 'EAN8') { $code = preg_replace('/\-/', '', $objattr['code']); if ($objattr['btype'] == 'ISSN' || $objattr['btype'] == 'ISBN') { $arrcode = $this->mpdf->barcode->getBarcodeArray($code, 'EAN13'); } else { $arrcode = $this->mpdf->barcode->getBarcodeArray($code, $objattr['btype']); } if ($arrcode === false) { throw new MpdfException('Error in barcode string.'); } if ($objattr['bsupp'] == 2 || $objattr['bsupp'] == 5) { // EAN-2 or -5 Supplement $supparrcode = $this->mpdf->barcode->getBarcodeArray($objattr['bsupp_code'], 'EAN' . $objattr['bsupp']); $w = ($arrcode["maxw"] + $arrcode['lightmL'] + $arrcode['lightmR'] + $supparrcode["maxw"] + $supparrcode['sepM']) * $arrcode['nom-X'] * $objattr['bsize']; } else { $w = ($arrcode["maxw"] + $arrcode['lightmL'] + $arrcode['lightmR']) * $arrcode['nom-X'] * $objattr['bsize']; } $h = $arrcode['nom-H'] * $objattr['bsize'] * $objattr['bheight']; // Add height for ISBN string + margin from top of bars if (($objattr['showtext'] && $objattr['btype'] == 'EAN13') || $objattr['btype'] == 'ISBN' || $objattr['btype'] == 'ISSN') { $tisbnm = 1.5 * $objattr['bsize']; // Top margin between TOP TEXT (isbn - if shown) & bars $isbn_fontsize = 2.1 * $objattr['bsize']; $h += $isbn_fontsize + $tisbnm; } } // QR-code else if ($objattr['btype'] == 'QR') { $w = $h = $objattr['bsize'] * 25; // Factor of 25mm (default) $objattr['errorlevel'] = 'L'; if (isset($attr['ERROR'])) { $objattr['errorlevel'] = $attr['ERROR']; } } else if ($objattr['btype'] == 'IMB' || $objattr['btype'] == 'RM4SCC' || $objattr['btype'] == 'KIX' || $objattr['btype'] == 'POSTNET' || $objattr['btype'] == 'PLANET') { $arrcode = $this->mpdf->barcode->getBarcodeArray($objattr['code'], $objattr['btype']); if ($arrcode === false) { throw new MpdfException('Error in barcode string.'); } $w = ($arrcode["maxw"] * $arrcode['nom-X'] * $objattr['bsize']) + $arrcode['quietL'] + $arrcode['quietR']; $h = ($arrcode['nom-H'] * $objattr['bsize']) + (2 * $arrcode['quietTB']); } else if (in_array($objattr['btype'], array('C128A', 'C128B', 'C128C', 'EAN128A', 'EAN128B', 'EAN128C', 'C39', 'C39+', 'C39E', 'C39E+', 'S25', 'S25+', 'I25', 'I25+', 'I25B', 'I25B+', 'C93', 'MSI', 'MSI+', 'CODABAR', 'CODE11'))) { $arrcode = $this->mpdf->barcode->getBarcodeArray($objattr['code'], $objattr['btype'], $objattr['pr_ratio']); if ($arrcode === false) { throw new MpdfException('Error in barcode string.'); } $w = ($arrcode["maxw"] + $arrcode['lightmL'] + $arrcode['lightmR']) * $arrcode['nom-X'] * $objattr['bsize']; $h = ((2 * $arrcode['lightTB'] * $arrcode['nom-X']) + $arrcode['nom-H']) * $objattr['bsize'] * $objattr['bheight']; } else { break; } $extraheight = $objattr['padding_top'] + $objattr['padding_bottom'] + $objattr['margin_top'] + $objattr['margin_bottom'] + $objattr['border_top']['w'] + $objattr['border_bottom']['w']; $extrawidth = $objattr['padding_left'] + $objattr['padding_right'] + $objattr['margin_left'] + $objattr['margin_right'] + $objattr['border_left']['w'] + $objattr['border_right']['w']; $objattr['type'] = 'barcode'; $objattr['height'] = $h + $extraheight; $objattr['width'] = $w + $extrawidth; $objattr['barcode_height'] = $h; $objattr['barcode_width'] = $w; /* -- CSS-IMAGE-FLOAT -- */ if (!$this->mpdf->ColActive && !$this->mpdf->tableLevel && !$this->mpdf->listlvl && !$this->mpdf->kwt) { if (isset($properties['FLOAT']) && (strtoupper($properties['FLOAT']) == 'RIGHT' || strtoupper($properties['FLOAT']) == 'LEFT')) { $objattr['float'] = substr(strtoupper($properties['FLOAT']), 0, 1); } } /* -- END CSS-IMAGE-FLOAT -- */ $e = "\xbb\xa4\xactype=barcode,objattr=" . serialize($objattr) . "\xbb\xa4\xac"; // Clear properties - tidy up $properties = array(); /* -- TABLES -- */ // Output it to buffers if ($this->mpdf->tableLevel) { $this->mpdf->_saveCellTextBuffer($e, $this->mpdf->HREF); $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s'] += $objattr['width']; } else { /* -- END TABLES -- */ $this->mpdf->_saveTextBuffer($e, $this->mpdf->HREF); } // *TABLES* } break; /* -- END BARCODES -- */ // *********** FORM ELEMENTS ******************** /* -- FORMS -- */ case 'SELECT': $this->mpdf->lastoptionaltag = ''; // Save current HTML specified optional endtag $this->mpdf->InlineProperties[$tag] = $this->mpdf->saveInlineProperties(); $properties = $this->mpdf->cssmgr->MergeCSS('', $tag, $attr); if (isset($properties['FONT-FAMILY'])) { $this->mpdf->SetFont($properties['FONT-FAMILY'], $this->mpdf->FontStyle, 0, false); } if (isset($properties['FONT-SIZE'])) { $mmsize = $this->mpdf->ConvertSize($properties['FONT-SIZE'], $this->mpdf->default_font_size / _MPDFK); $this->mpdf->SetFontSize($mmsize * _MPDFK, false); } if (isset($attr['SPELLCHECK']) && strtolower($attr['SPELLCHECK']) == 'true') { $this->mpdf->selectoption['SPELLCHECK'] = true; } if (isset($properties['COLOR'])) { $this->mpdf->selectoption['COLOR'] = $this->mpdf->ConvertColor($properties['COLOR']); } $this->mpdf->specialcontent = "type=select"; if (isset($attr['DISABLED'])) { $this->mpdf->selectoption['DISABLED'] = $attr['DISABLED']; } if (isset($attr['READONLY'])) { $this->mpdf->selectoption['READONLY'] = $attr['READONLY']; } if (isset($attr['REQUIRED'])) { $this->mpdf->selectoption['REQUIRED'] = $attr['REQUIRED']; } if (isset($attr['EDITABLE'])) { $this->mpdf->selectoption['EDITABLE'] = $attr['EDITABLE']; } if (isset($attr['TITLE'])) { $this->mpdf->selectoption['TITLE'] = $attr['TITLE']; } if (isset($attr['MULTIPLE'])) { $this->mpdf->selectoption['MULTIPLE'] = $attr['MULTIPLE']; } if (isset($attr['SIZE']) && $attr['SIZE'] > 1) { $this->mpdf->selectoption['SIZE'] = $attr['SIZE']; } if ($this->mpdf->useActiveForms) { if (isset($attr['NAME'])) { $this->mpdf->selectoption['NAME'] = $attr['NAME']; } if (isset($attr['ONCHANGE'])) { $this->mpdf->selectoption['ONCHANGE'] = $attr['ONCHANGE']; } } $properties = array(); break; case 'OPTION': $this->mpdf->lastoptionaltag = ''; $this->mpdf->selectoption['ACTIVE'] = true; $this->mpdf->selectoption['currentSEL'] = false; if (empty($this->mpdf->selectoption)) { $this->mpdf->selectoption['MAXWIDTH'] = ''; $this->mpdf->selectoption['SELECTED'] = ''; } if (isset($attr['SELECTED'])) { $this->mpdf->selectoption['SELECTED'] = ''; $this->mpdf->selectoption['currentSEL'] = true; } if (isset($attr['VALUE'])) { $attr['VALUE'] = strcode2utf($attr['VALUE']); $attr['VALUE'] = $this->mpdf->lesser_entity_decode($attr['VALUE']); if ($this->mpdf->onlyCoreFonts) $attr['VALUE'] = mb_convert_encoding($attr['VALUE'], $this->mpdf->mb_enc, 'UTF-8'); } $this->mpdf->selectoption['currentVAL'] = $attr['VALUE']; break; case 'TEXTAREA': $objattr = array(); $objattr['margin_top'] = 0; $objattr['margin_bottom'] = 0; $objattr['margin_left'] = 0; $objattr['margin_right'] = 0; $objattr['width'] = 0; $objattr['height'] = 0; $objattr['border_top']['w'] = 0; $objattr['border_bottom']['w'] = 0; $objattr['border_left']['w'] = 0; $objattr['border_right']['w'] = 0; if (isset($attr['DISABLED'])) { $objattr['disabled'] = true; } if (isset($attr['READONLY'])) { $objattr['readonly'] = true; } if (isset($attr['REQUIRED'])) { $objattr['required'] = true; } if (isset($attr['SPELLCHECK']) && strtolower($attr['SPELLCHECK']) == 'true') { $objattr['spellcheck'] = true; } if (isset($attr['TITLE'])) { $objattr['title'] = $attr['TITLE']; if ($this->mpdf->onlyCoreFonts) $objattr['title'] = mb_convert_encoding($objattr['title'], $this->mpdf->mb_enc, 'UTF-8'); } if ($this->mpdf->useActiveForms) { if (isset($attr['NAME'])) { $objattr['fieldname'] = $attr['NAME']; } $this->mpdf->mpdfform->form_element_spacing['textarea']['outer']['v'] = 0; $this->mpdf->mpdfform->form_element_spacing['textarea']['inner']['v'] = 0; if (isset($attr['ONCALCULATE'])) { $objattr['onCalculate'] = $attr['ONCALCULATE']; } else if (isset($attr['ONCHANGE'])) { $objattr['onCalculate'] = $attr['ONCHANGE']; } if (isset($attr['ONVALIDATE'])) { $objattr['onValidate'] = $attr['ONVALIDATE']; } if (isset($attr['ONKEYSTROKE'])) { $objattr['onKeystroke'] = $attr['ONKEYSTROKE']; } if (isset($attr['ONFORMAT'])) { $objattr['onFormat'] = $attr['ONFORMAT']; } } $this->mpdf->InlineProperties[$tag] = $this->mpdf->saveInlineProperties(); $properties = $this->mpdf->cssmgr->MergeCSS('', $tag, $attr); if (isset($properties['FONT-FAMILY'])) { $this->mpdf->SetFont($properties['FONT-FAMILY'], '', 0, false); } if (isset($properties['FONT-SIZE'])) { $mmsize = $this->mpdf->ConvertSize($properties['FONT-SIZE'], $this->mpdf->default_font_size / _MPDFK); $this->mpdf->SetFontSize($mmsize * _MPDFK, false); } if (isset($properties['COLOR'])) { $objattr['color'] = $this->mpdf->ConvertColor($properties['COLOR']); } $objattr['fontfamily'] = $this->mpdf->FontFamily; $objattr['fontsize'] = $this->mpdf->FontSizePt; if ($this->mpdf->useActiveForms) { if (isset($properties['TEXT-ALIGN'])) { $objattr['text_align'] = $align[strtolower($properties['TEXT-ALIGN'])]; } else if (isset($attr['ALIGN'])) { $objattr['text_align'] = $align[strtolower($attr['ALIGN'])]; } if (isset($properties['OVERFLOW']) && strtolower($properties['OVERFLOW']) == 'hidden') { $objattr['donotscroll'] = true; } if (isset($properties['BORDER-TOP-COLOR'])) { $objattr['border-col'] = $this->mpdf->ConvertColor($properties['BORDER-TOP-COLOR']); } if (isset($properties['BACKGROUND-COLOR'])) { $objattr['background-col'] = $this->mpdf->ConvertColor($properties['BACKGROUND-COLOR']); } } $this->mpdf->SetLineHeight('', $this->mpdf->mpdfform->textarea_lineheight); $w = 0; $h = 0; if (isset($properties['WIDTH'])) $w = $this->mpdf->ConvertSize($properties['WIDTH'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); if (isset($properties['HEIGHT'])) $h = $this->mpdf->ConvertSize($properties['HEIGHT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); if (isset($properties['VERTICAL-ALIGN'])) { $objattr['vertical-align'] = $align[strtolower($properties['VERTICAL-ALIGN'])]; } $colsize = 20; //HTML default value $rowsize = 2; //HTML default value if (isset($attr['COLS'])) $colsize = intval($attr['COLS']); if (isset($attr['ROWS'])) $rowsize = intval($attr['ROWS']); $charsize = $this->mpdf->GetCharWidth('w', false); if ($w) { $colsize = round(($w - ($this->mpdf->mpdfform->form_element_spacing['textarea']['outer']['h'] * 2) - ($this->mpdf->mpdfform->form_element_spacing['textarea']['inner']['h'] * 2)) / $charsize); } if ($h) { $rowsize = round(($h - ($this->mpdf->mpdfform->form_element_spacing['textarea']['outer']['v'] * 2) - ($this->mpdf->mpdfform->form_element_spacing['textarea']['inner']['v'] * 2)) / $this->mpdf->lineheight); } $objattr['type'] = 'textarea'; $objattr['width'] = ($colsize * $charsize) + ($this->mpdf->mpdfform->form_element_spacing['textarea']['outer']['h'] * 2) + ($this->mpdf->mpdfform->form_element_spacing['textarea']['inner']['h'] * 2); $objattr['height'] = ($rowsize * $this->mpdf->lineheight) + ($this->mpdf->mpdfform->form_element_spacing['textarea']['outer']['v'] * 2) + ($this->mpdf->mpdfform->form_element_spacing['textarea']['inner']['v'] * 2); $objattr['rows'] = $rowsize; $objattr['cols'] = $colsize; $this->mpdf->specialcontent = serialize($objattr); if ($this->mpdf->tableLevel) { // *TABLES* $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s'] += $objattr['width']; // *TABLES* } // *TABLES* // Clear properties - tidy up $properties = array(); break; // *********** FORM - INPUT ******************** case 'INPUT': $this->mpdf->ignorefollowingspaces = false; if (!isset($attr['TYPE'])) $attr['TYPE'] == 'TEXT'; $objattr = array(); $objattr['margin_top'] = 0; $objattr['margin_bottom'] = 0; $objattr['margin_left'] = 0; $objattr['margin_right'] = 0; $objattr['width'] = 0; $objattr['height'] = 0; $objattr['border_top']['w'] = 0; $objattr['border_bottom']['w'] = 0; $objattr['border_left']['w'] = 0; $objattr['border_right']['w'] = 0; $objattr['type'] = 'input'; if (isset($attr['DISABLED'])) { $objattr['disabled'] = true; } if (isset($attr['READONLY'])) { $objattr['readonly'] = true; } if (isset($attr['REQUIRED'])) { $objattr['required'] = true; } if (isset($attr['SPELLCHECK']) && strtolower($attr['SPELLCHECK']) == 'true') { $objattr['spellcheck'] = true; } if (isset($attr['TITLE'])) { $objattr['title'] = $attr['TITLE']; } else if (isset($attr['ALT'])) { $objattr['title'] = $attr['ALT']; } else $objattr['title'] = ''; $objattr['title'] = strcode2utf($objattr['title']); $objattr['title'] = $this->mpdf->lesser_entity_decode($objattr['title']); if ($this->mpdf->onlyCoreFonts) $objattr['title'] = mb_convert_encoding($objattr['title'], $this->mpdf->mb_enc, 'UTF-8'); if ($this->mpdf->useActiveForms) { if (isset($attr['NAME'])) { $objattr['fieldname'] = $attr['NAME']; } } if (isset($attr['VALUE'])) { $attr['VALUE'] = strcode2utf($attr['VALUE']); $attr['VALUE'] = $this->mpdf->lesser_entity_decode($attr['VALUE']); if ($this->mpdf->onlyCoreFonts) $attr['VALUE'] = mb_convert_encoding($attr['VALUE'], $this->mpdf->mb_enc, 'UTF-8'); $objattr['value'] = $attr['VALUE']; } $this->mpdf->InlineProperties[$tag] = $this->mpdf->saveInlineProperties(); $properties = $this->mpdf->cssmgr->MergeCSS('', $tag, $attr); $objattr['vertical-align'] = ''; if (isset($properties['FONT-FAMILY'])) { $this->mpdf->SetFont($properties['FONT-FAMILY'], $this->mpdf->FontStyle, 0, false); } if (isset($properties['FONT-SIZE'])) { $mmsize = $this->mpdf->ConvertSize($properties['FONT-SIZE'], ($this->mpdf->default_font_size / _MPDFK)); $this->mpdf->SetFontSize($mmsize * _MPDFK, false); } if (isset($properties['COLOR'])) { $objattr['color'] = $this->mpdf->ConvertColor($properties['COLOR']); } $objattr['fontfamily'] = $this->mpdf->FontFamily; $objattr['fontsize'] = $this->mpdf->FontSizePt; if ($this->mpdf->useActiveForms) { if (isset($attr['ALIGN'])) { $objattr['text_align'] = $align[strtolower($attr['ALIGN'])]; } else if (isset($properties['TEXT-ALIGN'])) { $objattr['text_align'] = $align[strtolower($properties['TEXT-ALIGN'])]; } if (isset($properties['BORDER-TOP-COLOR'])) { $objattr['border-col'] = $this->mpdf->ConvertColor($properties['BORDER-TOP-COLOR']); } if (isset($properties['BACKGROUND-COLOR'])) { $objattr['background-col'] = $this->mpdf->ConvertColor($properties['BACKGROUND-COLOR']); } } $type = ''; $texto = ''; $height = $this->mpdf->FontSize; $width = 0; $spacesize = $this->mpdf->GetCharWidth(' ', false); $w = 0; if (isset($properties['WIDTH'])) $w = $this->mpdf->ConvertSize($properties['WIDTH'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width']); if ($properties['VERTICAL-ALIGN']) { $objattr['vertical-align'] = $align[strtolower($properties['VERTICAL-ALIGN'])]; } switch (strtoupper($attr['TYPE'])) { case 'HIDDEN': $this->mpdf->ignorefollowingspaces = true; //Eliminate exceeding left-side spaces if ($this->mpdf->useActiveForms) { $this->mpdf->mpdfform->SetFormText(0, 0, $objattr['fieldname'], $objattr['value'], $objattr['value'], '', 0, '', true); } if ($this->mpdf->InlineProperties[$tag]) { $this->mpdf->restoreInlineProperties($this->mpdf->InlineProperties[$tag]); } unset($this->mpdf->InlineProperties[$tag]); break 2; case 'CHECKBOX': //Draw Checkbox $type = 'CHECKBOX'; if (isset($attr['CHECKED'])) { $objattr['checked'] = true; } else { $objattr['checked'] = false; } $width = $this->mpdf->FontSize; $height = $this->mpdf->FontSize; break; case 'RADIO': //Draw Radio button $type = 'RADIO'; if (isset($attr['CHECKED'])) $objattr['checked'] = true; $width = $this->mpdf->FontSize; $height = $this->mpdf->FontSize; break; /* -- IMAGES-CORE -- */ case 'IMAGE': // Draw an Image button if (isset($attr['SRC'])) { $type = 'IMAGE'; $srcpath = $attr['SRC']; $orig_srcpath = $attr['ORIG_SRC']; // VSPACE and HSPACE converted to margins in MergeCSS if (isset($properties['MARGIN-TOP'])) { $objattr['margin_top'] = $this->mpdf->ConvertSize($properties['MARGIN-TOP'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['MARGIN-BOTTOM'])) { $objattr['margin_bottom'] = $this->mpdf->ConvertSize($properties['MARGIN-BOTTOM'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['MARGIN-LEFT'])) { $objattr['margin_left'] = $this->mpdf->ConvertSize($properties['MARGIN-LEFT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['MARGIN-RIGHT'])) { $objattr['margin_right'] = $this->mpdf->ConvertSize($properties['MARGIN-RIGHT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['BORDER-TOP'])) { $objattr['border_top'] = $this->mpdf->border_details($properties['BORDER-TOP']); } if (isset($properties['BORDER-BOTTOM'])) { $objattr['border_bottom'] = $this->mpdf->border_details($properties['BORDER-BOTTOM']); } if (isset($properties['BORDER-LEFT'])) { $objattr['border_left'] = $this->mpdf->border_details($properties['BORDER-LEFT']); } if (isset($properties['BORDER-RIGHT'])) { $objattr['border_right'] = $this->mpdf->border_details($properties['BORDER-RIGHT']); } $objattr['padding_top'] = 0; $objattr['padding_bottom'] = 0; $objattr['padding_left'] = 0; $objattr['padding_right'] = 0; if (isset($properties['VERTICAL-ALIGN'])) { $objattr['vertical-align'] = $align[strtolower($properties['VERTICAL-ALIGN'])]; } $w = 0; $h = 0; if (isset($properties['WIDTH'])) $w = $this->mpdf->ConvertSize($properties['WIDTH'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width']); if (isset($properties['HEIGHT'])) $h = $this->mpdf->ConvertSize($properties['HEIGHT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width']); $extraheight = $objattr['margin_top'] + $objattr['margin_bottom'] + $objattr['border_top']['w'] + $objattr['border_bottom']['w']; $extrawidth = $objattr['margin_left'] + $objattr['margin_right'] + $objattr['border_left']['w'] + $objattr['border_right']['w']; // Image file $info = $this->mpdf->_getImage($srcpath, true, true, $orig_srcpath); if (!$info) { $info = $this->mpdf->_getImage($this->mpdf->noImageFile); if ($info) { $srcpath = $this->mpdf->noImageFile; $w = ($info['w'] * (25.4 / $this->mpdf->dpi)); $h = ($info['h'] * (25.4 / $this->mpdf->dpi)); } } if (!$info) break; if ($info['cs'] == 'Indexed') { $objattr['Indexed'] = true; } $objattr['file'] = $srcpath; //Default width and height calculation if needed if ($w == 0 and $h == 0) { /* -- IMAGES-WMF -- */ if ($info['type'] == 'wmf') { // WMF units are twips (1/20pt) // divide by 20 to get points // divide by k to get user units $w = abs($info['w']) / (20 * _MPDFK); $h = abs($info['h']) / (20 * _MPDFK); } else /* -- END IMAGES-WMF -- */ if ($info['type'] == 'svg') { // SVG units are pixels $w = abs($info['w']) / _MPDFK; $h = abs($info['h']) / _MPDFK; } else { //Put image at default image dpi $w = ($info['w'] / _MPDFK) * (72 / $this->mpdf->img_dpi); $h = ($info['h'] / _MPDFK) * (72 / $this->mpdf->img_dpi); } if (isset($properties['IMAGE-RESOLUTION'])) { if (preg_match('/from-image/i', $properties['IMAGE-RESOLUTION']) && isset($info['set-dpi']) && $info['set-dpi'] > 0) { $w *= $this->mpdf->img_dpi / $info['set-dpi']; $h *= $this->mpdf->img_dpi / $info['set-dpi']; } else if (preg_match('/(\d+)dpi/i', $properties['IMAGE-RESOLUTION'], $m)) { $dpi = $m[1]; if ($dpi > 0) { $w *= $this->mpdf->img_dpi / $dpi; $h *= $this->mpdf->img_dpi / $dpi; } } } } // IF WIDTH OR HEIGHT SPECIFIED if ($w == 0) $w = $h * $info['w'] / $info['h']; if ($h == 0) $h = $w * $info['h'] / $info['w']; // Resize to maximum dimensions of page $maxWidth = $this->mpdf->blk[$this->mpdf->blklvl]['inner_width']; $maxHeight = $this->mpdf->h - ($this->mpdf->tMargin + $this->mpdf->bMargin + 10); if ($this->mpdf->fullImageHeight) { $maxHeight = $this->mpdf->fullImageHeight; } if (($w + $extrawidth) > ($maxWidth + 0.0001)) { // mPDF 5.7.4 0.0001 to allow for rounding errors when w==maxWidth $w = $maxWidth - $extrawidth; $h = $w * $info['h'] / $info['w']; } if ($h + $extraheight > $maxHeight) { $h = $maxHeight - $extraheight; $w = $h * $info['w'] / $info['h']; } $height = $h + $extraheight; $width = $w + $extrawidth; $objattr['type'] = 'image'; $objattr['itype'] = $info['type']; $objattr['orig_h'] = $info['h']; $objattr['orig_w'] = $info['w']; /* -- IMAGES-WMF -- */ if ($info['type'] == 'wmf') { $objattr['wmf_x'] = $info['x']; $objattr['wmf_y'] = $info['y']; } else /* -- END IMAGES-WMF -- */ if ($info['type'] == 'svg') { $objattr['wmf_x'] = $info['x']; $objattr['wmf_y'] = $info['y']; } $objattr['height'] = $h + $extraheight; $objattr['width'] = $w + $extrawidth; $objattr['image_height'] = $h; $objattr['image_width'] = $w; $objattr['ID'] = $info['i']; $texto = 'X'; if ($this->mpdf->useActiveForms) { if (isset($attr['ONCLICK'])) { $objattr['onClick'] = $attr['ONCLICK']; } $objattr['type'] = 'input'; $type = 'IMAGE'; } break; } /* -- END IMAGES-CORE -- */ case 'BUTTON': // Draw a button case 'SUBMIT': case 'RESET': $type = strtoupper($attr['TYPE']); if ($type == 'IMAGE') { $type = 'BUTTON'; } // src path not found if (isset($attr['NOPRINT'])) { $objattr['noprint'] = true; } if (!isset($attr['VALUE'])) { $objattr['value'] = ucfirst(strtolower($type)); } $texto = " " . $objattr['value'] . " "; $width = $this->mpdf->GetStringWidth($texto) + ($this->mpdf->mpdfform->form_element_spacing['button']['outer']['h'] * 2) + ($this->mpdf->mpdfform->form_element_spacing['button']['inner']['h'] * 2); $height = $this->mpdf->FontSize + ($this->mpdf->mpdfform->form_element_spacing['button']['outer']['v'] * 2) + ($this->mpdf->mpdfform->form_element_spacing['button']['inner']['v'] * 2); if ($this->mpdf->useActiveForms) { if (isset($attr['ONCLICK'])) { $objattr['onClick'] = $attr['ONCLICK']; } } break; case 'PASSWORD': case 'TEXT': default: if ($type == '') { $type = 'TEXT'; } if (strtoupper($attr['TYPE']) == 'PASSWORD') { $type = 'PASSWORD'; } if (isset($attr['VALUE'])) { if ($type == 'PASSWORD') { $num_stars = mb_strlen($attr['VALUE'], $this->mpdf->mb_enc); $texto = str_repeat('*', $num_stars); } else { $texto = $attr['VALUE']; } } $xw = ($this->mpdf->mpdfform->form_element_spacing['input']['outer']['h'] * 2) + ($this->mpdf->mpdfform->form_element_spacing['input']['inner']['h'] * 2); $xh = ($this->mpdf->mpdfform->form_element_spacing['input']['outer']['v'] * 2) + ($this->mpdf->mpdfform->form_element_spacing['input']['inner']['v'] * 2); if ($w) { $width = $w + $xw; } else { $width = (20 * $spacesize) + $xw; } // Default width in chars if (isset($attr['SIZE']) and ctype_digit($attr['SIZE'])) $width = ($attr['SIZE'] * $spacesize) + $xw; $height = $this->mpdf->FontSize + $xh; if (isset($attr['MAXLENGTH']) and ctype_digit($attr['MAXLENGTH'])) $objattr['maxlength'] = $attr['MAXLENGTH']; if ($this->mpdf->useActiveForms) { if (isset($attr['ONCALCULATE'])) { $objattr['onCalculate'] = $attr['ONCALCULATE']; } else if (isset($attr['ONCHANGE'])) { $objattr['onCalculate'] = $attr['ONCHANGE']; } if (isset($attr['ONVALIDATE'])) { $objattr['onValidate'] = $attr['ONVALIDATE']; } if (isset($attr['ONKEYSTROKE'])) { $objattr['onKeystroke'] = $attr['ONKEYSTROKE']; } if (isset($attr['ONFORMAT'])) { $objattr['onFormat'] = $attr['ONFORMAT']; } } break; } $objattr['subtype'] = $type; $objattr['text'] = $texto; $objattr['width'] = $width; $objattr['height'] = $height; $e = "\xbb\xa4\xactype=input,objattr=" . serialize($objattr) . "\xbb\xa4\xac"; // Clear properties - tidy up $properties = array(); /* -- TABLES -- */ // Output it to buffers if ($this->mpdf->tableLevel) { $this->mpdf->_saveCellTextBuffer($e, $this->mpdf->HREF); $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s'] += $objattr['width']; } else { /* -- END TABLES -- */ $this->mpdf->_saveTextBuffer($e, $this->mpdf->HREF); } // *TABLES* if ($this->mpdf->InlineProperties[$tag]) { $this->mpdf->restoreInlineProperties($this->mpdf->InlineProperties[$tag]); } unset($this->mpdf->InlineProperties[$tag]); break; // END of INPUT /* -- END FORMS -- */ // *********** GRAPH ******************** case 'JPGRAPH': if (!$this->mpdf->useGraphs) { break; } if ($attr['TABLE']) { $gid = strtoupper($attr['TABLE']); } else { $gid = '0'; } if (!is_array($this->mpdf->graphs[$gid]) || count($this->mpdf->graphs[$gid]) == 0) { break; } $this->mpdf->ignorefollowingspaces = false; include_once(_MPDF_PATH . 'graph.php'); $this->mpdf->graphs[$gid]['attr'] = $attr; if (isset($this->mpdf->graphs[$gid]['attr']['WIDTH']) && $this->mpdf->graphs[$gid]['attr']['WIDTH']) { $this->mpdf->graphs[$gid]['attr']['cWIDTH'] = $this->mpdf->ConvertSize($this->mpdf->graphs[$gid]['attr']['WIDTH'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width']); } // mm if (isset($this->mpdf->graphs[$gid]['attr']['HEIGHT']) && $this->mpdf->graphs[$gid]['attr']['HEIGHT']) { $this->mpdf->graphs[$gid]['attr']['cHEIGHT'] = $this->mpdf->ConvertSize($this->mpdf->graphs[$gid]['attr']['HEIGHT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width']); } $graph_img = print_graph($this->mpdf->graphs[$gid], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width']); if ($graph_img) { if (isset($attr['ROTATE'])) { if ($attr['ROTATE'] == 90 || $attr['ROTATE'] == -90) { $tmpw = $graph_img['w']; $graph_img['w'] = $graph_img['h']; $graph_img['h'] = $tmpw; } } $attr['SRC'] = $graph_img['file']; $attr['WIDTH'] = $graph_img['w']; $attr['HEIGHT'] = $graph_img['h']; } else { break; } // *********** IMAGE ******************** /* -- IMAGES-CORE -- */ case 'IMG': $this->mpdf->ignorefollowingspaces = false; if ($this->mpdf->progressBar) { $this->mpdf->UpdateProgressBar(1, '', 'IMG'); } // *PROGRESS-BAR* $objattr = array(); $objattr['margin_top'] = 0; $objattr['margin_bottom'] = 0; $objattr['margin_left'] = 0; $objattr['margin_right'] = 0; $objattr['padding_top'] = 0; $objattr['padding_bottom'] = 0; $objattr['padding_left'] = 0; $objattr['padding_right'] = 0; $objattr['width'] = 0; $objattr['height'] = 0; $objattr['border_top']['w'] = 0; $objattr['border_bottom']['w'] = 0; $objattr['border_left']['w'] = 0; $objattr['border_right']['w'] = 0; if (isset($attr['SRC'])) { $srcpath = $attr['SRC']; $orig_srcpath = (isset($attr['ORIG_SRC']) ? $attr['ORIG_SRC'] : ''); $properties = $this->mpdf->cssmgr->MergeCSS('', $tag, $attr); if (isset($properties ['DISPLAY']) && strtolower($properties ['DISPLAY']) == 'none') { return; } if (isset($properties['Z-INDEX']) && $this->mpdf->current_layer == 0) { $v = intval($properties['Z-INDEX']); if ($v > 0) { $objattr['z-index'] = $v; } } $objattr['visibility'] = 'visible'; if (isset($properties['VISIBILITY'])) { $v = strtolower($properties['VISIBILITY']); if (($v == 'hidden' || $v == 'printonly' || $v == 'screenonly') && $this->mpdf->visibility == 'visible') { $objattr['visibility'] = $v; } } // VSPACE and HSPACE converted to margins in MergeCSS if (isset($properties['MARGIN-TOP'])) { $objattr['margin_top'] = $this->mpdf->ConvertSize($properties['MARGIN-TOP'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['MARGIN-BOTTOM'])) { $objattr['margin_bottom'] = $this->mpdf->ConvertSize($properties['MARGIN-BOTTOM'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['MARGIN-LEFT'])) { $objattr['margin_left'] = $this->mpdf->ConvertSize($properties['MARGIN-LEFT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['MARGIN-RIGHT'])) { $objattr['margin_right'] = $this->mpdf->ConvertSize($properties['MARGIN-RIGHT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['PADDING-TOP'])) { $objattr['padding_top'] = $this->mpdf->ConvertSize($properties['PADDING-TOP'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['PADDING-BOTTOM'])) { $objattr['padding_bottom'] = $this->mpdf->ConvertSize($properties['PADDING-BOTTOM'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['PADDING-LEFT'])) { $objattr['padding_left'] = $this->mpdf->ConvertSize($properties['PADDING-LEFT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['PADDING-RIGHT'])) { $objattr['padding_right'] = $this->mpdf->ConvertSize($properties['PADDING-RIGHT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['BORDER-TOP'])) { $objattr['border_top'] = $this->mpdf->border_details($properties['BORDER-TOP']); } if (isset($properties['BORDER-BOTTOM'])) { $objattr['border_bottom'] = $this->mpdf->border_details($properties['BORDER-BOTTOM']); } if (isset($properties['BORDER-LEFT'])) { $objattr['border_left'] = $this->mpdf->border_details($properties['BORDER-LEFT']); } if (isset($properties['BORDER-RIGHT'])) { $objattr['border_right'] = $this->mpdf->border_details($properties['BORDER-RIGHT']); } if (isset($properties['VERTICAL-ALIGN'])) { $objattr['vertical-align'] = $align[strtolower($properties['VERTICAL-ALIGN'])]; } $w = 0; $h = 0; if (isset($properties['WIDTH'])) $w = $this->mpdf->ConvertSize($properties['WIDTH'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); else if (isset($attr['WIDTH'])) $w = $this->mpdf->ConvertSize($attr['WIDTH'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); if (isset($properties['HEIGHT'])) $h = $this->mpdf->ConvertSize($properties['HEIGHT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); else if (isset($attr['HEIGHT'])) $h = $this->mpdf->ConvertSize($attr['HEIGHT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); $maxw = $maxh = $minw = $minh = false; if (isset($properties['MAX-WIDTH'])) $maxw = $this->mpdf->ConvertSize($properties['MAX-WIDTH'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); else if (isset($attr['MAX-WIDTH'])) $maxw = $this->mpdf->ConvertSize($attr['MAX-WIDTH'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); if (isset($properties['MAX-HEIGHT'])) $maxh = $this->mpdf->ConvertSize($properties['MAX-HEIGHT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); else if (isset($attr['MAX-HEIGHT'])) $maxh = $this->mpdf->ConvertSize($attr['MAX-HEIGHT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); if (isset($properties['MIN-WIDTH'])) $minw = $this->mpdf->ConvertSize($properties['MIN-WIDTH'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); else if (isset($attr['MIN-WIDTH'])) $minw = $this->mpdf->ConvertSize($attr['MIN-WIDTH'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); if (isset($properties['MIN-HEIGHT'])) $minh = $this->mpdf->ConvertSize($properties['MIN-HEIGHT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); else if (isset($attr['MIN-HEIGHT'])) $minh = $this->mpdf->ConvertSize($attr['MIN-HEIGHT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); if (isset($properties['OPACITY']) && $properties['OPACITY'] > 0 && $properties['OPACITY'] <= 1) { $objattr['opacity'] = $properties['OPACITY']; } if ($this->mpdf->HREF) { if (strpos($this->mpdf->HREF, ".") === false && strpos($this->mpdf->HREF, "@") !== 0) { $href = $this->mpdf->HREF; while (array_key_exists($href, $this->mpdf->internallink)) $href = "#" . $href; $this->mpdf->internallink[$href] = $this->mpdf->AddLink(); $objattr['link'] = $this->mpdf->internallink[$href]; } else { $objattr['link'] = $this->mpdf->HREF; } } $extraheight = $objattr['padding_top'] + $objattr['padding_bottom'] + $objattr['margin_top'] + $objattr['margin_bottom'] + $objattr['border_top']['w'] + $objattr['border_bottom']['w']; $extrawidth = $objattr['padding_left'] + $objattr['padding_right'] + $objattr['margin_left'] + $objattr['margin_right'] + $objattr['border_left']['w'] + $objattr['border_right']['w']; // mPDF 5.7.3 TRANSFORMS if (isset($properties['BACKGROUND-COLOR']) && $properties['BACKGROUND-COLOR'] != '') { $objattr['bgcolor'] = $this->mpdf->ConvertColor($properties['BACKGROUND-COLOR']); } /* -- BACKGROUNDS -- */ if (isset($properties['GRADIENT-MASK']) && preg_match('/(-moz-)*(repeating-)*(linear|radial)-gradient/', $properties['GRADIENT-MASK'])) { $objattr['GRADIENT-MASK'] = $properties['GRADIENT-MASK']; } /* -- END BACKGROUNDS -- */ // mPDF 6 $interpolation = false; if (isset($properties['IMAGE-RENDERING']) && $properties['IMAGE-RENDERING']) { if (strtolower($properties['IMAGE-RENDERING']) == 'crisp-edges') { $interpolation = false; } else if (strtolower($properties['IMAGE-RENDERING']) == 'optimizequality') { $interpolation = true; } else if (strtolower($properties['IMAGE-RENDERING']) == 'smooth') { $interpolation = true; } else if (strtolower($properties['IMAGE-RENDERING']) == 'auto') { $interpolation = $this->mpdf->interpolateImages; } else { $interpolation = false; } $info['interpolation'] = $interpolation; } // Image file $info = $this->mpdf->_getImage($srcpath, true, true, $orig_srcpath, $interpolation); // mPDF 6 if (!$info) { $info = $this->mpdf->_getImage($this->mpdf->noImageFile); if ($info) { $srcpath = $this->mpdf->noImageFile; $w = ($info['w'] * (25.4 / $this->mpdf->dpi)); $h = ($info['h'] * (25.4 / $this->mpdf->dpi)); } } if (!$info) break; if (isset($attr['ROTATE'])) { $image_orientation = $attr['ROTATE']; } else if (isset($properties['IMAGE-ORIENTATION'])) { $image_orientation = $properties['IMAGE-ORIENTATION']; } else { $image_orientation = 0; } if ($image_orientation) { if ($image_orientation == 90 || $image_orientation == -90 || $image_orientation == 270) { $tmpw = $info['w']; $info['w'] = $info['h']; $info['h'] = $tmpw; } $objattr['ROTATE'] = $image_orientation; } $objattr['file'] = $srcpath; //Default width and height calculation if needed if ($w == 0 and $h == 0) { /* -- IMAGES-WMF -- */ if ($info['type'] == 'wmf') { // WMF units are twips (1/20pt) // divide by 20 to get points // divide by k to get user units $w = abs($info['w']) / (20 * _MPDFK); $h = abs($info['h']) / (20 * _MPDFK); } else /* -- END IMAGES-WMF -- */ if ($info['type'] == 'svg') { // SVG units are pixels $w = abs($info['w']) / _MPDFK; $h = abs($info['h']) / _MPDFK; } else { //Put image at default image dpi $w = ($info['w'] / _MPDFK) * (72 / $this->mpdf->img_dpi); $h = ($info['h'] / _MPDFK) * (72 / $this->mpdf->img_dpi); } if (isset($properties['IMAGE-RESOLUTION'])) { if (preg_match('/from-image/i', $properties['IMAGE-RESOLUTION']) && isset($info['set-dpi']) && $info['set-dpi'] > 0) { $w *= $this->mpdf->img_dpi / $info['set-dpi']; $h *= $this->mpdf->img_dpi / $info['set-dpi']; } else if (preg_match('/(\d+)dpi/i', $properties['IMAGE-RESOLUTION'], $m)) { $dpi = $m[1]; if ($dpi > 0) { $w *= $this->mpdf->img_dpi / $dpi; $h *= $this->mpdf->img_dpi / $dpi; } } } } // IF WIDTH OR HEIGHT SPECIFIED if ($w == 0) $w = abs($h * $info['w'] / $info['h']); if ($h == 0) $h = abs($w * $info['h'] / $info['w']); if ($minw && $w < $minw) { $w = $minw; $h = abs($w * $info['h'] / $info['w']); } if ($maxw && $w > $maxw) { $w = $maxw; $h = abs($w * $info['h'] / $info['w']); } if ($minh && $h < $minh) { $h = $minh; $w = abs($h * $info['w'] / $info['h']); } if ($maxh && $h > $maxh) { $h = $maxh; $w = abs($h * $info['w'] / $info['h']); } // Resize to maximum dimensions of page $maxWidth = $this->mpdf->blk[$this->mpdf->blklvl]['inner_width']; $maxHeight = $this->mpdf->h - ($this->mpdf->tMargin + $this->mpdf->bMargin + 1); if ($this->mpdf->fullImageHeight) { $maxHeight = $this->mpdf->fullImageHeight; } if (($w + $extrawidth) > ($maxWidth + 0.0001)) { // mPDF 5.7.4 0.0001 to allow for rounding errors when w==maxWidth $w = $maxWidth - $extrawidth; $h = abs($w * $info['h'] / $info['w']); } if ($h + $extraheight > $maxHeight) { $h = $maxHeight - $extraheight; $w = abs($h * $info['w'] / $info['h']); } $objattr['type'] = 'image'; $objattr['itype'] = $info['type']; $objattr['orig_h'] = $info['h']; $objattr['orig_w'] = $info['w']; /* -- IMAGES-WMF -- */ if ($info['type'] == 'wmf') { $objattr['wmf_x'] = $info['x']; $objattr['wmf_y'] = $info['y']; } else /* -- END IMAGES-WMF -- */ if ($info['type'] == 'svg') { $objattr['wmf_x'] = $info['x']; $objattr['wmf_y'] = $info['y']; } $objattr['height'] = $h + $extraheight; $objattr['width'] = $w + $extrawidth; $objattr['image_height'] = $h; $objattr['image_width'] = $w; /* -- CSS-IMAGE-FLOAT -- */ if (!$this->mpdf->ColActive && !$this->mpdf->tableLevel && !$this->mpdf->listlvl && !$this->mpdf->kwt) { if (isset($properties['FLOAT']) && (strtoupper($properties['FLOAT']) == 'RIGHT' || strtoupper($properties['FLOAT']) == 'LEFT')) { $objattr['float'] = substr(strtoupper($properties['FLOAT']), 0, 1); } } /* -- END CSS-IMAGE-FLOAT -- */ // mPDF 5.7.3 TRANSFORMS if (isset($properties['TRANSFORM']) && !$this->mpdf->ColActive && !$this->mpdf->kwt) { $objattr['transform'] = $properties['TRANSFORM']; } $e = "\xbb\xa4\xactype=image,objattr=" . serialize($objattr) . "\xbb\xa4\xac"; // Clear properties - tidy up $properties = array(); /* -- TABLES -- */ // Output it to buffers if ($this->mpdf->tableLevel) { $this->mpdf->_saveCellTextBuffer($e, $this->mpdf->HREF); $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s'] += $objattr['width']; } else { /* -- END TABLES -- */ $this->mpdf->_saveTextBuffer($e, $this->mpdf->HREF); } // *TABLES* /* -- ANNOTATIONS -- */ if ($this->mpdf->title2annots && isset($attr['TITLE'])) { $objattr = array(); $objattr['margin_top'] = 0; $objattr['margin_bottom'] = 0; $objattr['margin_left'] = 0; $objattr['margin_right'] = 0; $objattr['width'] = 0; $objattr['height'] = 0; $objattr['border_top']['w'] = 0; $objattr['border_bottom']['w'] = 0; $objattr['border_left']['w'] = 0; $objattr['border_right']['w'] = 0; $objattr['CONTENT'] = $attr['TITLE']; $objattr['type'] = 'annot'; $objattr['POS-X'] = 0; $objattr['POS-Y'] = 0; $objattr['ICON'] = 'Comment'; $objattr['AUTHOR'] = ''; $objattr['SUBJECT'] = ''; $objattr['OPACITY'] = $this->mpdf->annotOpacity; $objattr['COLOR'] = $this->mpdf->ConvertColor('yellow'); $e = "\xbb\xa4\xactype=annot,objattr=" . serialize($objattr) . "\xbb\xa4\xac"; if ($this->mpdf->tableLevel) { // *TABLES* $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['textbuffer'][] = array($e); // *TABLES* } // *TABLES* else { // *TABLES* $this->mpdf->textbuffer[] = array($e); } // *TABLES* } /* -- END ANNOTATIONS -- */ } break; /* -- END IMAGES-CORE -- */ // *********** CIRCULAR TEXT = TEXTCIRCLE ******************** case 'TEXTCIRCLE': $objattr = array(); $objattr['margin_top'] = 0; $objattr['margin_bottom'] = 0; $objattr['margin_left'] = 0; $objattr['margin_right'] = 0; $objattr['padding_top'] = 0; $objattr['padding_bottom'] = 0; $objattr['padding_left'] = 0; $objattr['padding_right'] = 0; $objattr['width'] = 0; $objattr['height'] = 0; $objattr['border_top']['w'] = 0; $objattr['border_bottom']['w'] = 0; $objattr['border_left']['w'] = 0; $objattr['border_right']['w'] = 0; $objattr['top-text'] = ''; $objattr['bottom-text'] = ''; $objattr['r'] = 20; // radius (default value here for safety) $objattr['space-width'] = 120; $objattr['char-width'] = 100; $this->mpdf->InlineProperties[$tag] = $this->mpdf->saveInlineProperties(); $properties = $this->mpdf->cssmgr->MergeCSS('INLINE', $tag, $attr); if (isset($properties ['DISPLAY']) && strtolower($properties ['DISPLAY']) == 'none') { return; } if (isset($attr['R'])) { $objattr['r'] = $this->mpdf->ConvertSize($attr['R'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($attr['TOP-TEXT'])) { $objattr['top-text'] = strcode2utf($attr['TOP-TEXT']); $objattr['top-text'] = $this->mpdf->lesser_entity_decode($objattr['top-text']); if ($this->mpdf->onlyCoreFonts) $objattr['top-text'] = mb_convert_encoding($objattr['top-text'], $this->mpdf->mb_enc, 'UTF-8'); } if (isset($attr['BOTTOM-TEXT'])) { $objattr['bottom-text'] = strcode2utf($attr['BOTTOM-TEXT']); $objattr['bottom-text'] = $this->mpdf->lesser_entity_decode($objattr['bottom-text']); if ($this->mpdf->onlyCoreFonts) $objattr['bottom-text'] = mb_convert_encoding($objattr['bottom-text'], $this->mpdf->mb_enc, 'UTF-8'); } if (isset($attr['SPACE-WIDTH']) && $attr['SPACE-WIDTH']) { $objattr['space-width'] = $attr['SPACE-WIDTH']; } if (isset($attr['CHAR-WIDTH']) && $attr['CHAR-WIDTH']) { $objattr['char-width'] = $attr['CHAR-WIDTH']; } // VISIBILITY $objattr['visibility'] = 'visible'; if (isset($properties['VISIBILITY'])) { $v = strtolower($properties['VISIBILITY']); if (($v == 'hidden' || $v == 'printonly' || $v == 'screenonly') && $this->mpdf->visibility == 'visible') { $objattr['visibility'] = $v; } } if (isset($properties['FONT-SIZE'])) { if (strtolower($properties['FONT-SIZE']) == 'auto') { if ($objattr['top-text'] && $objattr['bottom-text']) { $objattr['fontsize'] = -2; } else { $objattr['fontsize'] = -1; } } else { $mmsize = $this->mpdf->ConvertSize($properties['FONT-SIZE'], ($this->mpdf->default_font_size / _MPDFK)); $this->mpdf->SetFontSize($mmsize * _MPDFK, false); $objattr['fontsize'] = $this->mpdf->FontSizePt; } } if (isset($attr['DIVIDER'])) { $objattr['divider'] = strcode2utf($attr['DIVIDER']); $objattr['divider'] = $this->mpdf->lesser_entity_decode($objattr['divider']); if ($this->mpdf->onlyCoreFonts) $objattr['divider'] = mb_convert_encoding($objattr['divider'], $this->mpdf->mb_enc, 'UTF-8'); } if (isset($properties['COLOR'])) { $objattr['color'] = $this->mpdf->ConvertColor($properties['COLOR']); } $objattr['fontstyle'] = ''; if (isset($properties['FONT-WEIGHT'])) { if (strtoupper($properties['FONT-WEIGHT']) == 'BOLD') { $objattr['fontstyle'] .= 'B'; } } if (isset($properties['FONT-STYLE'])) { if (strtoupper($properties['FONT-STYLE']) == 'ITALIC') { $objattr['fontstyle'] .= 'I'; } } if (isset($properties['FONT-FAMILY'])) { $this->mpdf->SetFont($properties['FONT-FAMILY'], $this->mpdf->FontStyle, 0, false); } $objattr['fontfamily'] = $this->mpdf->FontFamily; // VSPACE and HSPACE converted to margins in MergeCSS if (isset($properties['MARGIN-TOP'])) { $objattr['margin_top'] = $this->mpdf->ConvertSize($properties['MARGIN-TOP'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['MARGIN-BOTTOM'])) { $objattr['margin_bottom'] = $this->mpdf->ConvertSize($properties['MARGIN-BOTTOM'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['MARGIN-LEFT'])) { $objattr['margin_left'] = $this->mpdf->ConvertSize($properties['MARGIN-LEFT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['MARGIN-RIGHT'])) { $objattr['margin_right'] = $this->mpdf->ConvertSize($properties['MARGIN-RIGHT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['PADDING-TOP'])) { $objattr['padding_top'] = $this->mpdf->ConvertSize($properties['PADDING-TOP'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['PADDING-BOTTOM'])) { $objattr['padding_bottom'] = $this->mpdf->ConvertSize($properties['PADDING-BOTTOM'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['PADDING-LEFT'])) { $objattr['padding_left'] = $this->mpdf->ConvertSize($properties['PADDING-LEFT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['PADDING-RIGHT'])) { $objattr['padding_right'] = $this->mpdf->ConvertSize($properties['PADDING-RIGHT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['BORDER-TOP'])) { $objattr['border_top'] = $this->mpdf->border_details($properties['BORDER-TOP']); } if (isset($properties['BORDER-BOTTOM'])) { $objattr['border_bottom'] = $this->mpdf->border_details($properties['BORDER-BOTTOM']); } if (isset($properties['BORDER-LEFT'])) { $objattr['border_left'] = $this->mpdf->border_details($properties['BORDER-LEFT']); } if (isset($properties['BORDER-RIGHT'])) { $objattr['border_right'] = $this->mpdf->border_details($properties['BORDER-RIGHT']); } if (isset($properties['OPACITY']) && $properties['OPACITY'] > 0 && $properties['OPACITY'] <= 1) { $objattr['opacity'] = $properties['OPACITY']; } if (isset($properties['BACKGROUND-COLOR']) && $properties['BACKGROUND-COLOR'] != '') { $objattr['bgcolor'] = $this->mpdf->ConvertColor($properties['BACKGROUND-COLOR']); } else { $objattr['bgcolor'] = false; } if ($this->mpdf->HREF) { if (strpos($this->mpdf->HREF, ".") === false && strpos($this->mpdf->HREF, "@") !== 0) { $href = $this->mpdf->HREF; while (array_key_exists($href, $this->mpdf->internallink)) $href = "#" . $href; $this->mpdf->internallink[$href] = $this->mpdf->AddLink(); $objattr['link'] = $this->mpdf->internallink[$href]; } else { $objattr['link'] = $this->mpdf->HREF; } } $extraheight = $objattr['padding_top'] + $objattr['padding_bottom'] + $objattr['margin_top'] + $objattr['margin_bottom'] + $objattr['border_top']['w'] + $objattr['border_bottom']['w']; $extrawidth = $objattr['padding_left'] + $objattr['padding_right'] + $objattr['margin_left'] + $objattr['margin_right'] + $objattr['border_left']['w'] + $objattr['border_right']['w']; $w = $objattr['r'] * 2; $h = $w; $objattr['height'] = $h + $extraheight; $objattr['width'] = $w + $extrawidth; $objattr['type'] = 'textcircle'; $e = "\xbb\xa4\xactype=image,objattr=" . serialize($objattr) . "\xbb\xa4\xac"; // Clear properties - tidy up $properties = array(); /* -- TABLES -- */ // Output it to buffers if ($this->mpdf->tableLevel) { $this->mpdf->_saveCellTextBuffer($e, $this->mpdf->HREF); $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s'] += $objattr['width']; } else { /* -- END TABLES -- */ $this->mpdf->_saveTextBuffer($e, $this->mpdf->HREF); } // *TABLES* if ($this->mpdf->InlineProperties[$tag]) { $this->mpdf->restoreInlineProperties($this->mpdf->InlineProperties[$tag]); } unset($this->mpdf->InlineProperties[$tag]); break; /* -- TABLES -- */ case 'TABLE': // TABLE-BEGIN $this->mpdf->tdbegin = false; $this->mpdf->lastoptionaltag = ''; // Disable vertical justification in columns if ($this->mpdf->ColActive) { $this->mpdf->colvAlign = ''; } // *COLUMNS* if ($this->mpdf->lastblocklevelchange == 1) { $blockstate = 1; } // Top margins/padding only else if ($this->mpdf->lastblocklevelchange < 1) { $blockstate = 0; } // NO margins/padding // called from block after new div e.g. <div> ... <table> ... Outputs block top margin/border and padding if (count($this->mpdf->textbuffer) == 0 && $this->mpdf->lastblocklevelchange == 1 && !$this->mpdf->tableLevel && !$this->mpdf->kwt) { $this->mpdf->newFlowingBlock($this->mpdf->blk[$this->mpdf->blklvl]['width'], $this->mpdf->lineheight, '', false, 1, true, $this->mpdf->blk[$this->mpdf->blklvl]['direction']); $this->mpdf->finishFlowingBlock(true); // true = END of flowing block } else if (!$this->mpdf->tableLevel && count($this->mpdf->textbuffer)) { $this->mpdf->printbuffer($this->mpdf->textbuffer, $blockstate); } $this->mpdf->textbuffer = array(); $this->mpdf->lastblocklevelchange = -1; if ($this->mpdf->tableLevel) { // i.e. now a nested table coming... // Save current level table $this->mpdf->cell['PARENTCELL'] = $this->mpdf->saveInlineProperties(); $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['baseProperties'] = $this->mpdf->base_table_properties; $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['cells'] = $this->mpdf->cell; $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['currrow'] = $this->mpdf->row; $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['currcol'] = $this->mpdf->col; } $this->mpdf->tableLevel++; $this->mpdf->cssmgr->tbCSSlvl++; if ($this->mpdf->tableLevel > 1) { // inherit table properties from cell in which nested //$this->mpdf->base_table_properties['FONT-KERNING'] = ($this->mpdf->textvar & FC_KERNING); // mPDF 6 $this->mpdf->base_table_properties['LETTER-SPACING'] = $this->mpdf->lSpacingCSS; $this->mpdf->base_table_properties['WORD-SPACING'] = $this->mpdf->wSpacingCSS; // mPDF 6 $direction = $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['direction']; $txta = $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['a']; $cellLineHeight = $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['cellLineHeight']; $cellLineStackingStrategy = $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['cellLineStackingStrategy']; $cellLineStackingShift = $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['cellLineStackingShift']; } if (isset($this->mpdf->tbctr[$this->mpdf->tableLevel])) { $this->mpdf->tbctr[$this->mpdf->tableLevel] ++; } else { $this->mpdf->tbctr[$this->mpdf->tableLevel] = 1; } $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['level'] = $this->mpdf->tableLevel; $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['levelid'] = $this->mpdf->tbctr[$this->mpdf->tableLevel]; if ($this->mpdf->tableLevel > $this->mpdf->innermostTableLevel) { $this->mpdf->innermostTableLevel = $this->mpdf->tableLevel; } if ($this->mpdf->tableLevel > 1) { $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['nestedpos'] = array($this->mpdf->row, $this->mpdf->col, $this->mpdf->tbctr[($this->mpdf->tableLevel - 1)]); } //++++++++++++++++++++++++++++ $this->mpdf->cell = array(); $this->mpdf->col = -1; //int $this->mpdf->row = -1; //int $table = &$this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]; // New table - any level $table['direction'] = $this->mpdf->directionality; $table['bgcolor'] = false; $table['va'] = false; $table['txta'] = false; $table['topntail'] = false; $table['thead-underline'] = false; $table['border'] = false; $table['border_details']['R']['w'] = 0; $table['border_details']['L']['w'] = 0; $table['border_details']['T']['w'] = 0; $table['border_details']['B']['w'] = 0; $table['border_details']['R']['style'] = ''; $table['border_details']['L']['style'] = ''; $table['border_details']['T']['style'] = ''; $table['border_details']['B']['style'] = ''; $table['max_cell_border_width']['R'] = 0; $table['max_cell_border_width']['L'] = 0; $table['max_cell_border_width']['T'] = 0; $table['max_cell_border_width']['B'] = 0; $table['padding']['L'] = false; $table['padding']['R'] = false; $table['padding']['T'] = false; $table['padding']['B'] = false; $table['margin']['L'] = false; $table['margin']['R'] = false; $table['margin']['T'] = false; $table['margin']['B'] = false; $table['a'] = false; $table['border_spacing_H'] = false; $table['border_spacing_V'] = false; $table['decimal_align'] = false; $this->mpdf->Reset(); $this->mpdf->InlineProperties = array(); $this->mpdf->InlineBDF = array(); // mPDF 6 $this->mpdf->InlineBDFctr = 0; // mPDF 6 $table['nc'] = $table['nr'] = 0; $this->mpdf->tablethead = 0; $this->mpdf->tabletfoot = 0; $this->mpdf->tabletheadjustfinished = false; // mPDF 6 if ($this->mpdf->tableLevel > 1) { // inherit table properties from cell in which nested $table['direction'] = $direction; $table['txta'] = $txta; $table['cellLineHeight'] = $cellLineHeight; $table['cellLineStackingStrategy'] = $cellLineStackingStrategy; $table['cellLineStackingShift'] = $cellLineStackingShift; } if ($this->mpdf->blockjustfinished && !count($this->mpdf->textbuffer) && $this->mpdf->y != $this->mpdf->tMargin && $this->mpdf->collapseBlockMargins && $this->mpdf->tableLevel == 1) { $lastbottommargin = $this->mpdf->lastblockbottommargin; } else { $lastbottommargin = 0; } $this->mpdf->lastblockbottommargin = 0; $this->mpdf->blockjustfinished = false; if ($this->mpdf->tableLevel == 1) { $table['headernrows'] = 0; $table['footernrows'] = 0; $this->mpdf->base_table_properties = array(); } // ADDED CSS FUNCIONS FOR TABLE if ($this->mpdf->cssmgr->tbCSSlvl == 1) { $properties = $this->mpdf->cssmgr->MergeCSS('TOPTABLE', $tag, $attr); } else { $properties = $this->mpdf->cssmgr->MergeCSS('TABLE', $tag, $attr); } $w = ''; if (isset($properties['WIDTH'])) { $w = $properties['WIDTH']; } else if (isset($attr['WIDTH']) && $attr['WIDTH']) { $w = $attr['WIDTH']; } if (isset($attr['ALIGN']) && isset($align[strtolower($attr['ALIGN'])])) { $table['a'] = $align[strtolower($attr['ALIGN'])]; } if (!$table['a']) { if ($table['direction'] == 'rtl') { $table['a'] = 'R'; } else { $table['a'] = 'L'; } } if (isset($properties['DIRECTION']) && $properties['DIRECTION']) { $table['direction'] = strtolower($properties['DIRECTION']); } else if (isset($attr['DIR']) && $attr['DIR']) { $table['direction'] = strtolower($attr['DIR']); } else if ($this->mpdf->tableLevel == 1) { $table['direction'] = $this->mpdf->blk[$this->mpdf->blklvl]['direction']; } if (isset($properties['BACKGROUND-COLOR'])) { $table['bgcolor'][-1] = $properties['BACKGROUND-COLOR']; } else if (isset($properties['BACKGROUND'])) { $table['bgcolor'][-1] = $properties['BACKGROUND']; } else if (isset($attr['BGCOLOR'])) { $table['bgcolor'][-1] = $attr['BGCOLOR']; } if (isset($properties['VERTICAL-ALIGN']) && isset($align[strtolower($properties['VERTICAL-ALIGN'])])) { $table['va'] = $align[strtolower($properties['VERTICAL-ALIGN'])]; } if (isset($properties['TEXT-ALIGN']) && isset($align[strtolower($properties['TEXT-ALIGN'])])) { $table['txta'] = $align[strtolower($properties['TEXT-ALIGN'])]; } if (isset($properties['AUTOSIZE']) && $properties['AUTOSIZE'] && $this->mpdf->tableLevel == 1) { $this->mpdf->shrink_this_table_to_fit = $properties['AUTOSIZE']; if ($this->mpdf->shrink_this_table_to_fit < 1) { $this->mpdf->shrink_this_table_to_fit = 0; } } if (isset($properties['ROTATE']) && $properties['ROTATE'] && $this->mpdf->tableLevel == 1) { $this->mpdf->table_rotate = $properties['ROTATE']; } if (isset($properties['TOPNTAIL'])) { $table['topntail'] = $properties['TOPNTAIL']; } if (isset($properties['THEAD-UNDERLINE'])) { $table['thead-underline'] = $properties['THEAD-UNDERLINE']; } if (isset($properties['BORDER'])) { $bord = $this->mpdf->border_details($properties['BORDER']); if ($bord['s']) { $table['border'] = _BORDER_ALL; $table['border_details']['R'] = $bord; $table['border_details']['L'] = $bord; $table['border_details']['T'] = $bord; $table['border_details']['B'] = $bord; } } if (isset($properties['BORDER-RIGHT'])) { if ($table['direction'] == 'rtl') { // *OTL* $table['border_details']['R'] = $this->mpdf->border_details($properties['BORDER-LEFT']); // *OTL* } // *OTL* else { // *OTL* $table['border_details']['R'] = $this->mpdf->border_details($properties['BORDER-RIGHT']); } // *OTL* $this->mpdf->setBorder($table['border'], _BORDER_RIGHT, $table['border_details']['R']['s']); } if (isset($properties['BORDER-LEFT'])) { if ($table['direction'] == 'rtl') { // *OTL* $table['border_details']['L'] = $this->mpdf->border_details($properties['BORDER-RIGHT']); // *OTL* } // *OTL* else { // *OTL* $table['border_details']['L'] = $this->mpdf->border_details($properties['BORDER-LEFT']); } // *OTL* $this->mpdf->setBorder($table['border'], _BORDER_LEFT, $table['border_details']['L']['s']); } if (isset($properties['BORDER-BOTTOM'])) { $table['border_details']['B'] = $this->mpdf->border_details($properties['BORDER-BOTTOM']); $this->mpdf->setBorder($table['border'], _BORDER_BOTTOM, $table['border_details']['B']['s']); } if (isset($properties['BORDER-TOP'])) { $table['border_details']['T'] = $this->mpdf->border_details($properties['BORDER-TOP']); $this->mpdf->setBorder($table['border'], _BORDER_TOP, $table['border_details']['T']['s']); } if ($table['border']) { $this->mpdf->table_border_css_set = 1; } else { $this->mpdf->table_border_css_set = 0; } // mPDF 6 if (isset($properties['LANG']) && $properties['LANG']) { if ($this->mpdf->autoLangToFont && !$this->mpdf->usingCoreFont) { if ($properties['LANG'] != $this->mpdf->default_lang && $properties['LANG'] != 'UTF-8') { list ($coreSuitable, $mpdf_pdf_unifont) = GetLangOpts($properties['LANG'], $this->mpdf->useAdobeCJK, $this->mpdf->fontdata); if ($mpdf_pdf_unifont) { $properties['FONT-FAMILY'] = $mpdf_pdf_unifont; } } } $this->mpdf->currentLang = $properties['LANG']; } if (isset($properties['FONT-FAMILY'])) { $this->mpdf->default_font = $properties['FONT-FAMILY']; $this->mpdf->SetFont($this->mpdf->default_font, '', 0, false); } $this->mpdf->base_table_properties['FONT-FAMILY'] = $this->mpdf->FontFamily; if (isset($properties['FONT-SIZE'])) { if ($this->mpdf->tableLevel > 1) { $mmsize = $this->mpdf->ConvertSize($properties['FONT-SIZE'], $this->mpdf->base_table_properties['FONT-SIZE']); } else { $mmsize = $this->mpdf->ConvertSize($properties['FONT-SIZE'], $this->mpdf->default_font_size / _MPDFK); } if ($mmsize) { $this->mpdf->default_font_size = $mmsize * (_MPDFK); $this->mpdf->SetFontSize($this->mpdf->default_font_size, false); } } $this->mpdf->base_table_properties['FONT-SIZE'] = $this->mpdf->FontSize . 'mm'; if (isset($properties['FONT-WEIGHT'])) { if (strtoupper($properties['FONT-WEIGHT']) == 'BOLD') { $this->mpdf->base_table_properties['FONT-WEIGHT'] = 'BOLD'; } } if (isset($properties['FONT-STYLE'])) { if (strtoupper($properties['FONT-STYLE']) == 'ITALIC') { $this->mpdf->base_table_properties['FONT-STYLE'] = 'ITALIC'; } } if (isset($properties['COLOR'])) { $this->mpdf->base_table_properties['COLOR'] = $properties['COLOR']; } if (isset($properties['FONT-KERNING'])) { $this->mpdf->base_table_properties['FONT-KERNING'] = $properties['FONT-KERNING']; } if (isset($properties['LETTER-SPACING'])) { $this->mpdf->base_table_properties['LETTER-SPACING'] = $properties['LETTER-SPACING']; } if (isset($properties['WORD-SPACING'])) { $this->mpdf->base_table_properties['WORD-SPACING'] = $properties['WORD-SPACING']; } // mPDF 6 if (isset($properties['HYPHENS'])) { $this->mpdf->base_table_properties['HYPHENS'] = $properties['HYPHENS']; } if (isset($properties['LINE-HEIGHT']) && $properties['LINE-HEIGHT']) { $table['cellLineHeight'] = $this->mpdf->fixLineheight($properties['LINE-HEIGHT']); } else if ($this->mpdf->tableLevel == 1) { $table['cellLineHeight'] = $this->mpdf->blk[$this->mpdf->blklvl]['line_height']; } if (isset($properties['LINE-STACKING-STRATEGY']) && $properties['LINE-STACKING-STRATEGY']) { $table['cellLineStackingStrategy'] = strtolower($properties['LINE-STACKING-STRATEGY']); } else if ($this->mpdf->tableLevel == 1 && isset($this->mpdf->blk[$this->mpdf->blklvl]['line_stacking_strategy'])) { $table['cellLineStackingStrategy'] = $this->mpdf->blk[$this->mpdf->blklvl]['line_stacking_strategy']; } else { $table['cellLineStackingStrategy'] = 'inline-line-height'; } if (isset($properties['LINE-STACKING-SHIFT']) && $properties['LINE-STACKING-SHIFT']) { $table['cellLineStackingShift'] = strtolower($properties['LINE-STACKING-SHIFT']); } else if ($this->mpdf->tableLevel == 1 && isset($this->mpdf->blk[$this->mpdf->blklvl]['line_stacking_shift'])) { $table['cellLineStackingShift'] = $this->mpdf->blk[$this->mpdf->blklvl]['line_stacking_shift']; } else { $table['cellLineStackingShift'] = 'consider-shifts'; } if (isset($properties['PADDING-LEFT'])) { $table['padding']['L'] = $this->mpdf->ConvertSize($properties['PADDING-LEFT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['PADDING-RIGHT'])) { $table['padding']['R'] = $this->mpdf->ConvertSize($properties['PADDING-RIGHT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['PADDING-TOP'])) { $table['padding']['T'] = $this->mpdf->ConvertSize($properties['PADDING-TOP'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['PADDING-BOTTOM'])) { $table['padding']['B'] = $this->mpdf->ConvertSize($properties['PADDING-BOTTOM'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['MARGIN-TOP'])) { if ($lastbottommargin) { $tmp = $this->mpdf->ConvertSize($properties['MARGIN-TOP'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); if ($tmp > $lastbottommargin) { $properties['MARGIN-TOP'] -= $lastbottommargin; } else { $properties['MARGIN-TOP'] = 0; } } $table['margin']['T'] = $this->mpdf->ConvertSize($properties['MARGIN-TOP'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['MARGIN-BOTTOM'])) { $table['margin']['B'] = $this->mpdf->ConvertSize($properties['MARGIN-BOTTOM'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['MARGIN-LEFT'])) { $table['margin']['L'] = $this->mpdf->ConvertSize($properties['MARGIN-LEFT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['MARGIN-RIGHT'])) { $table['margin']['R'] = $this->mpdf->ConvertSize($properties['MARGIN-RIGHT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['MARGIN-LEFT']) && isset($properties['MARGIN-RIGHT']) && strtolower($properties['MARGIN-LEFT']) == 'auto' && strtolower($properties['MARGIN-RIGHT']) == 'auto') { $table['a'] = 'C'; } else if (isset($properties['MARGIN-LEFT']) && strtolower($properties['MARGIN-LEFT']) == 'auto') { $table['a'] = 'R'; } else if (isset($properties['MARGIN-RIGHT']) && strtolower($properties['MARGIN-RIGHT']) == 'auto') { $table['a'] = 'L'; } if (isset($properties['BORDER-COLLAPSE']) && strtoupper($properties['BORDER-COLLAPSE']) == 'SEPARATE') { $table['borders_separate'] = true; } else { $table['borders_separate'] = false; } // mPDF 5.7.3 if (isset($properties['BORDER-SPACING-H'])) { $table['border_spacing_H'] = $this->mpdf->ConvertSize($properties['BORDER-SPACING-H'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['BORDER-SPACING-V'])) { $table['border_spacing_V'] = $this->mpdf->ConvertSize($properties['BORDER-SPACING-V'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } // mPDF 5.7.3 if (!$table['borders_separate']) { $table['border_spacing_H'] = $table['border_spacing_V'] = 0; } if (isset($properties['EMPTY-CELLS'])) { $table['empty_cells'] = strtolower($properties['EMPTY-CELLS']); // 'hide' or 'show' } else { $table['empty_cells'] = ''; } if (isset($properties['PAGE-BREAK-INSIDE']) && strtoupper($properties['PAGE-BREAK-INSIDE']) == 'AVOID' && $this->mpdf->tableLevel == 1 && !$this->mpdf->writingHTMLfooter) { $this->mpdf->table_keep_together = true; } else if ($this->mpdf->tableLevel == 1) { $this->mpdf->table_keep_together = false; } if (isset($properties['PAGE-BREAK-AFTER']) && $this->mpdf->tableLevel == 1) { $table['page_break_after'] = strtoupper($properties['PAGE-BREAK-AFTER']); } /* -- BACKGROUNDS -- */ if (isset($properties['BACKGROUND-GRADIENT']) && !$this->mpdf->kwt && !$this->mpdf->ColActive) { $table['gradient'] = $properties['BACKGROUND-GRADIENT']; } if (isset($properties['BACKGROUND-IMAGE']) && $properties['BACKGROUND-IMAGE'] && !$this->mpdf->kwt && !$this->mpdf->ColActive) { $ret = $this->mpdf->SetBackground($properties, $currblk['inner_width']); if ($ret) { $table['background-image'] = $ret; } } /* -- END BACKGROUNDS -- */ if (isset($properties['OVERFLOW'])) { $table['overflow'] = strtolower($properties['OVERFLOW']); // 'hidden' 'wrap' or 'visible' or 'auto' if (($this->mpdf->ColActive || $this->mpdf->tableLevel > 1) && $table['overflow'] == 'visible') { unset($table['overflow']); } } $properties = array(); if (isset($attr['CELLPADDING'])) { $table['cell_padding'] = $attr['CELLPADDING']; } else { $table['cell_padding'] = false; } if (isset($attr['BORDER']) && $attr['BORDER'] == '1') { $this->mpdf->table_border_attr_set = 1; $bord = $this->mpdf->border_details('#000000 1px solid'); if ($bord['s']) { $table['border'] = _BORDER_ALL; $table['border_details']['R'] = $bord; $table['border_details']['L'] = $bord; $table['border_details']['T'] = $bord; $table['border_details']['B'] = $bord; } } else { $this->mpdf->table_border_attr_set = 0; } if ($w) { $maxwidth = $this->mpdf->blk[$this->mpdf->blklvl]['inner_width']; if ($table['borders_separate']) { $tblblw = $table['margin']['L'] + $table['margin']['R'] + $table['border_details']['L']['w'] / 2 + $table['border_details']['R']['w'] / 2; } else { $tblblw = $table['margin']['L'] + $table['margin']['R'] + $table['max_cell_border_width']['L'] / 2 + $table['max_cell_border_width']['R'] / 2; } if (strpos($w, '%') && $this->mpdf->tableLevel == 1 && !$this->mpdf->ignore_table_percents) { // % needs to be of inner box without table margins etc. $maxwidth -= $tblblw; $wmm = $this->mpdf->ConvertSize($w, $maxwidth, $this->mpdf->FontSize, false); $table['w'] = $wmm + $tblblw; } if (strpos($w, '%') && $this->mpdf->tableLevel > 1 && !$this->mpdf->ignore_table_percents && $this->mpdf->keep_table_proportions) { $table['wpercent'] = $w + 0; // makes 80% -> 80 } if (!strpos($w, '%') && !$this->mpdf->ignore_table_widths) { $wmm = $this->mpdf->ConvertSize($w, $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); $table['w'] = $wmm + $tblblw; } if (!$this->mpdf->keep_table_proportions) { if (isset($table['w']) && $table['w'] > $this->mpdf->blk[$this->mpdf->blklvl]['inner_width']) { $table['w'] = $this->mpdf->blk[$this->mpdf->blklvl]['inner_width']; } } } if (isset($attr['AUTOSIZE']) && $this->mpdf->tableLevel == 1) { $this->mpdf->shrink_this_table_to_fit = $attr['AUTOSIZE']; if ($this->mpdf->shrink_this_table_to_fit < 1) { $this->mpdf->shrink_this_table_to_fit = 1; } } if (isset($attr['ROTATE']) && $this->mpdf->tableLevel == 1) { $this->mpdf->table_rotate = $attr['ROTATE']; } //++++++++++++++++++++++++++++ if ($this->mpdf->table_rotate) { $this->mpdf->tbrot_Links = array(); $this->mpdf->tbrot_Annots = array(); $this->mpdf->tbrotForms = array(); $this->mpdf->tbrot_BMoutlines = array(); $this->mpdf->tbrot_toc = array(); } if ($this->mpdf->kwt) { if ($this->mpdf->table_rotate) { $this->mpdf->table_keep_together = true; } $this->mpdf->kwt = false; $this->mpdf->kwt_saved = true; } if ($this->mpdf->tableLevel == 1 && $this->mpdf->useGraphs) { if (isset($attr['ID']) && $attr['ID']) { $this->mpdf->currentGraphId = strtoupper($attr['ID']); } else { $this->mpdf->currentGraphId = '0'; } $this->mpdf->graphs[$this->mpdf->currentGraphId] = array(); } //++++++++++++++++++++++++++++ $this->mpdf->plainCell_properties = array(); unset($table); break; case 'THEAD': $this->mpdf->lastoptionaltag = $tag; // Save current HTML specified optional endtag $this->mpdf->cssmgr->tbCSSlvl++; $this->mpdf->tablethead = 1; $this->mpdf->tabletfoot = 0; $properties = $this->mpdf->cssmgr->MergeCSS('TABLE', $tag, $attr); if (isset($properties['FONT-WEIGHT'])) { if (strtoupper($properties['FONT-WEIGHT']) == 'BOLD') { $this->mpdf->thead_font_weight = 'B'; } else { $this->mpdf->thead_font_weight = ''; } } if (isset($properties['FONT-STYLE'])) { if (strtoupper($properties['FONT-STYLE']) == 'ITALIC') { $this->mpdf->thead_font_style = 'I'; } else { $this->mpdf->thead_font_style = ''; } } if (isset($properties['FONT-VARIANT'])) { if (strtoupper($properties['FONT-VARIANT']) == 'SMALL-CAPS') { $this->mpdf->thead_font_smCaps = 'S'; } else { $this->mpdf->thead_font_smCaps = ''; } } if (isset($properties['VERTICAL-ALIGN'])) { $this->mpdf->thead_valign_default = $properties['VERTICAL-ALIGN']; } if (isset($properties['TEXT-ALIGN'])) { $this->mpdf->thead_textalign_default = $properties['TEXT-ALIGN']; } $properties = array(); break; case 'TFOOT': $this->mpdf->lastoptionaltag = $tag; // Save current HTML specified optional endtag $this->mpdf->cssmgr->tbCSSlvl++; $this->mpdf->tabletfoot = 1; $this->mpdf->tablethead = 0; $properties = $this->mpdf->cssmgr->MergeCSS('TABLE', $tag, $attr); if (isset($properties['FONT-WEIGHT'])) { if (strtoupper($properties['FONT-WEIGHT']) == 'BOLD') { $this->mpdf->tfoot_font_weight = 'B'; } else { $this->mpdf->tfoot_font_weight = ''; } } if (isset($properties['FONT-STYLE'])) { if (strtoupper($properties['FONT-STYLE']) == 'ITALIC') { $this->mpdf->tfoot_font_style = 'I'; } else { $this->mpdf->tfoot_font_style = ''; } } if (isset($properties['FONT-VARIANT'])) { if (strtoupper($properties['FONT-VARIANT']) == 'SMALL-CAPS') { $this->mpdf->tfoot_font_smCaps = 'S'; } else { $this->mpdf->tfoot_font_smCaps = ''; } } if (isset($properties['VERTICAL-ALIGN'])) { $this->mpdf->tfoot_valign_default = $properties['VERTICAL-ALIGN']; } if (isset($properties['TEXT-ALIGN'])) { $this->mpdf->tfoot_textalign_default = $properties['TEXT-ALIGN']; } $properties = array(); break; case 'TBODY': $this->mpdf->tablethead = 0; $this->mpdf->tabletfoot = 0; $this->mpdf->lastoptionaltag = $tag; // Save current HTML specified optional endtag $this->mpdf->cssmgr->tbCSSlvl++; $this->mpdf->cssmgr->MergeCSS('TABLE', $tag, $attr); break; case 'TR': $this->mpdf->lastoptionaltag = $tag; // Save current HTML specified optional endtag $this->mpdf->cssmgr->tbCSSlvl++; $this->mpdf->row++; $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['nr'] ++; $this->mpdf->col = -1; $properties = $this->mpdf->cssmgr->MergeCSS('TABLE', $tag, $attr); if (!$this->mpdf->simpleTables && (!isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['borders_separate']) || !$this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['borders_separate'])) { if (isset($properties['BORDER-LEFT']) && $properties['BORDER-LEFT']) { $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['trborder-left'][$this->mpdf->row] = $properties['BORDER-LEFT']; } if (isset($properties['BORDER-RIGHT']) && $properties['BORDER-RIGHT']) { $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['trborder-right'][$this->mpdf->row] = $properties['BORDER-RIGHT']; } if (isset($properties['BORDER-TOP']) && $properties['BORDER-TOP']) { $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['trborder-top'][$this->mpdf->row] = $properties['BORDER-TOP']; } if (isset($properties['BORDER-BOTTOM']) && $properties['BORDER-BOTTOM']) { $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['trborder-bottom'][$this->mpdf->row] = $properties['BORDER-BOTTOM']; } } if (isset($properties['BACKGROUND-COLOR'])) { $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['bgcolor'][$this->mpdf->row] = $properties['BACKGROUND-COLOR']; } else if (isset($attr['BGCOLOR'])) $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['bgcolor'][$this->mpdf->row] = $attr['BGCOLOR']; /* -- BACKGROUNDS -- */ if (isset($properties['BACKGROUND-GRADIENT']) && !$this->mpdf->kwt && !$this->mpdf->ColActive) { $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['trgradients'][$this->mpdf->row] = $properties['BACKGROUND-GRADIENT']; } if (isset($properties['BACKGROUND-IMAGE']) && $properties['BACKGROUND-IMAGE'] && !$this->mpdf->kwt && !$this->mpdf->ColActive) { $ret = $this->mpdf->SetBackground($properties, $currblk['inner_width']); if ($ret) { $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['trbackground-images'][$this->mpdf->row] = $ret; } } /* -- END BACKGROUNDS -- */ if (isset($properties['TEXT-ROTATE'])) { $this->mpdf->trow_text_rotate = $properties['TEXT-ROTATE']; } if (isset($attr['TEXT-ROTATE'])) $this->mpdf->trow_text_rotate = $attr['TEXT-ROTATE']; if ($this->mpdf->tablethead) { $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_thead'][$this->mpdf->row] = true; } if ($this->mpdf->tabletfoot) { $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot'][$this->mpdf->row] = true; } $properties = array(); break; case 'TH': case 'TD': $this->mpdf->ignorefollowingspaces = true; $this->mpdf->lastoptionaltag = $tag; // Save current HTML specified optional endtag $this->mpdf->cssmgr->tbCSSlvl++; $this->mpdf->InlineProperties = array(); $this->mpdf->InlineBDF = array(); // mPDF 6 $this->mpdf->InlineBDFctr = 0; // mPDF 6 $this->mpdf->tdbegin = true; $this->mpdf->col++; while (isset($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col])) { $this->mpdf->col++; } //Update number column if ($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['nc'] < $this->mpdf->col + 1) { $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['nc'] = $this->mpdf->col + 1; } $table = &$this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]; $c = array('a' => false, 'R' => false, 'nowrap' => false, 'bgcolor' => false, 'padding' => array('L' => false, 'R' => false, 'T' => false, 'B' => false ) ); if ($this->mpdf->simpleTables && $this->mpdf->row == 0 && $this->mpdf->col == 0) { $table['simple']['border'] = false; $table['simple']['border_details']['R']['w'] = 0; $table['simple']['border_details']['L']['w'] = 0; $table['simple']['border_details']['T']['w'] = 0; $table['simple']['border_details']['B']['w'] = 0; $table['simple']['border_details']['R']['style'] = ''; $table['simple']['border_details']['L']['style'] = ''; $table['simple']['border_details']['T']['style'] = ''; $table['simple']['border_details']['B']['style'] = ''; } else if (!$this->mpdf->simpleTables) { $c['border'] = false; $c['border_details']['R']['w'] = 0; $c['border_details']['L']['w'] = 0; $c['border_details']['T']['w'] = 0; $c['border_details']['B']['w'] = 0; $c['border_details']['mbw']['BL'] = 0; $c['border_details']['mbw']['BR'] = 0; $c['border_details']['mbw']['RT'] = 0; $c['border_details']['mbw']['RB'] = 0; $c['border_details']['mbw']['TL'] = 0; $c['border_details']['mbw']['TR'] = 0; $c['border_details']['mbw']['LT'] = 0; $c['border_details']['mbw']['LB'] = 0; $c['border_details']['R']['style'] = ''; $c['border_details']['L']['style'] = ''; $c['border_details']['T']['style'] = ''; $c['border_details']['B']['style'] = ''; $c['border_details']['R']['s'] = 0; $c['border_details']['L']['s'] = 0; $c['border_details']['T']['s'] = 0; $c['border_details']['B']['s'] = 0; $c['border_details']['R']['c'] = $this->mpdf->ConvertColor(0); $c['border_details']['L']['c'] = $this->mpdf->ConvertColor(0); $c['border_details']['T']['c'] = $this->mpdf->ConvertColor(0); $c['border_details']['B']['c'] = $this->mpdf->ConvertColor(0); $c['border_details']['R']['dom'] = 0; $c['border_details']['L']['dom'] = 0; $c['border_details']['T']['dom'] = 0; $c['border_details']['B']['dom'] = 0; $c['border_details']['cellposdom'] = 0; } if ($table['va']) { $c['va'] = $table['va']; } if ($table['txta']) { $c['a'] = $table['txta']; } if ($this->mpdf->table_border_attr_set) { if ($table['border_details']) { if (!$this->mpdf->simpleTables) { $c['border_details']['R'] = $table['border_details']['R']; $c['border_details']['L'] = $table['border_details']['L']; $c['border_details']['T'] = $table['border_details']['T']; $c['border_details']['B'] = $table['border_details']['B']; $c['border'] = $table['border']; $c['border_details']['L']['dom'] = 1; $c['border_details']['R']['dom'] = 1; $c['border_details']['T']['dom'] = 1; $c['border_details']['B']['dom'] = 1; } else if ($this->mpdf->simpleTables && $this->mpdf->row == 0 && $this->mpdf->col == 0) { $table['simple']['border_details']['R'] = $table['border_details']['R']; $table['simple']['border_details']['L'] = $table['border_details']['L']; $table['simple']['border_details']['T'] = $table['border_details']['T']; $table['simple']['border_details']['B'] = $table['border_details']['B']; $table['simple']['border'] = $table['border']; } } } // INHERITED THEAD CSS Properties if ($this->mpdf->tablethead) { if ($this->mpdf->thead_valign_default) $c['va'] = $align[strtolower($this->mpdf->thead_valign_default)]; if ($this->mpdf->thead_textalign_default) $c['a'] = $align[strtolower($this->mpdf->thead_textalign_default)]; if ($this->mpdf->thead_font_weight == 'B') { $this->mpdf->SetStyle('B', true); } if ($this->mpdf->thead_font_style == 'I') { $this->mpdf->SetStyle('I', true); } if ($this->mpdf->thead_font_smCaps == 'S') { $this->mpdf->textvar = ($this->mpdf->textvar | FC_SMALLCAPS); } // mPDF 5.7.1 } // INHERITED TFOOT CSS Properties if ($this->mpdf->tabletfoot) { if ($this->mpdf->tfoot_valign_default) $c['va'] = $align[strtolower($this->mpdf->tfoot_valign_default)]; if ($this->mpdf->tfoot_textalign_default) $c['a'] = $align[strtolower($this->mpdf->tfoot_textalign_default)]; if ($this->mpdf->tfoot_font_weight == 'B') { $this->mpdf->SetStyle('B', true); } if ($this->mpdf->tfoot_font_style == 'I') { $this->mpdf->SetStyle('I', true); } if ($this->mpdf->tfoot_font_style == 'S') { $this->mpdf->textvar = ($this->mpdf->textvar | FC_SMALLCAPS); } // mPDF 5.7.1 } if ($this->mpdf->trow_text_rotate) { $c['R'] = $this->mpdf->trow_text_rotate; } $this->mpdf->cell_border_dominance_L = 0; $this->mpdf->cell_border_dominance_R = 0; $this->mpdf->cell_border_dominance_T = 0; $this->mpdf->cell_border_dominance_B = 0; $properties = $this->mpdf->cssmgr->MergeCSS('TABLE', $tag, $attr); $properties = $this->mpdf->cssmgr->array_merge_recursive_unique($this->mpdf->base_table_properties, $properties); $this->mpdf->Reset(); // mPDF 6 ????????????????????? $this->mpdf->setCSS($properties, 'TABLECELL', $tag); $c['dfs'] = $this->mpdf->FontSize; // Default Font size if (isset($properties['BACKGROUND-COLOR'])) { $c['bgcolor'] = $properties['BACKGROUND-COLOR']; } else if (isset($properties['BACKGROUND'])) { $c['bgcolor'] = $properties['BACKGROUND']; } else if (isset($attr['BGCOLOR'])) $c['bgcolor'] = $attr['BGCOLOR']; /* -- BACKGROUNDS -- */ if (isset($properties['BACKGROUND-GRADIENT'])) { $c['gradient'] = $properties['BACKGROUND-GRADIENT']; } else { $c['gradient'] = false; } if (isset($properties['BACKGROUND-IMAGE']) && $properties['BACKGROUND-IMAGE'] && !$this->mpdf->keep_block_together) { $ret = $this->mpdf->SetBackground($properties, $this->mpdf->blk[$this->mpdf->blklvl]['inner_width']); if ($ret) { $c['background-image'] = $ret; } } /* -- END BACKGROUNDS -- */ if (isset($properties['VERTICAL-ALIGN'])) { $c['va'] = $align[strtolower($properties['VERTICAL-ALIGN'])]; } else if (isset($attr['VALIGN'])) $c['va'] = $align[strtolower($attr['VALIGN'])]; if (isset($properties['TEXT-ALIGN']) && $properties['TEXT-ALIGN']) { if (substr($properties['TEXT-ALIGN'], 0, 1) == 'D') { $c['a'] = $properties['TEXT-ALIGN']; } else { $c['a'] = $align[strtolower($properties['TEXT-ALIGN'])]; } } if (isset($attr['ALIGN']) && $attr['ALIGN']) { if (strtolower($attr['ALIGN']) == 'char') { if (isset($attr['CHAR']) && $attr['CHAR']) { $char = html_entity_decode($attr['CHAR']); $char = strcode2utf($char); $d = array_search($char, $this->mpdf->decimal_align); if ($d !== false) { $c['a'] = $d . 'R'; } } else { $c['a'] = 'DPR'; } } else { $c['a'] = $align[strtolower($attr['ALIGN'])]; } } // mPDF 6 $c['direction'] = $table['direction']; if (isset($attr['DIR']) and $attr['DIR'] != '') { $c['direction'] = strtolower($attr['DIR']); } if (isset($properties['DIRECTION'])) { $c['direction'] = strtolower($properties['DIRECTION']); } if (!$c['a']) { if (isset($c['direction']) && $c['direction'] == 'rtl') { $c['a'] = 'R'; } else { $c['a'] = 'L'; } } $c['cellLineHeight'] = $table['cellLineHeight']; if (isset($properties['LINE-HEIGHT'])) { $c['cellLineHeight'] = $this->mpdf->fixLineheight($properties['LINE-HEIGHT']); } $c['cellLineStackingStrategy'] = $table['cellLineStackingStrategy']; if (isset($properties['LINE-STACKING-STRATEGY'])) { $c['cellLineStackingStrategy'] = strtolower($properties['LINE-STACKING-STRATEGY']); } $c['cellLineStackingShift'] = $table['cellLineStackingShift']; if (isset($properties['LINE-STACKING-SHIFT'])) { $c['cellLineStackingShift'] = strtolower($properties['LINE-STACKING-SHIFT']); } if (isset($properties['TEXT-ROTATE']) && ($properties['TEXT-ROTATE'] || $properties['TEXT-ROTATE'] === "0")) { $c['R'] = $properties['TEXT-ROTATE']; } if (isset($properties['BORDER'])) { $bord = $this->mpdf->border_details($properties['BORDER']); if ($bord['s']) { if (!$this->mpdf->simpleTables) { $c['border'] = _BORDER_ALL; $c['border_details']['R'] = $bord; $c['border_details']['L'] = $bord; $c['border_details']['T'] = $bord; $c['border_details']['B'] = $bord; $c['border_details']['L']['dom'] = $this->mpdf->cell_border_dominance_L; $c['border_details']['R']['dom'] = $this->mpdf->cell_border_dominance_R; $c['border_details']['T']['dom'] = $this->mpdf->cell_border_dominance_T; $c['border_details']['B']['dom'] = $this->mpdf->cell_border_dominance_B; } else if ($this->mpdf->simpleTables && $this->mpdf->row == 0 && $this->mpdf->col == 0) { $table['simple']['border'] = _BORDER_ALL; $table['simple']['border_details']['R'] = $bord; $table['simple']['border_details']['L'] = $bord; $table['simple']['border_details']['T'] = $bord; $table['simple']['border_details']['B'] = $bord; } } } if (!$this->mpdf->simpleTables) { if (isset($properties['BORDER-RIGHT']) && $properties['BORDER-RIGHT']) { $c['border_details']['R'] = $this->mpdf->border_details($properties['BORDER-RIGHT']); $this->mpdf->setBorder($c['border'], _BORDER_RIGHT, $c['border_details']['R']['s']); $c['border_details']['R']['dom'] = $this->mpdf->cell_border_dominance_R; } if (isset($properties['BORDER-LEFT']) && $properties['BORDER-LEFT']) { $c['border_details']['L'] = $this->mpdf->border_details($properties['BORDER-LEFT']); $this->mpdf->setBorder($c['border'], _BORDER_LEFT, $c['border_details']['L']['s']); $c['border_details']['L']['dom'] = $this->mpdf->cell_border_dominance_L; } if (isset($properties['BORDER-BOTTOM']) && $properties['BORDER-BOTTOM']) { $c['border_details']['B'] = $this->mpdf->border_details($properties['BORDER-BOTTOM']); $this->mpdf->setBorder($c['border'], _BORDER_BOTTOM, $c['border_details']['B']['s']); $c['border_details']['B']['dom'] = $this->mpdf->cell_border_dominance_B; } if (isset($properties['BORDER-TOP']) && $properties['BORDER-TOP']) { $c['border_details']['T'] = $this->mpdf->border_details($properties['BORDER-TOP']); $this->mpdf->setBorder($c['border'], _BORDER_TOP, $c['border_details']['T']['s']); $c['border_details']['T']['dom'] = $this->mpdf->cell_border_dominance_T; } } else if ($this->mpdf->simpleTables && $this->mpdf->row == 0 && $this->mpdf->col == 0) { if (isset($properties['BORDER-LEFT']) && $properties['BORDER-LEFT']) { $bord = $this->mpdf->border_details($properties['BORDER-LEFT']); if ($bord['s']) { $table['simple']['border'] = _BORDER_ALL; } else { $table['simple']['border'] = 0; } $table['simple']['border_details']['R'] = $bord; $table['simple']['border_details']['L'] = $bord; $table['simple']['border_details']['T'] = $bord; $table['simple']['border_details']['B'] = $bord; } } if ($this->mpdf->simpleTables && $this->mpdf->row == 0 && $this->mpdf->col == 0 && !$table['borders_separate'] && $table['simple']['border']) { $table['border_details'] = $table['simple']['border_details']; $table['border'] = $table['simple']['border']; } // Border set on TR (if collapsed only) if (!$table['borders_separate'] && !$this->mpdf->simpleTables && isset($table['trborder-left'][$this->mpdf->row])) { if ($this->mpdf->col == 0) { $left = $this->mpdf->border_details($table['trborder-left'][$this->mpdf->row]); $c['border_details']['L'] = $left; $this->mpdf->setBorder($c['border'], _BORDER_LEFT, $c['border_details']['L']['s']); } $c['border_details']['B'] = $this->mpdf->border_details($table['trborder-bottom'][$this->mpdf->row]); $this->mpdf->setBorder($c['border'], _BORDER_BOTTOM, $c['border_details']['B']['s']); $c['border_details']['T'] = $this->mpdf->border_details($table['trborder-top'][$this->mpdf->row]); $this->mpdf->setBorder($c['border'], _BORDER_TOP, $c['border_details']['T']['s']); } if ($this->mpdf->packTableData && !$this->mpdf->simpleTables) { $c['borderbin'] = $this->mpdf->_packCellBorder($c); unset($c['border']); unset($c['border_details']); } if (isset($properties['PADDING-LEFT'])) { $c['padding']['L'] = $this->mpdf->ConvertSize($properties['PADDING-LEFT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['PADDING-RIGHT'])) { $c['padding']['R'] = $this->mpdf->ConvertSize($properties['PADDING-RIGHT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['PADDING-BOTTOM'])) { $c['padding']['B'] = $this->mpdf->ConvertSize($properties['PADDING-BOTTOM'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } if (isset($properties['PADDING-TOP'])) { $c['padding']['T'] = $this->mpdf->ConvertSize($properties['PADDING-TOP'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } $w = ''; if (isset($properties['WIDTH'])) { $w = $properties['WIDTH']; } else if (isset($attr['WIDTH'])) { $w = $attr['WIDTH']; } if ($w) { if (strpos($w, '%') && !$this->mpdf->ignore_table_percents) { $c['wpercent'] = floatval( $w ); } // makes 80% -> 80 else if (!strpos($w, '%') && !$this->mpdf->ignore_table_widths) { $c['w'] = $this->mpdf->ConvertSize($w, $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } } if (isset($properties['HEIGHT']) && !strpos($properties['HEIGHT'], '%')) { $c['h'] = $this->mpdf->ConvertSize($properties['HEIGHT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); } else if (isset($attr['HEIGHT']) && !strpos($attr['HEIGHT'], '%')) $c['h'] = $this->mpdf->ConvertSize($attr['HEIGHT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); if (isset($properties['WHITE-SPACE'])) { if (strtoupper($properties['WHITE-SPACE']) == 'NOWRAP') { $c['nowrap'] = 1; } } $properties = array(); if (isset($attr['TEXT-ROTATE'])) { $c['R'] = $attr['TEXT-ROTATE']; } if (isset($attr['NOWRAP']) && $attr['NOWRAP']) $c['nowrap'] = 1; $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col] = $c; unset($c); $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s'] = 0; $cs = $rs = 1; if (isset($attr['COLSPAN']) && $attr['COLSPAN'] > 1) $cs = $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['colspan'] = $attr['COLSPAN']; if ($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['nc'] < $this->mpdf->col + $cs) { $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['nc'] = $this->mpdf->col + $cs; } // following code moved outside if... for ($l = $this->mpdf->col; $l < $this->mpdf->col + $cs; $l++) { if ($l - $this->mpdf->col) $this->mpdf->cell[$this->mpdf->row][$l] = 0; } if (isset($attr['ROWSPAN']) && $attr['ROWSPAN'] > 1) $rs = $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['rowspan'] = $attr['ROWSPAN']; for ($k = $this->mpdf->row; $k < $this->mpdf->row + $rs; $k++) { for ($l = $this->mpdf->col; $l < $this->mpdf->col + $cs; $l++) { if ($k - $this->mpdf->row || $l - $this->mpdf->col) $this->mpdf->cell[$k][$l] = 0; } } unset($table); break; /* -- END TABLES -- */ }//end of switch } function CloseTag($tag, &$ahtml, &$ihtml) { // mPDF 6 //Closing tag if ($tag == 'OPTION') { $this->mpdf->selectoption['ACTIVE'] = false; $this->mpdf->lastoptionaltag = ''; } if ($tag == 'TTS' or $tag == 'TTA' or $tag == 'TTZ') { if ($this->mpdf->InlineProperties[$tag]) { $this->mpdf->restoreInlineProperties($this->mpdf->InlineProperties[$tag]); } unset($this->mpdf->InlineProperties[$tag]); $ltag = strtolower($tag); $this->mpdf->$ltag = false; } if ($tag == 'FONT' || $tag == 'SPAN' || $tag == 'CODE' || $tag == 'KBD' || $tag == 'SAMP' || $tag == 'TT' || $tag == 'VAR' || $tag == 'INS' || $tag == 'STRONG' || $tag == 'CITE' || $tag == 'SUB' || $tag == 'SUP' || $tag == 'S' || $tag == 'STRIKE' || $tag == 'DEL' || $tag == 'Q' || $tag == 'EM' || $tag == 'B' || $tag == 'I' || $tag == 'U' | $tag == 'SMALL' || $tag == 'BIG' || $tag == 'ACRONYM' || $tag == 'MARK' || $tag == 'TIME' || $tag == 'PROGRESS' || $tag == 'METER' || $tag == 'BDO' || $tag == 'BDI' ) { $annot = false; // mPDF 6 $bdf = false; // mPDF 6 // mPDF 5.7.3 Inline tags if ($tag == 'PROGRESS' || $tag == 'METER') { if (isset($this->mpdf->InlineProperties[$tag]) && $this->mpdf->InlineProperties[$tag]) { $this->mpdf->restoreInlineProperties($this->mpdf->InlineProperties[$tag]); } unset($this->mpdf->InlineProperties[$tag]); if (isset($this->mpdf->InlineAnnots[$tag]) && $this->mpdf->InlineAnnots[$tag]) { $annot = $this->mpdf->InlineAnnots[$tag]; } // *ANNOTATIONS* unset($this->mpdf->InlineAnnots[$tag]); // *ANNOTATIONS* } else { if (isset($this->mpdf->InlineProperties[$tag]) && count($this->mpdf->InlineProperties[$tag])) { $tmpProps = array_pop($this->mpdf->InlineProperties[$tag]); // mPDF 5.7.4 $this->mpdf->restoreInlineProperties($tmpProps); } if (isset($this->mpdf->InlineAnnots[$tag]) && count($this->mpdf->InlineAnnots[$tag])) { // *ANNOTATIONS* $annot = array_pop($this->mpdf->InlineAnnots[$tag]); // *ANNOTATIONS* } // *ANNOTATIONS* if (isset($this->mpdf->InlineBDF[$tag]) && count($this->mpdf->InlineBDF[$tag])) { // mPDF 6 $bdfarr = array_pop($this->mpdf->InlineBDF[$tag]); $bdf = $bdfarr[0]; } } /* -- ANNOTATIONS -- */ if ($annot) { // mPDF 6 if ($this->mpdf->tableLevel) { // *TABLES* $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['textbuffer'][] = array($annot); // *TABLES* } // *TABLES* else { // *TABLES* $this->mpdf->textbuffer[] = array($annot); } // *TABLES* } /* -- END ANNOTATIONS -- */ // mPDF 6 bidi // mPDF 6 Bidirectional formatting for inline elements if ($bdf) { $popf = $this->mpdf->_setBidiCodes('end', $bdf); $this->mpdf->OTLdata = array(); if ($this->mpdf->tableLevel) { $this->mpdf->_saveCellTextBuffer($popf); } else { $this->mpdf->_saveTextBuffer($popf); } } } // End of (most) Inline elements eg SPAN if ($tag == 'METER' || $tag == 'PROGRESS') { $this->mpdf->ignorefollowingspaces = false; $this->mpdf->inMeter = false; } if ($tag == 'A') { $this->mpdf->HREF = ''; if (isset($this->mpdf->InlineProperties['A'])) { $this->mpdf->restoreInlineProperties($this->mpdf->InlineProperties['A']); } unset($this->mpdf->InlineProperties['A']); } if ($tag == 'LEGEND') { if (count($this->mpdf->textbuffer) && !$this->mpdf->tableLevel) { $leg = $this->mpdf->textbuffer[(count($this->mpdf->textbuffer) - 1)]; unset($this->mpdf->textbuffer[(count($this->mpdf->textbuffer) - 1)]); $this->mpdf->textbuffer = array_values($this->mpdf->textbuffer); $this->mpdf->blk[$this->mpdf->blklvl]['border_legend'] = $leg; $this->mpdf->blk[$this->mpdf->blklvl]['margin_top'] += ($leg[11] / 2) / _MPDFK; $this->mpdf->blk[$this->mpdf->blklvl]['padding_top'] += ($leg[11] / 2) / _MPDFK; } if (isset($this->mpdf->InlineProperties['LEGEND'])) { $this->mpdf->restoreInlineProperties($this->mpdf->InlineProperties['LEGEND']); } unset($this->mpdf->InlineProperties['LEGEND']); $this->mpdf->ignorefollowingspaces = true; //Eliminate exceeding left-side spaces } /* -- FORMS -- */ // *********** FORM ELEMENTS ******************** if ($tag == 'TEXTAREA') { $this->mpdf->ignorefollowingspaces = false; $this->mpdf->specialcontent = ''; if ($this->mpdf->InlineProperties[$tag]) { $this->mpdf->restoreInlineProperties($this->mpdf->InlineProperties[$tag]); } unset($this->mpdf->InlineProperties[$tag]); } if ($tag == 'SELECT') { $this->mpdf->ignorefollowingspaces = false; $this->mpdf->lastoptionaltag = ''; $texto = ''; $OTLdata = false; if (isset($this->mpdf->selectoption['SELECTED'])) { $texto = $this->mpdf->selectoption['SELECTED']; } if (isset($this->mpdf->selectoption['SELECTED-OTLDATA'])) { $OTLdata = $this->mpdf->selectoption['SELECTED-OTLDATA']; } if ($this->mpdf->useActiveForms) { $w = $this->mpdf->selectoption['MAXWIDTH']; } else { $w = $this->mpdf->GetStringWidth($texto, true, $OTLdata); } if ($w == 0) { $w = 5; } $objattr['type'] = 'select'; $objattr['text'] = $texto; $objattr['OTLdata'] = $OTLdata; if (isset($this->mpdf->selectoption['NAME'])) { $objattr['fieldname'] = $this->mpdf->selectoption['NAME']; } if (isset($this->mpdf->selectoption['READONLY'])) { $objattr['readonly'] = true; } if (isset($this->mpdf->selectoption['REQUIRED'])) { $objattr['required'] = true; } if (isset($this->mpdf->selectoption['SPELLCHECK'])) { $objattr['spellcheck'] = true; } if (isset($this->mpdf->selectoption['EDITABLE'])) { $objattr['editable'] = true; } if (isset($this->mpdf->selectoption['ONCHANGE'])) { $objattr['onChange'] = $this->mpdf->selectoption['ONCHANGE']; } if (isset($this->mpdf->selectoption['ITEMS'])) { $objattr['items'] = $this->mpdf->selectoption['ITEMS']; } if (isset($this->mpdf->selectoption['MULTIPLE'])) { $objattr['multiple'] = $this->mpdf->selectoption['MULTIPLE']; } if (isset($this->mpdf->selectoption['DISABLED'])) { $objattr['disabled'] = $this->mpdf->selectoption['DISABLED']; } if (isset($this->mpdf->selectoption['TITLE'])) { $objattr['title'] = $this->mpdf->selectoption['TITLE']; } if (isset($this->mpdf->selectoption['COLOR'])) { $objattr['color'] = $this->mpdf->selectoption['COLOR']; } if (isset($this->mpdf->selectoption['SIZE'])) { $objattr['size'] = $this->mpdf->selectoption['SIZE']; } if (isset($objattr['size']) && $objattr['size'] > 1) { $rows = $objattr['size']; } else { $rows = 1; } $objattr['fontfamily'] = $this->mpdf->FontFamily; $objattr['fontsize'] = $this->mpdf->FontSizePt; $objattr['width'] = $w + ($this->mpdf->mpdfform->form_element_spacing['select']['outer']['h'] * 2) + ($this->mpdf->mpdfform->form_element_spacing['select']['inner']['h'] * 2) + ($this->mpdf->FontSize * 1.4); $objattr['height'] = ($this->mpdf->FontSize * $rows) + ($this->mpdf->mpdfform->form_element_spacing['select']['outer']['v'] * 2) + ($this->mpdf->mpdfform->form_element_spacing['select']['inner']['v'] * 2); $e = "\xbb\xa4\xactype=select,objattr=" . serialize($objattr) . "\xbb\xa4\xac"; // Clear properties - tidy up $properties = array(); // Output it to buffers if ($this->mpdf->tableLevel) { // *TABLES* $this->mpdf->_saveCellTextBuffer($e, $this->mpdf->HREF); $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s'] += $objattr['width']; // *TABLES* } // *TABLES* else { // *TABLES* $this->mpdf->_saveTextBuffer($e, $this->mpdf->HREF); } // *TABLES* $this->mpdf->selectoption = array(); $this->mpdf->specialcontent = ''; if ($this->mpdf->InlineProperties[$tag]) { $this->mpdf->restoreInlineProperties($this->mpdf->InlineProperties[$tag]); } unset($this->mpdf->InlineProperties[$tag]); } /* -- END FORMS -- */ // *********** BLOCKS ******************** // mPDF 6 Lists if ($tag == 'P' || $tag == 'DIV' || $tag == 'H1' || $tag == 'H2' || $tag == 'H3' || $tag == 'H4' || $tag == 'H5' || $tag == 'H6' || $tag == 'PRE' || $tag == 'FORM' || $tag == 'ADDRESS' || $tag == 'BLOCKQUOTE' || $tag == 'CENTER' || $tag == 'DT' || $tag == 'DD' || $tag == 'DL' || $tag == 'CAPTION' || $tag == 'FIELDSET' || $tag == 'UL' || $tag == 'OL' || $tag == 'LI' || $tag == 'ARTICLE' || $tag == 'ASIDE' || $tag == 'FIGURE' || $tag == 'FIGCAPTION' || $tag == 'FOOTER' || $tag == 'HEADER' || $tag == 'HGROUP' || $tag == 'MAIN' || $tag == 'NAV' || $tag == 'SECTION' || $tag == 'DETAILS' || $tag == 'SUMMARY' ) { // mPDF 6 bidi // Block // If unicode-bidi set, any embedding levels, isolates, or overrides started by this box are closed if (isset($this->mpdf->blk[$this->mpdf->blklvl]['bidicode'])) { $blockpost = $this->mpdf->_setBidiCodes('end', $this->mpdf->blk[$this->mpdf->blklvl]['bidicode']); if ($blockpost) { $this->mpdf->OTLdata = array(); if ($this->mpdf->tableLevel) { $this->mpdf->_saveCellTextBuffer($blockpost); } else { $this->mpdf->_saveTextBuffer($blockpost); } } } $this->mpdf->ignorefollowingspaces = true; //Eliminate exceeding left-side spaces $this->mpdf->blockjustfinished = true; $this->mpdf->lastblockbottommargin = $this->mpdf->blk[$this->mpdf->blklvl]['margin_bottom']; // mPDF 6 Lists if ($tag == 'UL' || $tag == 'OL') { if ($this->mpdf->listlvl > 0 && $this->mpdf->tableLevel) { if (isset($this->mpdf->listtype[$this->mpdf->listlvl])) unset($this->mpdf->listtype[$this->mpdf->listlvl]); } $this->mpdf->listlvl--; $this->mpdf->listitem = array(); } if ($tag == 'LI') { $this->mpdf->listitem = array(); } if (preg_match('/^H\d/', $tag) && !$this->mpdf->tableLevel && !$this->mpdf->writingToC) { if (isset($this->mpdf->h2toc[$tag]) || isset($this->mpdf->h2bookmarks[$tag])) { $content = ''; if (count($this->mpdf->textbuffer) == 1) { $content = $this->mpdf->textbuffer[0][0]; } else { for ($i = 0; $i < count($this->mpdf->textbuffer); $i++) { if (substr($this->mpdf->textbuffer[$i][0], 0, 3) != "\xbb\xa4\xac") { //inline object $content .= $this->mpdf->textbuffer[$i][0]; } } } /* -- TOC -- */ if (isset($this->mpdf->h2toc[$tag])) { $objattr = array(); $objattr['type'] = 'toc'; $objattr['toclevel'] = $this->mpdf->h2toc[$tag]; $objattr['CONTENT'] = htmlspecialchars($content); $e = "\xbb\xa4\xactype=toc,objattr=" . serialize($objattr) . "\xbb\xa4\xac"; array_unshift($this->mpdf->textbuffer, array($e)); } /* -- END TOC -- */ /* -- BOOKMARKS -- */ if (isset($this->mpdf->h2bookmarks[$tag])) { $objattr = array(); $objattr['type'] = 'bookmark'; $objattr['bklevel'] = $this->mpdf->h2bookmarks[$tag]; $objattr['CONTENT'] = $content; $e = "\xbb\xa4\xactype=toc,objattr=" . serialize($objattr) . "\xbb\xa4\xac"; array_unshift($this->mpdf->textbuffer, array($e)); } /* -- END BOOKMARKS -- */ } } /* -- TABLES -- */ if ($this->mpdf->tableLevel) { if ($this->mpdf->linebreakjustfinished) { $this->mpdf->blockjustfinished = false; } if (isset($this->mpdf->InlineProperties['BLOCKINTABLE'])) { if ($this->mpdf->InlineProperties['BLOCKINTABLE']) { $this->mpdf->restoreInlineProperties($this->mpdf->InlineProperties['BLOCKINTABLE']); } unset($this->mpdf->InlineProperties['BLOCKINTABLE']); } if ($tag == 'PRE') { $this->mpdf->ispre = false; } return; } /* -- END TABLES -- */ $this->mpdf->lastoptionaltag = ''; $this->mpdf->divbegin = false; $this->mpdf->linebreakjustfinished = false; $this->mpdf->x = $this->mpdf->lMargin + $this->mpdf->blk[$this->mpdf->blklvl]['outer_left_margin']; /* -- CSS-FLOAT -- */ // If float contained in a float, need to extend bottom to allow for it $currpos = $this->mpdf->page * 1000 + $this->mpdf->y; if (isset($this->mpdf->blk[$this->mpdf->blklvl]['float_endpos']) && $this->mpdf->blk[$this->mpdf->blklvl]['float_endpos'] > $currpos) { $old_page = $this->mpdf->page; $new_page = intval($this->mpdf->blk[$this->mpdf->blklvl]['float_endpos'] / 1000); if ($old_page != $new_page) { $s = $this->mpdf->PrintPageBackgrounds(); // Writes after the marker so not overwritten later by page background etc. $this->mpdf->pages[$this->mpdf->page] = preg_replace('/(___BACKGROUND___PATTERNS' . $this->mpdf->uniqstr . ')/', '\\1' . "\n" . $s . "\n", $this->mpdf->pages[$this->mpdf->page]); $this->mpdf->pageBackgrounds = array(); $this->mpdf->page = $new_page; $this->mpdf->ResetMargins(); $this->mpdf->Reset(); $this->mpdf->pageoutput[$this->mpdf->page] = array(); } $this->mpdf->y = (($this->mpdf->blk[$this->mpdf->blklvl]['float_endpos'] * 1000) % 1000000) / 1000; // mod changes operands to integers before processing } /* -- END CSS-FLOAT -- */ //Print content if ($this->mpdf->lastblocklevelchange == 1) { $blockstate = 3; } // Top & bottom margins/padding else if ($this->mpdf->lastblocklevelchange == -1) { $blockstate = 2; } // Bottom margins/padding only else { $blockstate = 0; } // called from after e.g. </table> </div> </div> ... Outputs block margin/border and padding if (count($this->mpdf->textbuffer) && $this->mpdf->textbuffer[count($this->mpdf->textbuffer) - 1]) { if (substr($this->mpdf->textbuffer[count($this->mpdf->textbuffer) - 1][0], 0, 3) != "\xbb\xa4\xac") { // not special content // Right trim last content and adjust OTLdata if (preg_match('/[ ]+$/', $this->mpdf->textbuffer[count($this->mpdf->textbuffer) - 1][0], $m)) { $strip = strlen($m[0]); $this->mpdf->textbuffer[count($this->mpdf->textbuffer) - 1][0] = substr($this->mpdf->textbuffer[count($this->mpdf->textbuffer) - 1][0], 0, (strlen($this->mpdf->textbuffer[count($this->mpdf->textbuffer) - 1][0]) - $strip)); /* -- OTL -- */ if (isset($this->mpdf->CurrentFont['useOTL']) && $this->mpdf->CurrentFont['useOTL']) { $this->mpdf->otl->trimOTLdata($this->mpdf->textbuffer[count($this->mpdf->textbuffer) - 1][18], false, true); // mPDF 6 ZZZ99K } /* -- END OTL -- */ } } } if (count($this->mpdf->textbuffer) == 0 && $this->mpdf->lastblocklevelchange != 0) { //$this->mpdf->newFlowingBlock( $this->mpdf->blk[$this->mpdf->blklvl]['width'],$this->mpdf->lineheight,'',false,2,true, (isset($this->mpdf->blk[$this->mpdf->blklvl]['direction']) ? $this->mpdf->blk[$this->mpdf->blklvl]['direction'] : 'ltr')); $this->mpdf->newFlowingBlock($this->mpdf->blk[$this->mpdf->blklvl]['width'], $this->mpdf->lineheight, '', false, $blockstate, true, (isset($this->mpdf->blk[$this->mpdf->blklvl]['direction']) ? $this->mpdf->blk[$this->mpdf->blklvl]['direction'] : 'ltr')); $this->mpdf->finishFlowingBlock(true); // true = END of flowing block $this->mpdf->PaintDivBB('', $blockstate); } else { $this->mpdf->printbuffer($this->mpdf->textbuffer, $blockstate); } $this->mpdf->textbuffer = array(); if ($this->mpdf->kwt) { $this->mpdf->kwt_height = $this->mpdf->y - $this->mpdf->kwt_y0; } /* -- CSS-IMAGE-FLOAT -- */ $this->mpdf->printfloatbuffer(); /* -- END CSS-IMAGE-FLOAT -- */ if ($tag == 'PRE') { $this->mpdf->ispre = false; } /* -- CSS-FLOAT -- */ if ($this->mpdf->blk[$this->mpdf->blklvl]['float'] == 'R') { // If width not set, here would need to adjust and output buffer $s = $this->mpdf->PrintPageBackgrounds(); // Writes after the marker so not overwritten later by page background etc. $this->mpdf->pages[$this->mpdf->page] = preg_replace('/(___BACKGROUND___PATTERNS' . $this->mpdf->uniqstr . ')/', '\\1' . "\n" . $s . "\n", $this->mpdf->pages[$this->mpdf->page]); $this->mpdf->pageBackgrounds = array(); $this->mpdf->Reset(); $this->mpdf->pageoutput[$this->mpdf->page] = array(); for ($i = ($this->mpdf->blklvl - 1); $i >= 0; $i--) { if (isset($this->mpdf->blk[$i]['float_endpos'])) { $this->mpdf->blk[$i]['float_endpos'] = max($this->mpdf->blk[$i]['float_endpos'], ($this->mpdf->page * 1000 + $this->mpdf->y)); } else { $this->mpdf->blk[$i]['float_endpos'] = $this->mpdf->page * 1000 + $this->mpdf->y; } } $this->mpdf->floatDivs[] = array( 'side' => 'R', 'startpage' => $this->mpdf->blk[$this->mpdf->blklvl]['startpage'], 'y0' => $this->mpdf->blk[$this->mpdf->blklvl]['float_start_y'], 'startpos' => ($this->mpdf->blk[$this->mpdf->blklvl]['startpage'] * 1000 + $this->mpdf->blk[$this->mpdf->blklvl]['float_start_y']), 'endpage' => $this->mpdf->page, 'y1' => $this->mpdf->y, 'endpos' => ($this->mpdf->page * 1000 + $this->mpdf->y), 'w' => $this->mpdf->blk[$this->mpdf->blklvl]['float_width'], 'blklvl' => $this->mpdf->blklvl, 'blockContext' => $this->mpdf->blk[$this->mpdf->blklvl - 1]['blockContext'] ); $this->mpdf->y = $this->mpdf->blk[$this->mpdf->blklvl]['float_start_y']; $this->mpdf->page = $this->mpdf->blk[$this->mpdf->blklvl]['startpage']; $this->mpdf->ResetMargins(); $this->mpdf->pageoutput[$this->mpdf->page] = array(); } if ($this->mpdf->blk[$this->mpdf->blklvl]['float'] == 'L') { // If width not set, here would need to adjust and output buffer $s = $this->mpdf->PrintPageBackgrounds(); // Writes after the marker so not overwritten later by page background etc. $this->mpdf->pages[$this->mpdf->page] = preg_replace('/(___BACKGROUND___PATTERNS' . $this->mpdf->uniqstr . ')/', '\\1' . "\n" . $s . "\n", $this->mpdf->pages[$this->mpdf->page]); $this->mpdf->pageBackgrounds = array(); $this->mpdf->Reset(); $this->mpdf->pageoutput[$this->mpdf->page] = array(); for ($i = ($this->mpdf->blklvl - 1); $i >= 0; $i--) { if (isset($this->mpdf->blk[$i]['float_endpos'])) { $this->mpdf->blk[$i]['float_endpos'] = max($this->mpdf->blk[$i]['float_endpos'], ($this->mpdf->page * 1000 + $this->mpdf->y)); } else { $this->mpdf->blk[$i]['float_endpos'] = $this->mpdf->page * 1000 + $this->mpdf->y; } } $this->mpdf->floatDivs[] = array( 'side' => 'L', 'startpage' => $this->mpdf->blk[$this->mpdf->blklvl]['startpage'], 'y0' => $this->mpdf->blk[$this->mpdf->blklvl]['float_start_y'], 'startpos' => ($this->mpdf->blk[$this->mpdf->blklvl]['startpage'] * 1000 + $this->mpdf->blk[$this->mpdf->blklvl]['float_start_y']), 'endpage' => $this->mpdf->page, 'y1' => $this->mpdf->y, 'endpos' => ($this->mpdf->page * 1000 + $this->mpdf->y), 'w' => $this->mpdf->blk[$this->mpdf->blklvl]['float_width'], 'blklvl' => $this->mpdf->blklvl, 'blockContext' => $this->mpdf->blk[$this->mpdf->blklvl - 1]['blockContext'] ); $this->mpdf->y = $this->mpdf->blk[$this->mpdf->blklvl]['float_start_y']; $this->mpdf->page = $this->mpdf->blk[$this->mpdf->blklvl]['startpage']; $this->mpdf->ResetMargins(); $this->mpdf->pageoutput[$this->mpdf->page] = array(); } /* -- END CSS-FLOAT -- */ if (isset($this->mpdf->blk[$this->mpdf->blklvl]['visibility']) && $this->mpdf->blk[$this->mpdf->blklvl]['visibility'] != 'visible') { $this->mpdf->SetVisibility('visible'); } if (isset($this->mpdf->blk[$this->mpdf->blklvl]['page_break_after'])) { $page_break_after = $this->mpdf->blk[$this->mpdf->blklvl]['page_break_after']; } else { $page_break_after = ''; } //Reset values $this->mpdf->Reset(); if (isset($this->mpdf->blk[$this->mpdf->blklvl]['z-index']) && $this->mpdf->blk[$this->mpdf->blklvl]['z-index'] > 0) { $this->mpdf->EndLayer(); } // mPDF 6 page-break-inside:avoid if ($this->mpdf->blk[$this->mpdf->blklvl]['keep_block_together']) { $movepage = false; // If page-break-inside:avoid section has broken to new page but fits on one side - then move: if (($this->mpdf->page - $this->mpdf->kt_p00) == 1 && $this->mpdf->y < $this->mpdf->kt_y00) { $movepage = true; } if (($this->mpdf->page - $this->mpdf->kt_p00) > 0) { for ($i = $this->mpdf->page; $i > $this->mpdf->kt_p00; $i--) { unset($this->mpdf->pages[$i]); if (isset($this->mpdf->blk[$this->mpdf->blklvl]['bb_painted'][$i])) { unset($this->mpdf->blk[$this->mpdf->blklvl]['bb_painted'][$i]); } if (isset($this->mpdf->blk[$this->mpdf->blklvl]['marginCorrected'][$i])) { unset($this->mpdf->blk[$this->mpdf->blklvl]['marginCorrected'][$i]); } if (isset($this->mpdf->pageoutput[$i])) { unset($this->mpdf->pageoutput[$i]); } } $this->mpdf->page = $this->mpdf->kt_p00; } $this->mpdf->keep_block_together = 0; $this->mpdf->pageoutput[$this->mpdf->page] = array(); $this->mpdf->y = $this->mpdf->kt_y00; $ihtml = $this->mpdf->blk[$this->mpdf->blklvl]['array_i'] - 1; $ahtml[$ihtml + 1] .= ' pagebreakavoidchecked="true";'; // avoid re-iterating; read in OpenTag() unset($this->mpdf->blk[$this->mpdf->blklvl]); $this->mpdf->blklvl--; for ($blklvl = 1; $blklvl <= $this->mpdf->blklvl; $blklvl++) { $this->mpdf->blk[$blklvl]['y0'] = $this->mpdf->blk[$blklvl]['initial_y0']; $this->mpdf->blk[$blklvl]['x0'] = $this->mpdf->blk[$blklvl]['initial_x0']; $this->mpdf->blk[$blklvl]['startpage'] = $this->mpdf->blk[$blklvl]['initial_startpage']; } if (isset($this->mpdf->blk[$this->mpdf->blklvl]['x0'])) { $this->mpdf->x = $this->mpdf->blk[$this->mpdf->blklvl]['x0']; } else { $this->mpdf->x = $this->mpdf->lMargin; } $this->mpdf->lastblocklevelchange = 0; $this->mpdf->ResetMargins(); if ($movepage) { $this->mpdf->AddPage(); } return; } if ($this->mpdf->blklvl > 0) { // ==0 SHOULDN'T HAPPEN - NOT XHTML if ($this->mpdf->blk[$this->mpdf->blklvl]['tag'] == $tag) { unset($this->mpdf->blk[$this->mpdf->blklvl]); $this->mpdf->blklvl--; } //else { echo $tag; exit; } // debug - forces error if incorrectly nested html tags } $this->mpdf->lastblocklevelchange = -1; // Reset Inline-type properties if (isset($this->mpdf->blk[$this->mpdf->blklvl]['InlineProperties'])) { $this->mpdf->restoreInlineProperties($this->mpdf->blk[$this->mpdf->blklvl]['InlineProperties']); } $this->mpdf->x = $this->mpdf->lMargin + $this->mpdf->blk[$this->mpdf->blklvl]['outer_left_margin']; if (!$this->mpdf->tableLevel && $page_break_after) { $save_blklvl = $this->mpdf->blklvl; $save_blk = $this->mpdf->blk; $save_silp = $this->mpdf->saveInlineProperties(); $save_ilp = $this->mpdf->InlineProperties; $save_bflp = $this->mpdf->InlineBDF; $save_bflpc = $this->mpdf->InlineBDFctr; // mPDF 6 // mPDF 6 pagebreaktype $startpage = $this->mpdf->page; $pagebreaktype = $this->mpdf->defaultPagebreakType; if ($this->mpdf->ColActive) { $pagebreaktype = 'cloneall'; } // mPDF 6 pagebreaktype $this->mpdf->_preForcedPagebreak($pagebreaktype); if ($page_break_after == 'RIGHT') { $this->mpdf->AddPage($this->mpdf->CurOrientation, 'NEXT-ODD', '', '', '', '', '', '', '', '', '', '', '', '', '', 0, 0, 0, 0); } else if ($page_break_after == 'LEFT') { $this->mpdf->AddPage($this->mpdf->CurOrientation, 'NEXT-EVEN', '', '', '', '', '', '', '', '', '', '', '', '', '', 0, 0, 0, 0); } else { $this->mpdf->AddPage($this->mpdf->CurOrientation, '', '', '', '', '', '', '', '', '', '', '', '', '', '', 0, 0, 0, 0); } // mPDF 6 pagebreaktype $this->mpdf->_postForcedPagebreak($pagebreaktype, $startpage, $save_blk, $save_blklvl); $this->mpdf->InlineProperties = $save_ilp; $this->mpdf->InlineBDF = $save_bflp; $this->mpdf->InlineBDFctr = $save_bflpc; // mPDF 6 $this->mpdf->restoreInlineProperties($save_silp); } // mPDF 6 bidi // Block // If unicode-bidi set, any embedding levels, isolates, or overrides reopened in the continuing block if (isset($this->mpdf->blk[$this->mpdf->blklvl]['bidicode'])) { $blockpre = $this->mpdf->_setBidiCodes('start', $this->mpdf->blk[$this->mpdf->blklvl]['bidicode']); if ($blockpre) { $this->mpdf->OTLdata = array(); if ($this->mpdf->tableLevel) { $this->mpdf->_saveCellTextBuffer($blockpre); } else { $this->mpdf->_saveTextBuffer($blockpre); } } } } /* -- TABLES -- */ if ($tag == 'TH') $this->mpdf->SetStyle('B', false); if (($tag == 'TH' or $tag == 'TD') && $this->mpdf->tableLevel) { $this->mpdf->lastoptionaltag = 'TR'; unset($this->mpdf->cssmgr->tablecascadeCSS[$this->mpdf->cssmgr->tbCSSlvl]); $this->mpdf->cssmgr->tbCSSlvl--; if (!$this->mpdf->tdbegin) { return; } $this->mpdf->tdbegin = false; // Added for correct calculation of cell column width - otherwise misses the last line if not end </p> etc. if (!isset($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'])) { if (!is_array($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col])) { throw new MpdfException("You may have an error in your HTML code e.g. &lt;/td&gt;&lt;/td&gt;"); } $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'] = $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s']; } elseif ($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'] < $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s']) { $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'] = $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s']; } // Remove last <br> if at end of cell if (isset($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['textbuffer'])) { $ntb = count($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['textbuffer']); } else { $ntb = 0; } if ($ntb > 1 && $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['textbuffer'][$ntb - 1][0] == "\n") { unset($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['textbuffer'][$ntb - 1]); } if ($this->mpdf->tablethead) { $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_thead'][$this->mpdf->row] = true; if ($this->mpdf->tableLevel == 1) { $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['headernrows'] = max($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['headernrows'], ($this->mpdf->row + 1)); } } if ($this->mpdf->tabletfoot) { $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot'][$this->mpdf->row] = true; if ($this->mpdf->tableLevel == 1) { $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['footernrows'] = max($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['footernrows'], ($this->mpdf->row + 1 - $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['headernrows'])); } } $this->mpdf->Reset(); } if ($tag == 'TR' && $this->mpdf->tableLevel) { // If Border set on TR - Update right border if (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['trborder-left'][$this->mpdf->row])) { $c = & $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]; if ($c) { if ($this->mpdf->packTableData) { $cell = $this->mpdf->_unpackCellBorder($c['borderbin']); } else { $cell = $c; } $cell['border_details']['R'] = $this->mpdf->border_details($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['trborder-right'][$this->mpdf->row]); $this->mpdf->setBorder($cell['border'], _BORDER_RIGHT, $cell['border_details']['R']['s']); if ($this->mpdf->packTableData) { $c['borderbin'] = $this->mpdf->_packCellBorder($cell); unset($c['border']); unset($c['border_details']); } else { $c = $cell; } } } $this->mpdf->lastoptionaltag = ''; unset($this->mpdf->cssmgr->tablecascadeCSS[$this->mpdf->cssmgr->tbCSSlvl]); $this->mpdf->cssmgr->tbCSSlvl--; $this->mpdf->trow_text_rotate = ''; $this->mpdf->tabletheadjustfinished = false; } if ($tag == 'TBODY') { $this->mpdf->lastoptionaltag = ''; unset($this->mpdf->cssmgr->tablecascadeCSS[$this->mpdf->cssmgr->tbCSSlvl]); $this->mpdf->cssmgr->tbCSSlvl--; } if ($tag == 'THEAD') { $this->mpdf->lastoptionaltag = ''; unset($this->mpdf->cssmgr->tablecascadeCSS[$this->mpdf->cssmgr->tbCSSlvl]); $this->mpdf->cssmgr->tbCSSlvl--; $this->mpdf->tablethead = 0; $this->mpdf->tabletheadjustfinished = true; $this->mpdf->ResetStyles(); $this->mpdf->thead_font_weight = ''; $this->mpdf->thead_font_style = ''; $this->mpdf->thead_font_smCaps = ''; $this->mpdf->thead_valign_default = ''; $this->mpdf->thead_textalign_default = ''; } if ($tag == 'TFOOT') { $this->mpdf->lastoptionaltag = ''; unset($this->mpdf->cssmgr->tablecascadeCSS[$this->mpdf->cssmgr->tbCSSlvl]); $this->mpdf->cssmgr->tbCSSlvl--; $this->mpdf->tabletfoot = 0; $this->mpdf->ResetStyles(); $this->mpdf->tfoot_font_weight = ''; $this->mpdf->tfoot_font_style = ''; $this->mpdf->tfoot_font_smCaps = ''; $this->mpdf->tfoot_valign_default = ''; $this->mpdf->tfoot_textalign_default = ''; } if ($tag == 'TABLE') { // TABLE-END ( if ($this->mpdf->progressBar) { $this->mpdf->UpdateProgressBar(1, '', 'TABLE'); } // *PROGRESS-BAR* if ($this->mpdf->progressBar) { $this->mpdf->UpdateProgressBar(7, 0, ''); } // *PROGRESS-BAR* $this->mpdf->lastoptionaltag = ''; unset($this->mpdf->cssmgr->tablecascadeCSS[$this->mpdf->cssmgr->tbCSSlvl]); $this->mpdf->cssmgr->tbCSSlvl--; $this->mpdf->ignorefollowingspaces = true; //Eliminate exceeding left-side spaces // mPDF 5.7.3 // In case a colspan (on a row after first row) exceeded number of columns in table for ($k = 0; $k < $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['nr']; $k++) { for ($l = 0; $l < $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['nc']; $l++) { if (!isset($this->mpdf->cell[$k][$l])) { for ($n = $l - 1; $n >= 0; $n--) { if (isset($this->mpdf->cell[$k][$n]) && $this->mpdf->cell[$k][$n] != 0) { break; } } $this->mpdf->cell[$k][$l] = array( 'a' => 'C', 'va' => 'M', 'R' => false, 'nowrap' => false, 'bgcolor' => false, 'padding' => array('L' => false, 'R' => false, 'T' => false, 'B' => false), 'gradient' => false, 's' => 0, 'maxs' => 0, 'textbuffer' => array(), 'dfs' => $this->mpdf->FontSize, ); if (!$this->mpdf->simpleTables) { $this->mpdf->cell[$k][$l]['border'] = 0; $this->mpdf->cell[$k][$l]['border_details']['R'] = array('s' => 0, 'w' => 0, 'c' => false, 'style' => 'none', 'dom' => 0); $this->mpdf->cell[$k][$l]['border_details']['L'] = array('s' => 0, 'w' => 0, 'c' => false, 'style' => 'none', 'dom' => 0); $this->mpdf->cell[$k][$l]['border_details']['T'] = array('s' => 0, 'w' => 0, 'c' => false, 'style' => 'none', 'dom' => 0); $this->mpdf->cell[$k][$l]['border_details']['B'] = array('s' => 0, 'w' => 0, 'c' => false, 'style' => 'none', 'dom' => 0); $this->mpdf->cell[$k][$l]['border_details']['mbw'] = array('BL' => 0, 'BR' => 0, 'RT' => 0, 'RB' => 0, 'TL' => 0, 'TR' => 0, 'LT' => 0, 'LB' => 0); if ($this->mpdf->packTableData) { $this->mpdf->cell[$k][$l]['borderbin'] = $this->mpdf->_packCellBorder($this->mpdf->cell[$k][$l]); unset($this->mpdf->cell[$k][$l]['border']); unset($this->mpdf->cell[$k][$l]['border_details']); } } } } } $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['cells'] = $this->mpdf->cell; $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['wc'] = array_pad(array(), $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['nc'], array('miw' => 0, 'maw' => 0)); $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['hr'] = array_pad(array(), $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['nr'], 0); // Move table footer <tfoot> row to end of table if (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot']) && count($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot'])) { $tfrows = array(); foreach ($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot'] AS $r => $val) { if ($val) { $tfrows[] = $r; } } $temp = array(); $temptf = array(); foreach ($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['cells'] AS $k => $row) { if (in_array($k, $tfrows)) { $temptf[] = $row; } else { $temp[] = $row; } } $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot'] = array(); for ($i = count($temp); $i < (count($temp) + count($temptf)); $i++) { $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot'][$i] = true; } // Update nestedpos row references if (isset($this->mpdf->table[($this->mpdf->tableLevel + 1)]) && count($this->mpdf->table[($this->mpdf->tableLevel + 1)])) { foreach ($this->mpdf->table[($this->mpdf->tableLevel + 1)] AS $nid => $nested) { $this->mpdf->table[($this->mpdf->tableLevel + 1)][$nid]['nestedpos'][0] -= count($temptf); } } $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['cells'] = array_merge($temp, $temptf); // Update other arays set on row number // [trbackground-images] [trgradients] $temptrbgi = array(); $temptrbgg = array(); $temptrbgc = array(); if (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['bgcolor'][-1])) { $temptrbgc[-1] = $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['bgcolor'][-1]; } for ($k = 0; $k < $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['nr']; $k++) { if (!in_array($k, $tfrows)) { $temptrbgi[] = (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['trbackground-images'][$k]) ? $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['trbackground-images'][$k] : null); $temptrbgg[] = (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['trgradients'][$k]) ? $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['trgradients'][$k] : null); $temptrbgc[] = (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['bgcolor'][$k]) ? $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['bgcolor'][$k] : null); } } for ($k = 0; $k < $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['nr']; $k++) { if (in_array($k, $tfrows)) { $temptrbgi[] = (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['trbackground-images'][$k]) ? $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['trbackground-images'][$k] : null); $temptrbgg[] = (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['trgradients'][$k]) ? $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['trgradients'][$k] : null); $temptrbgc[] = (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['bgcolor'][$k]) ? $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['bgcolor'][$k] : null); } } $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['trbackground-images'] = $temptrbgi; $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['trgradients'] = $temptrbgg; $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['bgcolor'] = $temptrbgc; // Should Update all other arays set on row number, but cell properties have been set so not needed // [bgcolor] [trborder-left] [trborder-right] [trborder-top] [trborder-bottom] } if ($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['direction'] == 'rtl') { $this->mpdf->_reverseTableDir($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]); } // Fix Borders ********************************************* $this->mpdf->_fixTableBorders($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]); if ($this->mpdf->progressBar) { $this->mpdf->UpdateProgressBar(7, 10, ' '); } // *PROGRESS-BAR* if ($this->mpdf->ColActive) { $this->mpdf->table_rotate = 0; } // *COLUMNS* if ($this->mpdf->table_rotate <> 0) { $this->mpdf->tablebuffer = ''; // Max width for rotated table $this->mpdf->tbrot_maxw = $this->mpdf->h - ($this->mpdf->y + $this->mpdf->bMargin + 1); $this->mpdf->tbrot_maxh = $this->mpdf->blk[$this->mpdf->blklvl]['inner_width']; // Max width for rotated table $this->mpdf->tbrot_align = $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['a']; } $this->mpdf->shrin_k = 1; if ($this->mpdf->shrink_tables_to_fit < 1) { $this->mpdf->shrink_tables_to_fit = 1; } if (!$this->mpdf->shrink_this_table_to_fit) { $this->mpdf->shrink_this_table_to_fit = $this->mpdf->shrink_tables_to_fit; } if ($this->mpdf->tableLevel > 1) { // deal with nested table $this->mpdf->_tableColumnWidth($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]], true); $tmiw = $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['miw']; $tmaw = $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['maw']; $tl = $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['tl']; // Go down to lower table level $this->mpdf->tableLevel--; // Reset lower level table $this->mpdf->base_table_properties = $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['baseProperties']; // mPDF 5.7.3 $this->mpdf->default_font = $this->mpdf->base_table_properties['FONT-FAMILY']; $this->mpdf->SetFont($this->mpdf->default_font, '', 0, false); $this->mpdf->default_font_size = $this->mpdf->ConvertSize($this->mpdf->base_table_properties['FONT-SIZE']) * (_MPDFK); $this->mpdf->SetFontSize($this->mpdf->default_font_size, false); $this->mpdf->cell = $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['cells']; if (isset($this->mpdf->cell['PARENTCELL'])) { if ($this->mpdf->cell['PARENTCELL']) { $this->mpdf->restoreInlineProperties($this->mpdf->cell['PARENTCELL']); } unset($this->mpdf->cell['PARENTCELL']); } $this->mpdf->row = $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['currrow']; $this->mpdf->col = $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['currcol']; $objattr = array(); $objattr['type'] = 'nestedtable'; $objattr['nestedcontent'] = $this->mpdf->tbctr[($this->mpdf->tableLevel + 1)]; $objattr['table'] = $this->mpdf->tbctr[$this->mpdf->tableLevel]; $objattr['row'] = $this->mpdf->row; $objattr['col'] = $this->mpdf->col; $objattr['level'] = $this->mpdf->tableLevel; $e = "\xbb\xa4\xactype=nestedtable,objattr=" . serialize($objattr) . "\xbb\xa4\xac"; $this->mpdf->_saveCellTextBuffer($e); $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s'] += $tl; if (!isset($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'])) { $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'] = $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s']; } elseif ($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'] < $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s']) { $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'] = $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s']; } $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s'] = 0; // reset if ((isset($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['nestedmaw']) && $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['nestedmaw'] < $tmaw) || !isset($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['nestedmaw'])) { $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['nestedmaw'] = $tmaw; } if ((isset($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['nestedmiw']) && $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['nestedmiw'] < $tmiw) || !isset($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['nestedmiw'])) { $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['nestedmiw'] = $tmiw; } $this->mpdf->tdbegin = true; $this->mpdf->nestedtablejustfinished = true; $this->mpdf->ignorefollowingspaces = true; return; } $this->mpdf->cMarginL = 0; $this->mpdf->cMarginR = 0; $this->mpdf->cMarginT = 0; $this->mpdf->cMarginB = 0; $this->mpdf->cellPaddingL = 0; $this->mpdf->cellPaddingR = 0; $this->mpdf->cellPaddingT = 0; $this->mpdf->cellPaddingB = 0; if (isset($this->mpdf->table[1][1]['overflow']) && $this->mpdf->table[1][1]['overflow'] == 'visible') { if ($this->mpdf->kwt || $this->mpdf->table_rotate || $this->mpdf->table_keep_together || $this->mpdf->ColActive) { $this->mpdf->kwt = false; $this->mpdf->table_rotate = 0; $this->mpdf->table_keep_together = false; //throw new MpdfException("mPDF Warning: You cannot use CSS overflow:visible together with any of these functions: 'Keep-with-table', rotated tables, page-break-inside:avoid, or columns"); } $this->mpdf->_tableColumnWidth($this->mpdf->table[1][1], true); $this->mpdf->_tableWidth($this->mpdf->table[1][1]); } else { if (!$this->mpdf->kwt_saved) { $this->mpdf->kwt_height = 0; } list($check, $tablemiw) = $this->mpdf->_tableColumnWidth($this->mpdf->table[1][1], true); $save_table = $this->mpdf->table; $reset_to_minimum_width = false; $added_page = false; if ($check > 1) { if ($check > $this->mpdf->shrink_this_table_to_fit && $this->mpdf->table_rotate) { if ($this->mpdf->y != $this->mpdf->tMargin) { $this->mpdf->AddPage($this->mpdf->CurOrientation); $this->mpdf->kwt_moved = true; } $added_page = true; $this->mpdf->tbrot_maxw = $this->mpdf->h - ($this->mpdf->y + $this->mpdf->bMargin + 5) - $this->mpdf->kwt_height; //$check = $tablemiw/$this->mpdf->tbrot_maxw; // undo any shrink $check = 1; // undo any shrink } $reset_to_minimum_width = true; } if ($reset_to_minimum_width) { $this->mpdf->shrin_k = $check; $this->mpdf->default_font_size /= $this->mpdf->shrin_k; $this->mpdf->SetFontSize($this->mpdf->default_font_size, false); $this->mpdf->shrinkTable($this->mpdf->table[1][1], $this->mpdf->shrin_k); $this->mpdf->_tableColumnWidth($this->mpdf->table[1][1], false); // repeat // Starting at $this->mpdf->innermostTableLevel // Shrink table values - and redo columnWidth for ($lvl = 2; $lvl <= $this->mpdf->innermostTableLevel; $lvl++) { for ($nid = 1; $nid <= $this->mpdf->tbctr[$lvl]; $nid++) { $this->mpdf->shrinkTable($this->mpdf->table[$lvl][$nid], $this->mpdf->shrin_k); $this->mpdf->_tableColumnWidth($this->mpdf->table[$lvl][$nid], false); } } } // Set table cell widths for top level table // Use $shrin_k to resize but don't change again $this->mpdf->SetLineHeight('', $this->mpdf->table[1][1]['cellLineHeight']); // Top level table $this->mpdf->_tableWidth($this->mpdf->table[1][1]); } // Now work through any nested tables setting child table[w'] = parent cell['w'] // Now do nested tables _tableWidth for ($lvl = 2; $lvl <= $this->mpdf->innermostTableLevel; $lvl++) { for ($nid = 1; $nid <= $this->mpdf->tbctr[$lvl]; $nid++) { // HERE set child table width = cell width list($parentrow, $parentcol, $parentnid) = $this->mpdf->table[$lvl][$nid]['nestedpos']; $c = & $this->mpdf->table[($lvl - 1)][$parentnid]['cells'][$parentrow][$parentcol]; if (isset($c['colspan']) && $c['colspan'] > 1) { $parentwidth = 0; for ($cs = 0; $cs < $c['colspan']; $cs++) { $parentwidth += $this->mpdf->table[($lvl - 1)][$parentnid]['wc'][$parentcol + $cs]; } } else { $parentwidth = $this->mpdf->table[($lvl - 1)][$parentnid]['wc'][$parentcol]; } //$parentwidth -= ALLOW FOR PADDING ETC.in parent cell if (!$this->mpdf->simpleTables) { if ($this->mpdf->packTableData) { list($bt, $br, $bb, $bl) = $this->mpdf->_getBorderWidths($c['borderbin']); } else { $br = $c['border_details']['R']['w']; $bl = $c['border_details']['L']['w']; } if ($this->mpdf->table[$lvl - 1][$parentnid]['borders_separate']) { $parentwidth -= $br + $bl + $c['padding']['L'] + $c['padding']['R'] + $this->mpdf->table[($lvl - 1)][$parentnid]['border_spacing_H']; } else { $parentwidth -= $br / 2 + $bl / 2 + $c['padding']['L'] + $c['padding']['R']; } } else if ($this->mpdf->simpleTables) { if ($this->mpdf->table[$lvl - 1][$parentnid]['borders_separate']) { $parentwidth -= $this->mpdf->table[($lvl - 1)][$parentnid]['simple']['border_details']['L']['w'] + $this->mpdf->table[($lvl - 1)][$parentnid]['simple']['border_details']['R']['w'] + $c['padding']['L'] + $c['padding']['R'] + $this->mpdf->table[($lvl - 1)][$parentnid]['border_spacing_H']; } else { $parentwidth -= $this->mpdf->table[($lvl - 1)][$parentnid]['simple']['border_details']['L']['w'] / 2 + $this->mpdf->table[($lvl - 1)][$parentnid]['simple']['border_details']['R']['w'] / 2 + $c['padding']['L'] + $c['padding']['R']; } } if (isset($this->mpdf->table[$lvl][$nid]['wpercent']) && $this->mpdf->table[$lvl][$nid]['wpercent'] && $lvl > 1) { $this->mpdf->table[$lvl][$nid]['w'] = $parentwidth; } else if ($parentwidth > $this->mpdf->table[$lvl][$nid]['maw']) { $this->mpdf->table[$lvl][$nid]['w'] = $this->mpdf->table[$lvl][$nid]['maw']; } else { $this->mpdf->table[$lvl][$nid]['w'] = $parentwidth; } unset($c); $this->mpdf->_tableWidth($this->mpdf->table[$lvl][$nid]); } } // Starting at $this->mpdf->innermostTableLevel // Cascade back up nested tables: setting heights back up the tree for ($lvl = $this->mpdf->innermostTableLevel; $lvl > 0; $lvl--) { for ($nid = 1; $nid <= $this->mpdf->tbctr[$lvl]; $nid++) { list($tableheight, $maxrowheight, $fullpage, $remainingpage, $maxfirstrowheight) = $this->mpdf->_tableHeight($this->mpdf->table[$lvl][$nid]); } } if ($this->mpdf->progressBar) { $this->mpdf->UpdateProgressBar(7, 20, ' '); } // *PROGRESS-BAR* if ($this->mpdf->table[1][1]['overflow'] == 'visible') { if ($maxrowheight > $fullpage) { throw new MpdfException("mPDF Warning: A Table row is greater than available height. You cannot use CSS overflow:visible"); } if ($maxfirstrowheight > $remainingpage) { $this->mpdf->AddPage($this->mpdf->CurOrientation); } $r = 0; $c = 0; $p = 0; $y = 0; $finished = false; while (!$finished) { list($finished, $r, $c, $p, $y, $y0) = $this->mpdf->_tableWrite($this->mpdf->table[1][1], true, $r, $c, $p, $y); if (!$finished) { $this->mpdf->AddPage($this->mpdf->CurOrientation); // If printed something on first spread, set same y if ($r == 0 && $y0 > -1) { $this->mpdf->y = $y0; } } } } else { $recalculate = 1; $forcerecalc = false; // RESIZING ALGORITHM if ($maxrowheight > $fullpage) { $recalculate = $this->mpdf->tbsqrt($maxrowheight / $fullpage, 1); $forcerecalc = true; } else if ($this->mpdf->table_rotate) { // NB $remainingpage == $fullpage == the width of the page if ($tableheight > $remainingpage) { // If can fit on remainder of page whilst respecting autsize value.. if (($this->mpdf->shrin_k * $this->mpdf->tbsqrt($tableheight / $remainingpage, 1)) <= $this->mpdf->shrink_this_table_to_fit) { $recalculate = $this->mpdf->tbsqrt($tableheight / $remainingpage, 1); } else if (!$added_page) { if ($this->mpdf->y != $this->mpdf->tMargin) { $this->mpdf->AddPage($this->mpdf->CurOrientation); $this->mpdf->kwt_moved = true; } $added_page = true; $this->mpdf->tbrot_maxw = $this->mpdf->h - ($this->mpdf->y + $this->mpdf->bMargin + 5) - $this->mpdf->kwt_height; // 0.001 to force it to recalculate $recalculate = (1 / $this->mpdf->shrin_k) + 0.001; // undo any shrink } } else { $recalculate = 1; } } else if ($this->mpdf->table_keep_together || ($this->mpdf->table[1][1]['nr'] == 1 && !$this->mpdf->writingHTMLfooter)) { if ($tableheight > $fullpage) { if (($this->mpdf->shrin_k * $this->mpdf->tbsqrt($tableheight / $fullpage, 1)) <= $this->mpdf->shrink_this_table_to_fit) { $recalculate = $this->mpdf->tbsqrt($tableheight / $fullpage, 1); } else if ($this->mpdf->tableMinSizePriority) { $this->mpdf->table_keep_together = false; $recalculate = 1.001; } else { if ($this->mpdf->y != $this->mpdf->tMargin) { $this->mpdf->AddPage($this->mpdf->CurOrientation); $this->mpdf->kwt_moved = true; } $added_page = true; $this->mpdf->tbrot_maxw = $this->mpdf->h - ($this->mpdf->y + $this->mpdf->bMargin + 5) - $this->mpdf->kwt_height; $recalculate = $this->mpdf->tbsqrt($tableheight / $fullpage, 1); } } else if ($tableheight > $remainingpage) { // If can fit on remainder of page whilst respecting autsize value.. if (($this->mpdf->shrin_k * $this->mpdf->tbsqrt($tableheight / $remainingpage, 1)) <= $this->mpdf->shrink_this_table_to_fit) { $recalculate = $this->mpdf->tbsqrt($tableheight / $remainingpage, 1); } else { if ($this->mpdf->y != $this->mpdf->tMargin) { // mPDF 6 if ($this->mpdf->AcceptPageBreak()) { $this->mpdf->AddPage($this->mpdf->CurOrientation); } else if ($this->mpdf->ColActive && $tableheight > (($this->mpdf->h - $this->mpdf->bMargin) - $this->mpdf->y0)) { $this->mpdf->AddPage($this->mpdf->CurOrientation); } $this->mpdf->kwt_moved = true; } $added_page = true; $this->mpdf->tbrot_maxw = $this->mpdf->h - ($this->mpdf->y + $this->mpdf->bMargin + 5) - $this->mpdf->kwt_height; $recalculate = 1.001; } } else { $recalculate = 1; } } else { $recalculate = 1; } if ($recalculate > $this->mpdf->shrink_this_table_to_fit && !$forcerecalc) { $recalculate = $this->mpdf->shrink_this_table_to_fit; } $iteration = 1; // RECALCULATE while ($recalculate <> 1) { $this->mpdf->shrin_k1 = $recalculate; $this->mpdf->shrin_k *= $recalculate; $this->mpdf->default_font_size /= ($this->mpdf->shrin_k1); $this->mpdf->SetFontSize($this->mpdf->default_font_size, false); $this->mpdf->SetLineHeight('', $this->mpdf->table[1][1]['cellLineHeight']); $this->mpdf->table = $save_table; if ($this->mpdf->shrin_k <> 1) { $this->mpdf->shrinkTable($this->mpdf->table[1][1], $this->mpdf->shrin_k); } $this->mpdf->_tableColumnWidth($this->mpdf->table[1][1], false); // repeat // Starting at $this->mpdf->innermostTableLevel // Shrink table values - and redo columnWidth for ($lvl = 2; $lvl <= $this->mpdf->innermostTableLevel; $lvl++) { for ($nid = 1; $nid <= $this->mpdf->tbctr[$lvl]; $nid++) { if ($this->mpdf->shrin_k <> 1) { $this->mpdf->shrinkTable($this->mpdf->table[$lvl][$nid], $this->mpdf->shrin_k); } $this->mpdf->_tableColumnWidth($this->mpdf->table[$lvl][$nid], false); } } // Set table cell widths for top level table // Top level table $this->mpdf->_tableWidth($this->mpdf->table[1][1]); // Now work through any nested tables setting child table[w'] = parent cell['w'] // Now do nested tables _tableWidth for ($lvl = 2; $lvl <= $this->mpdf->innermostTableLevel; $lvl++) { for ($nid = 1; $nid <= $this->mpdf->tbctr[$lvl]; $nid++) { // HERE set child table width = cell width list($parentrow, $parentcol, $parentnid) = $this->mpdf->table[$lvl][$nid]['nestedpos']; $c = & $this->mpdf->table[($lvl - 1)][$parentnid]['cells'][$parentrow][$parentcol]; if (isset($c['colspan']) && $c['colspan'] > 1) { $parentwidth = 0; for ($cs = 0; $cs < $c['colspan']; $cs++) { $parentwidth += $this->mpdf->table[($lvl - 1)][$parentnid]['wc'][$parentcol + $cs]; } } else { $parentwidth = $this->mpdf->table[($lvl - 1)][$parentnid]['wc'][$parentcol]; } //$parentwidth -= ALLOW FOR PADDING ETC.in parent cell if (!$this->mpdf->simpleTables) { if ($this->mpdf->packTableData) { list($bt, $br, $bb, $bl) = $this->mpdf->_getBorderWidths($c['borderbin']); } else { $br = $c['border_details']['R']['w']; $bl = $c['border_details']['L']['w']; } if ($this->mpdf->table[$lvl - 1][$parentnid]['borders_separate']) { $parentwidth -= $br + $bl + $c['padding']['L'] + $c['padding']['R'] + $this->mpdf->table[($lvl - 1)][$parentnid]['border_spacing_H']; } else { $parentwidth -= $br / 2 + $bl / 2 + $c['padding']['L'] + $c['padding']['R']; } } else if ($this->mpdf->simpleTables) { if ($this->mpdf->table[$lvl - 1][$parentnid]['borders_separate']) { $parentwidth -= $this->mpdf->table[($lvl - 1)][$parentnid]['simple']['border_details']['L']['w'] + $this->mpdf->table[($lvl - 1)][$parentnid]['simple']['border_details']['R']['w'] + $c['padding']['L'] + $c['padding']['R'] + $this->mpdf->table[($lvl - 1)][$parentnid]['border_spacing_H']; } else { $parentwidth -= ($this->mpdf->table[($lvl - 1)][$parentnid]['simple']['border_details']['L']['w'] + $this->mpdf->table[($lvl - 1)][$parentnid]['simple']['border_details']['R']['w']) / 2 + $c['padding']['L'] + $c['padding']['R']; } } if (isset($this->mpdf->table[$lvl][$nid]['wpercent']) && $this->mpdf->table[$lvl][$nid]['wpercent'] && $lvl > 1) { $this->mpdf->table[$lvl][$nid]['w'] = $parentwidth; } else if ($parentwidth > $this->mpdf->table[$lvl][$nid]['maw']) { $this->mpdf->table[$lvl][$nid]['w'] = $this->mpdf->table[$lvl][$nid]['maw']; } else { $this->mpdf->table[$lvl][$nid]['w'] = $parentwidth; } unset($c); $this->mpdf->_tableWidth($this->mpdf->table[$lvl][$nid]); } } // Starting at $this->mpdf->innermostTableLevel // Cascade back up nested tables: setting heights back up the tree for ($lvl = $this->mpdf->innermostTableLevel; $lvl > 0; $lvl--) { for ($nid = 1; $nid <= $this->mpdf->tbctr[$lvl]; $nid++) { list($tableheight, $maxrowheight, $fullpage, $remainingpage, $maxfirstrowheight) = $this->mpdf->_tableHeight($this->mpdf->table[$lvl][$nid]); } } // RESIZING ALGORITHM if ($maxrowheight > $fullpage) { $recalculate = $this->mpdf->tbsqrt($maxrowheight / $fullpage, $iteration); $iteration++; } else if ($this->mpdf->table_rotate && $tableheight > $remainingpage && !$added_page) { // If can fit on remainder of page whilst respecting autosize value.. if (($this->mpdf->shrin_k * $this->mpdf->tbsqrt($tableheight / $remainingpage, $iteration)) <= $this->mpdf->shrink_this_table_to_fit) { $recalculate = $this->mpdf->tbsqrt($tableheight / $remainingpage, $iteration); $iteration++; } else { if (!$added_page) { $this->mpdf->AddPage($this->mpdf->CurOrientation); $added_page = true; $this->mpdf->kwt_moved = true; $this->mpdf->tbrot_maxw = $this->mpdf->h - ($this->mpdf->y + $this->mpdf->bMargin + 5) - $this->mpdf->kwt_height; } // 0.001 to force it to recalculate $recalculate = (1 / $this->mpdf->shrin_k) + 0.001; // undo any shrink } } else if ($this->mpdf->table_keep_together || ($this->mpdf->table[1][1]['nr'] == 1 && !$this->mpdf->writingHTMLfooter)) { if ($tableheight > $fullpage) { if (($this->mpdf->shrin_k * $this->mpdf->tbsqrt($tableheight / $fullpage, $iteration)) <= $this->mpdf->shrink_this_table_to_fit) { $recalculate = $this->mpdf->tbsqrt($tableheight / $fullpage, $iteration); $iteration++; } else if ($this->mpdf->tableMinSizePriority) { $this->mpdf->table_keep_together = false; $recalculate = (1 / $this->mpdf->shrin_k) + 0.001; } else { if (!$added_page && $this->mpdf->y != $this->mpdf->tMargin) { $this->mpdf->AddPage($this->mpdf->CurOrientation); $added_page = true; $this->mpdf->kwt_moved = true; $this->mpdf->tbrot_maxw = $this->mpdf->h - ($this->mpdf->y + $this->mpdf->bMargin + 5) - $this->mpdf->kwt_height; } $recalculate = $this->mpdf->tbsqrt($tableheight / $fullpage, $iteration); $iteration++; } } else if ($tableheight > $remainingpage) { // If can fit on remainder of page whilst respecting autosize value.. if (($this->mpdf->shrin_k * $this->mpdf->tbsqrt($tableheight / $remainingpage, $iteration)) <= $this->mpdf->shrink_this_table_to_fit) { $recalculate = $this->mpdf->tbsqrt($tableheight / $remainingpage, $iteration); $iteration++; } else { if (!$added_page) { // mPDF 6 if ($this->mpdf->AcceptPageBreak()) { $this->mpdf->AddPage($this->mpdf->CurOrientation); } else if ($this->mpdf->ColActive && $tableheight > (($this->mpdf->h - $this->mpdf->bMargin) - $this->mpdf->y0)) { $this->mpdf->AddPage($this->mpdf->CurOrientation); } $added_page = true; $this->mpdf->kwt_moved = true; $this->mpdf->tbrot_maxw = $this->mpdf->h - ($this->mpdf->y + $this->mpdf->bMargin + 5) - $this->mpdf->kwt_height; } //$recalculate = $this->mpdf->tbsqrt($tableheight / $fullpage, $iteration); $iteration++; $recalculate = (1 / $this->mpdf->shrin_k) + 0.001; // undo any shrink } } else { $recalculate = 1; } } else { $recalculate = 1; } } if ($maxfirstrowheight > $remainingpage && !$added_page && !$this->mpdf->table_rotate && !$this->mpdf->ColActive && !$this->mpdf->table_keep_together && !$this->mpdf->writingHTMLheader && !$this->mpdf->writingHTMLfooter) { $this->mpdf->AddPage($this->mpdf->CurOrientation); $this->mpdf->kwt_moved = true; } // keep-with-table: if page has advanced, print out buffer now, else done in fn. _Tablewrite() if ($this->mpdf->kwt_saved && $this->mpdf->kwt_moved) { $this->mpdf->printkwtbuffer(); $this->mpdf->kwt_moved = false; $this->mpdf->kwt_saved = false; } if ($this->mpdf->progressBar) { $this->mpdf->UpdateProgressBar(7, 30, ' '); } // *PROGRESS-BAR* // Recursively writes all tables starting at top level $this->mpdf->_tableWrite($this->mpdf->table[1][1]); if ($this->mpdf->table_rotate && $this->mpdf->tablebuffer) { $this->mpdf->PageBreakTrigger = $this->mpdf->h - $this->mpdf->bMargin; $save_tr = $this->mpdf->table_rotate; $save_y = $this->mpdf->y; $this->mpdf->table_rotate = 0; $this->mpdf->y = $this->mpdf->tbrot_y0; $h = $this->mpdf->tbrot_w; $this->mpdf->DivLn($h, $this->mpdf->blklvl, true); $this->mpdf->table_rotate = $save_tr; $this->mpdf->y = $save_y; $this->mpdf->printtablebuffer(); } $this->mpdf->table_rotate = 0; } $this->mpdf->x = $this->mpdf->lMargin + $this->mpdf->blk[$this->mpdf->blklvl]['outer_left_margin']; $this->mpdf->maxPosR = max($this->mpdf->maxPosR, ($this->mpdf->x + $this->mpdf->table[1][1]['w'])); $this->mpdf->blockjustfinished = true; $this->mpdf->lastblockbottommargin = $this->mpdf->table[1][1]['margin']['B']; //Reset values if (isset($this->mpdf->table[1][1]['page_break_after'])) { $page_break_after = $this->mpdf->table[1][1]['page_break_after']; } else { $page_break_after = ''; } // Keep-with-table $this->mpdf->kwt = false; $this->mpdf->kwt_y0 = 0; $this->mpdf->kwt_x0 = 0; $this->mpdf->kwt_height = 0; $this->mpdf->kwt_buffer = array(); $this->mpdf->kwt_Links = array(); $this->mpdf->kwt_Annots = array(); $this->mpdf->kwt_moved = false; $this->mpdf->kwt_saved = false; $this->mpdf->kwt_Reference = array(); $this->mpdf->kwt_BMoutlines = array(); $this->mpdf->kwt_toc = array(); $this->mpdf->shrin_k = 1; $this->mpdf->shrink_this_table_to_fit = 0; unset($this->mpdf->table); $this->mpdf->table = array(); //array $this->mpdf->tableLevel = 0; $this->mpdf->tbctr = array(); $this->mpdf->innermostTableLevel = 0; $this->mpdf->cssmgr->tbCSSlvl = 0; $this->mpdf->cssmgr->tablecascadeCSS = array(); unset($this->mpdf->cell); $this->mpdf->cell = array(); //array $this->mpdf->col = -1; //int $this->mpdf->row = -1; //int $this->mpdf->Reset(); $this->mpdf->cellPaddingL = 0; $this->mpdf->cellPaddingT = 0; $this->mpdf->cellPaddingR = 0; $this->mpdf->cellPaddingB = 0; $this->mpdf->cMarginL = 0; $this->mpdf->cMarginT = 0; $this->mpdf->cMarginR = 0; $this->mpdf->cMarginB = 0; $this->mpdf->default_font_size = $this->mpdf->original_default_font_size; $this->mpdf->default_font = $this->mpdf->original_default_font; $this->mpdf->SetFontSize($this->mpdf->default_font_size, false); $this->mpdf->SetFont($this->mpdf->default_font, '', 0, false); $this->mpdf->SetLineHeight(); if (isset($this->mpdf->blk[$this->mpdf->blklvl]['InlineProperties'])) { $this->mpdf->restoreInlineProperties($this->mpdf->blk[$this->mpdf->blklvl]['InlineProperties']); } if ($this->mpdf->progressBar) { $this->mpdf->UpdateProgressBar(7, 100, ' '); } // *PROGRESS-BAR* if ($page_break_after) { $save_blklvl = $this->mpdf->blklvl; $save_blk = $this->mpdf->blk; $save_silp = $this->mpdf->saveInlineProperties(); $save_ilp = $this->mpdf->InlineProperties; $save_bflp = $this->mpdf->InlineBDF; $save_bflpc = $this->mpdf->InlineBDFctr; // mPDF 6 // mPDF 6 pagebreaktype $startpage = $this->mpdf->page; $pagebreaktype = $this->mpdf->defaultPagebreakType; if ($this->mpdf->ColActive) { $pagebreaktype = 'cloneall'; } // mPDF 6 pagebreaktype $this->mpdf->_preForcedPagebreak($pagebreaktype); if ($page_break_after == 'RIGHT') { $this->mpdf->AddPage($this->mpdf->CurOrientation, 'NEXT-ODD', '', '', '', '', '', '', '', '', '', '', '', '', '', 0, 0, 0, 0); } else if ($page_break_after == 'LEFT') { $this->mpdf->AddPage($this->mpdf->CurOrientation, 'NEXT-EVEN', '', '', '', '', '', '', '', '', '', '', '', '', '', 0, 0, 0, 0); } else { $this->mpdf->AddPage($this->mpdf->CurOrientation, '', '', '', '', '', '', '', '', '', '', '', '', '', '', 0, 0, 0, 0); } // mPDF 6 pagebreaktype $this->mpdf->_postForcedPagebreak($pagebreaktype, $startpage, $save_blk, $save_blklvl); $this->mpdf->InlineProperties = $save_ilp; $this->mpdf->InlineBDF = $save_bflp; $this->mpdf->InlineBDFctr = $save_bflpc; // mPDF 6 $this->mpdf->restoreInlineProperties($save_silp); } } /* -- END TABLES -- */ } }
gpl-2.0
kimkha/snorg
mod/tidypics/views/default/river/object/image/tag.php
474
<?php $image = get_entity($vars['item']->subject_guid); $person_tagged = get_entity($vars['item']->object_guid); if($image->title) { $title = $image->title; } else { $title = "untitled"; } $image_url = "<a href=\"{$image->getURL()}\">{$title}</a>"; $person_url = "<a href=\"{$person_tagged->getURL()}\">{$person_tagged->name}</a>"; $string = $person_url . ' ' . elgg_echo('image:river:tagged') . ' ' . $image_url; echo $string; ?>
gpl-2.0
malinink/LaravelTestWeb15
app/Whale.php
525
<?php namespace App; use Illuminate\Database\Eloquent\Model; class Whale extends Model { protected $table = 'whales'; protected $fillable = array( 'identity', 'firstname', 'lastname', 'sex', 'fruit', 'hobby' ); public $timestamps = false; public function foods() { return $this->belongsToMany('App\Food'); } public function getFoodListAttribute() { return $this->foods->lists('id')->all(); } }
gpl-2.0
xposure/zSprite_Old
Source/Framework/zSprite.Framework/V1/Core/IPlugin.cs
6821
#region LGPL License /* Axiom Graphics Engine Library Copyright © 2003-2011 Axiom Project Team The overall design, and a majority of the core engine and rendering code contained within this library is a derivative of the open source Object Oriented Graphics Engine OGRE, which can be found at http://ogre.sourceforge.net. Many thanks to the OGRE team for maintaining such a high quality project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #endregion LGPL License #region SVN Version Information // <file> // <license see="http://axiom3d.net/wiki/index.php/license.txt"/> // <id value="$Id$"/> // </file> #endregion SVN Version Information #region Namespace Declarations using System; #endregion Namespace Declarations namespace zSpriteOld.Core { /// <summary> /// Any class that wants to entend the functionality of the engine can implement this /// interface. Classes implementing this interface will automatically be loaded and /// started by the engine during the initialization phase. Examples of plugins would be /// RenderSystems, SceneManagers, etc, which can register themself using the /// singleton instance of the Engine class. /// </summary> /// <remarks> /// Axiom is very plugin-oriented and you can customize much of its behaviour /// by registering new plugins, dynamically if you are using dynamic linking. /// This class abstracts the generic interface that all plugins must support. /// Within the implementations of this interface, the plugin must call other /// Axiom classes in order to register the detailed customizations it is /// providing, e.g. registering a new SceneManagerFactory, a new /// MovableObjectFactory, or a new RenderSystem. /// <para /> /// Plugins can be linked statically or dynamically. If they are linked /// dynamically (ie the plugin is in a DLL ), then you load the plugin by /// calling the Root.LoadPlugin method (or some other mechanism which leads /// to that call, e.g. app.config), passing the name of the DLL. Axiom /// will then call a global init function on that DLL, and it will be /// expected to register one or more Plugin implementations using /// Root.InstallPlugin. The procedure is very similar if you use a static /// linked plugin, except that you simply instantiate the Plugin implementation /// yourself and pass it to Root.InstallPlugin. /// </remarks> /// <note> /// Lifecycle of a Plugin instance is very important. The Plugin instance must /// remain valid until the Plugin is uninstalled. Here are the things you /// must bear in mind: /// <ul><li>Create the Plugin anytime you like</li> /// <li>Call Root.InstallPlugin any time whilst Root is valid</li> /// <li>Call Root.UninstallPlugin if you like so long as Root is valid. However, /// it will be done for you when Root is destroyed, so the Plugin instance must /// still be valid at that point if you haven't manually uninstalled it.</li></ul> /// The install and uninstall methods will be called when the plugin is /// installed or uninstalled. The initialize and shutdown will be called when /// there is a system initialization or shutdown, e.g. when Root.Initialize /// or Root.Shutdown are called. /// </note> public interface IPlugin { // <summary> // Unique name for the plugin // </summary> //string Name //{ // get; //} // <summary> // Perform the plugin initial installation sequence. // </summary> // <remarks> // An implementation must be supplied for this method. It must perform // the startup tasks necessary to install any rendersystem customizations // or anything else that is not dependent on system initialization, ie // only dependent on the core of Axiom. It must not perform any // operations that would create rendersystem-specific objects at this stage, // that should be done in Initialize(). // </remarks> //void Install(); /// <summary> /// Perform any tasks the plugin needs to perform on full system initialization. /// </summary> /// <remarks> /// An implementation must be supplied for this method. It is called /// just after the system is fully initialized (either after Root.Initialize /// if a window is created then, or after the first window is created) /// and therefore all rendersystem functionality is available at this /// time. You can use this hook to create any resources which are /// dependent on a rendersystem or have rendersystem-specific implementations. /// </remarks> void Initialize(); /// <summary> /// Perform any tasks the plugin needs to perform when the system is shut down. /// </summary> /// <remarks> /// An implementation must be supplied for this method. /// This method is called just before key parts of the system are unloaded, /// such as rendersystems being shut down. You should use this hook to free up /// resources and decouple custom objects from the Axiom system, whilst all the /// instances of other plugins (e.g. rendersystems) still exist. /// </remarks> void Shutdown(); // <summary> // Perform the final plugin uninstallation sequence. // </summary> // <remarks> // An implementation must be supplied for this method. It must perform // the cleanup tasks which haven't already been performed in Shutdown() // (e.g. final deletion of custom instances, if you kept them around incase // the system was reinitialized). At this stage you cannot be sure what other // plugins are still loaded or active. It must therefore not perform any // operations that would reference any rendersystem-specific objects - those // should have been sorted out in the Shutdown method. // </remarks> //void Uninstall(); } }
gpl-3.0
LEPTON-project/LEPTON_1
upload/admins/settings/ajax_testmail.php
2813
<?php /** * This file is part of LEPTON Core, released under the GNU GPL * Please see LICENSE and COPYING files in your package for details, specially for terms and warranties. * * NOTICE:LEPTON CMS Package has several different licenses. * Please see the individual license in the header of each single file or info.php of modules and templates. * * @author LEPTON Project * @copyright 2010-2014 LEPTON Project * @link http://www.LEPTON-cms.org * @license http://www.gnu.org/licenses/gpl.html * @license_terms please see LICENSE and COPYING files in your package * @version $Id: ajax_testmail.php 1238 2011-10-21 12:12:40Z frankh $ * */ ob_start(); // include class.secure.php to protect this file and the whole CMS! if (defined('WB_PATH')) { include(WB_PATH.'/framework/class.secure.php'); } else { $root = "../"; $level = 1; while (($level < 10) && (!file_exists($root.'/framework/class.secure.php'))) { $root .= "../"; $level += 1; } if (file_exists($root.'/framework/class.secure.php')) { include($root.'/framework/class.secure.php'); } else { trigger_error(sprintf("[ <b>%s</b> ] Can't include class.secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR); } } // end include class.secure.php global $TEXT; header( "Cache-Control: no-cache, must-revalidate" ); header( "Pragma: no-cache" ); header( "Content-Type: text/html; charset:utf-8;" ); // not needed, config is loaded with class.secure // include realpath(dirname(__FILE__)).'/../../config.php'; include realpath(dirname(__FILE__)).'/../../framework/class.admin.php'; $admin = new admin('Settings', 'settings_basic'); $curr_user_is_admin = ( in_array(1, $admin->get_groups_id()) ); if ( ! $curr_user_is_admin ) { echo "<div style='border: 2px solid #CC0000; padding: 5px; text-align: center; background-color: #ffbaba;'>You're not allowed to use this function!</div>"; exit; } $settings = array(); $sql = 'SELECT `name`, `value` FROM `'.TABLE_PREFIX.'settings`'; if ( $res_settings = $database->query( $sql ) ) { while ($row = $res_settings->fetchRow( )) { $settings[ strtoupper($row['name']) ] = ( $row['name'] != 'wbmailer_smtp_password' ) ? htmlspecialchars($row['value']) : $row['value']; } } ob_clean(); // send mail if( $admin->mail( $settings['SERVER_EMAIL'], $settings['SERVER_EMAIL'], 'LEPTON PHP MAILER', $TEXT['WBMAILER_TESTMAIL_TEXT'] ) ) { echo "<div style='border: 2px solid #006600; padding: 5px; text-align: center; background-color: #dff2bf;'>", $TEXT['WBMAILER_TESTMAIL_SUCCESS'], "</div>"; } else { $message = ob_get_clean(); echo "<div style='border: 2px solid #CC0000; padding: 5px; text-align: center; background-color: #ffbaba;'>", $TEXT['WBMAILER_TESTMAIL_FAILED'], "<br />$message<br /></div>"; } ?>
gpl-3.0
wangyufu/Python-practice
binary_search/binary_search.py
737
#!/usr/bin/env python data = range(1, 1000000) def binary_search(find_str, data_set): mid = int(len(data_set)/2) if mid == 0: if data_set[mid] == find_str: print("find it", find_str) else: print("cannot find this num in list", find_str) return if data_set[mid] == find_str: print('find it', find_str) elif data_set[mid] > find_str: print('going to search in left', data_set[mid], data_set[0:mid]) binary_search(find_str, data_set[0:mid]) else: print('going to search in right', data_set[mid], data_set[mid+1:]) binary_search(find_str, data_set[mid+1:]) num = int(input('Input to find the number: ')) binary_search(num, data)
gpl-3.0
h3llrais3r/SickRage
sickchill/oldbeard/notifiers/synoindex.py
2383
import os import subprocess from sickchill import logger, settings class Notifier(object): def notify_snatch(self, ep_name): pass def notify_download(self, ep_name): pass def notify_subtitle_download(self, ep_name, lang): pass def notify_git_update(self, new_version): pass def notify_login(self, ipaddress=""): pass def moveFolder(self, old_path, new_path): self.moveObject(old_path, new_path) def moveFile(self, old_file, new_file): self.moveObject(old_file, new_file) @staticmethod def moveObject(old_path, new_path): if settings.USE_SYNOINDEX: synoindex_cmd = ["/usr/syno/bin/synoindex", "-N", os.path.abspath(new_path), os.path.abspath(old_path)] logger.debug("Executing command " + str(synoindex_cmd)) logger.debug("Absolute path to command: " + os.path.abspath(synoindex_cmd[0])) try: p = subprocess.Popen(synoindex_cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=settings.DATA_DIR, universal_newlines=True) out, err = p.communicate() logger.debug(_("Script result: {0}").format(str(out or err).strip())) except OSError as e: logger.exception("Unable to run synoindex: " + str(e)) def deleteFolder(self, cur_path): self.makeObject("-D", cur_path) def addFolder(self, cur_path): self.makeObject("-A", cur_path) def deleteFile(self, cur_file): self.makeObject("-d", cur_file) def addFile(self, cur_file): self.makeObject("-a", cur_file) @staticmethod def makeObject(cmd_arg, cur_path): if settings.USE_SYNOINDEX: synoindex_cmd = ["/usr/syno/bin/synoindex", cmd_arg, os.path.abspath(cur_path)] logger.debug("Executing command " + str(synoindex_cmd)) logger.debug("Absolute path to command: " + os.path.abspath(synoindex_cmd[0])) try: p = subprocess.Popen(synoindex_cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=settings.DATA_DIR, universal_newlines=True) out, err = p.communicate() logger.debug(_("Script result: {0}").format(str(out or err).strip())) except OSError as e: logger.exception("Unable to run synoindex: " + str(e))
gpl-3.0
crisis-economics/CRISIS
CRISIS/src/eu/crisis_economics/abm/bank/MarketMaker.java
1558
/* * This file is part of CRISIS, an economics simulator. * * Copyright (C) 2015 AITIA International, Inc. * Copyright (C) 2015 Ross Richardson * Copyright (C) 2015 Olaf Bochmann * Copyright (C) 2015 John Kieran Phillips * Copyright (C) 2015 Fabio Caccioli * Copyright (C) 2015 Christoph Aymanns * * CRISIS is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * CRISIS is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with CRISIS. If not, see <http://www.gnu.org/licenses/>. */ package eu.crisis_economics.abm.bank; import eu.crisis_economics.abm.bank.strategies.BankStrategy; import eu.crisis_economics.abm.bank.strategies.MarketMakerStrategy; import eu.crisis_economics.abm.simulation.injection.factories.BankStrategyFactory; public final class MarketMaker extends StrategyBank { public MarketMaker( final double initialCash ) { super( initialCash, new BankStrategyFactory() { @Override public BankStrategy create(StrategyBank bank) { return new MarketMakerStrategy(bank); } } ); } }
gpl-3.0
mdmower/atahualpa
functions/bfa_ata_add_admin.php
1994
<?php function bfa_ata_add_admin() { global $options, $bfa_ata; if ( isset($_GET['page'])) { if ( $_GET['page'] == "atahualpa-options" ) { if ( isset($_REQUEST['action']) ) { if ( 'save' == $_REQUEST['action'] ) { foreach ($options as $value) { if ( $value['category'] == $_REQUEST['category'] ) { if ( isset($value['escape']) ) { if( isset( $_REQUEST[ $value['id'] ] ) ) // Since 3.6.8 removed bfa_escape //$bfa_ata[ $value['id'] ] = stripslashes(bfa_escape($_REQUEST[ $value['id'] ] )); $bfa_ata[ $value['id'] ] = stripslashes($_REQUEST[ $value['id'] ]); else unset ($bfa_ata[ $value['id'] ]); } elseif ( isset($value['stripslashes']) ) { if ($value['stripslashes'] == "no") { if( isset( $_REQUEST[ $value['id'] ] ) ) $bfa_ata[ $value['id'] ] = $_REQUEST[ $value['id'] ] ; else unset ($bfa_ata[ $value['id'] ]); } } else { if( isset( $_REQUEST[ $value['id'] ] ) ) $bfa_ata[ $value['id'] ] = stripslashes($_REQUEST[ $value['id'] ] ); else unset ($bfa_ata[ $value['id'] ]); } } } update_option('bfa_ata4', $bfa_ata); header("Location: themes.php?page=atahualpa-options&saved=true"); die; } else if( 'reset' == $_REQUEST['action'] ) { if ("reset-all" == $_REQUEST['category']) { delete_option('bfa_ata4'); } else { foreach ($options as $value) { if ( $value['category'] == $_REQUEST['category'] ) $bfa_ata[ $value['id'] ] = $value['std']; } update_option('bfa_ata4', $bfa_ata); } header("Location: themes.php?page=atahualpa-options&reset=true"); die; } } } } $atapage = add_theme_page("Atahualpa Options", "Atahualpa Theme Options", 'edit_theme_options', 'atahualpa-options', 'bfa_ata_admin'); // Since 3.6.8: add_action( "admin_print_styles-$atapage", 'bfa_ata_admin_enqueue' ); } ?>
gpl-3.0
asleao/sistema-cotacao
project/project/wsgi.py
483
""" WSGI config for project project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application from whitenoise.django import DjangoWhiteNoise os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings") application = get_wsgi_application() application = DjangoWhiteNoise(application)
gpl-3.0
BodhiM/EnderAuth
src/main/java/net/bemacized/enderauth/auth/GoogleAuthenticatorKeyModel.java
1519
package net.bemacized.enderauth.auth; import com.warrenstrange.googleauth.GoogleAuthenticatorKey; import net.bemacized.enderauth.EnderAuth; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.List; public class GoogleAuthenticatorKeyModel { private String key; private int verificationCode; private List<Integer> scratchCodes; private List<Integer> usedCodes; //For Jongo public GoogleAuthenticatorKeyModel() { } public GoogleAuthenticatorKeyModel(GoogleAuthenticatorKey key) { this.key = key.getKey(); this.verificationCode = key.getVerificationCode(); this.scratchCodes = key.getScratchCodes(); usedCodes = new ArrayList<>(); } public List<Integer> getUsedCodes() { return new ArrayList<>(usedCodes); } public GoogleAuthenticatorKey getKey() { try { Constructor<GoogleAuthenticatorKey> constructor = GoogleAuthenticatorKey.class.getDeclaredConstructor(String.class, int.class, List.class); constructor.setAccessible(true); return constructor.newInstance(key, verificationCode, scratchCodes); } catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) { if (EnderAuth.DEBUG_MODE) e.printStackTrace(); } return null; } public void consumeScratchCode(int code) { usedCodes.add(code); } }
gpl-3.0
TerminalShell/zombiesurvival
entities/entities/status_packup/init.lua
1424
AddCSLuaFile("cl_init.lua") AddCSLuaFile("shared.lua") include("shared.lua") function ENT:PlayerSet(pPlayer, bExists) pPlayer:EmitSound("items/ammocrate_open.wav") pPlayer.PackUp = pPlayer if self:GetStartTime() == 0 then self:SetStartTime(CurTime()) end end function ENT:Think() if self.Removing then return end local packer = self:GetOwner() local owner = packer local pack = self:GetPackUpEntity() if pack:IsValid() and owner:TraceLine(64, MASK_SOLID, owner:GetMeleeFilter()).Entity == pack then if CurTime() >= self:GetEndTime() then if self:GetNotOwner() then local count = 0 for _, ent in pairs(ents.FindByClass("status_packup")) do if ent:GetPackUpEntity() == pack then count = count + 1 end end if count < self.PackUpOverride then self:NextThink(CurTime()) return true end if pack.GetObjectOwner then local objowner = pack:GetObjectOwner() if objowner:IsValid() and objowner:Team() == TEAM_HUMAN and objowner:IsValid() then owner = objowner end end end if pack.OnPackedUp and not pack:OnPackedUp(owner) then owner:EmitSound("items/ammocrate_close.wav") self.Removing = true gamemode.Call("ObjectPackedUp", pack, packer, owner) self:Remove() end end else owner:EmitSound("items/medshotno1.wav") self:Remove() self.Removing = true end self:NextThink(CurTime()) return true end
gpl-3.0
Yafuncl/winwin
app/Organizacion.php
111
<?php namespace WinWin; use Illuminate\Database\Eloquent\Model; class Organizacion extends Model { // }
gpl-3.0
ozzloy/oble
oble.cpp
6746
//use the camera to aid the decision to sleep. //Copyright 2009 Daniel Watson /* This file is part of oble. oble is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. oble is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with oble. If not, see <http://www.gnu.org/licenses/>. */ #include <cv.h> #include <highgui.h> #include <stdio.h> #include <iostream> #include <time.h> #include <unistd.h> #include "oble.h" #include "idle_x11.h" using namespace std; static string cascade_filename = ""; static int verbose = 0; // argument for cvFlip(src, dest, FLIP_TYPE) #define MIRROR 1 CvHaarClassifierCascade* load_object_detector(const char* cascade_path) { return (CvHaarClassifierCascade*)cvLoad(cascade_path); } void detect_and_draw_objects(IplImage* image, CvHaarClassifierCascade* cascade, int do_pyramids) { IplImage* small_image = image; CvMemStorage* storage = cvCreateMemStorage(0); CvSeq* faces; int i, scale = 1; /* if the flag is specified, down-scale the input image to get a performance boost w/o loosing quality (perhaps) */ if(do_pyramids) { small_image = cvCreateImage(cvSize(image->width/2, image->height/2), IPL_DEPTH_8U, 3); cvPyrDown(image, small_image, CV_GAUSSIAN_5x5); scale = 2; } /* use the fastest variant */ faces = cvHaarDetectObjects(small_image, cascade, storage, 1.2, 2, CV_HAAR_DO_CANNY_PRUNING); update_idle(faces->total); /* draw all the rectangles */ for(i = 0; i < faces->total; i++) { /* extract the rectangles only */ CvRect face = *(CvRect*)cvGetSeqElem(faces, i); CvPoint upperLeft = cvPoint(face.x * scale, face.y * scale); CvPoint bottomRight = cvPoint((face.x + face.width) * scale, (face.y + face.height) * scale); cvRectangle(image, upperLeft, bottomRight, CV_RGB(255,0,0), 3); } if(small_image != image) cvReleaseImage(&small_image); cvReleaseMemStorage(&storage); } void update_idle(int faces_total) { static int saw_last_time = 0; if(0 < faces_total) { t_current = time(NULL); if(verbose) { printf(":) face \n"); } if(saw_last_time) { if(verbose)printf("\t\tpoking\n"); reset_idle_time(); } saw_last_time = 1; } else { saw_last_time = 0; if(verbose) { printf(":( no face \n"); } } } void screensave(time_t t_current) { static int last_elapse = 0; static int activated = 0; int elapse = difftime(time(NULL), t_current); int timeout = 10; if(elapse > timeout && elapse != last_elapse) { last_elapse = elapse; if(verbose) { printf("elapse = %d\n", elapse); } if(!activated) { printf("activated\n"); activated = 1; system("gnome-screensaver-command -a"); } } if(elapse < timeout && activated) { printf("deactivated\n"); activated = 0; system("gnome-screensaver-command -d"); } } int parse_opts(int argc, char **argv) { int index, c; opterr = 0; const char *options = "vc:\x0"; while((c = getopt(argc, argv, options)) != -1) { switch(c) { case 'v': verbose = 1; break; case 'c': cascade_filename = string(optarg); break; case '?': if(optopt == 'c') { printf("option -%c requires an argument.\n", optopt); } else if(isprint (optopt)) { printf("unknown option `-%c'.\n", optopt); } else { printf("unknown option char `\\x%x'.\n", optopt); } break; case '\x0': break; //ignore. not sure why this shows up. maybe zsh? default: abort(); } } for(index = optind; index < argc; index++) printf("Non-option arg %s\n", argv[index]); if(cascade_filename == "") { printf("you must supply a filename with -c option. example:\n"); printf( "%s -c %s\n", argv[0], "/usr/share/opencv/haarcascades/haarcascade_frontalface_alt.xml" ); return 1; } if(verbose) printf("SILENT ALARM ACTIVATED!!!\n"); return 0; } int get_frames(CvCapture* capture, CvHaarClassifierCascade* cascade) { int got_null_frame = 0; IplImage* frame = NULL; get_one_frame(capture, frame); IplImage* mirrored = cvCreateImage(cvGetSize(frame), frame->depth, frame->nChannels); // Show the image captured from the camera in the window and repeat while(!(got_null_frame = get_one_frame(capture, frame))) { //so displayed right/left corresponds to physical right/left: cvFlip(frame, mirrored, MIRROR); detect_and_draw_objects(mirrored, cascade, 1); cvShowImage("mywindow", mirrored); // Do not release the frame! //screensave(t_current); //If ESC key pressed, Key=0x10001B under OpenCV 0.9.7(linux version), //remove higher bits using AND operator if((cvWaitKey(100) & 255) == 27) break; } cvReleaseImage(&mirrored); return got_null_frame; } int do_capture() { int got_null_capture = 0; CvHaarClassifierCascade* cascade = load_object_detector(cascade_filename.c_str()); CvCapture* capture = cvCaptureFromCAM(CV_CAP_ANY); if(!capture) { cerr << "ERROR: capture is NULL " << endl; return 1; } // Create a window in which the captured images will be presented cvNamedWindow("mywindow", CV_WINDOW_AUTOSIZE); t_current = time(NULL); while(get_frames(capture, cascade)) { cerr << "resetting capture." << endl; cvReleaseCapture( &capture ); capture = cvCaptureFromCAM( CV_CAP_ANY ); if(!capture) { got_null_capture = 1; break; } } // Release the capture device housekeeping if(!got_null_capture) { cvReleaseCapture(&capture); } cvDestroyWindow("mywindow"); return got_null_capture; } int get_one_frame(CvCapture* capture, IplImage* &frame) { int got_null_frame = 0; frame = cvQueryFrame(capture); if(!frame) { cerr << "ERROR: frame is null..., trying again" << endl; frame = cvQueryFrame(capture); if(!frame) { cerr << "ERROR: frame is still null... maybe reset capture?" << endl; got_null_frame = 1; } } return got_null_frame; } // A Simple Camera Capture Framework. int main(int argc, char** argv) { if(parse_opts(argc, argv)) return 0; return do_capture(); }
gpl-3.0
UmModderQualquer/GabrielBot
src/main/java/gabrielbot/utils/PrologBuilder.java
945
package gabrielbot.utils; public class PrologBuilder { private final StringBuilder sb; public PrologBuilder() { sb = new StringBuilder(128); } public PrologBuilder(PrologBuilder other) { sb = new StringBuilder(other.sb.length() + 128); sb.append(other.sb.toString()); } public PrologBuilder addField(String name, String value) { sb.append(name).append(": ").append(value).append('\n'); return this; } public PrologBuilder addField(String name, Object value) { return addField(name, value == null ? "null" : value.toString()); } public PrologBuilder addLabel(String name) { sb.append("-- ").append(name).append(" --").append('\n'); return this; } public PrologBuilder addEmptyLine() { sb.append('\n'); return this; } public String build() { return "```prolog\n" + sb.toString() + "```"; } }
gpl-3.0
poes-weather/Sensor-Benchmark
gauge/gauge.cpp
12151
/* POES-Weather Ltd Sensor Benchmark, a software for testing different sensors used to align antennas. Copyright (C) 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Email: <postmaster@poes-weather.com> Web: <http://www.poes-weather.com> */ //--------------------------------------------------------------------------- #include <QtGui> #include <QFontMetrics> #include <math.h> #include "gauge.h" //--------------------------------------------------------------------------- TGauge::TGauge(GaugeType type, QWidget *parent, double minValue, double maxValue) : QWidget(parent) { //qDebug("w:%d h:%d", parent->width(), parent->height()); // assume its size is squared setFixedSize(parent->width(), parent->height()); cp.setX(width() / 2.0); cp.setY(height() / 2.0); if(width() > height()) { // left align radius = cp.y() - 20; cp.setX(radius + 20); } else radius = cp.x() - 20; gaugetype = type; value = 30; roll = 10; pitch = 15; pitch_x = radius * 1.5; // pitch gauge x gap = 40; // gap between max and min angle in degrees font = new QFont(parent->font()); switch(gaugetype) { case Azimuth_GaugeType: { min_value = 0; max_value = 360; } break; case Elevation_GaugeType: { min_value = 0; max_value = 180; value = 0; } break; case MinMax_GaugeType: { min_value = minValue; max_value = maxValue; } break; case RollPitch_GaugeType: { min_value = 0; max_value = 360; gap = 0; } break; default: { type = MinMax_GaugeType; min_value = 0; max_value = 100; } } } //--------------------------------------------------------------------------- TGauge::~TGauge(void) { delete font; } //--------------------------------------------------------------------------- void TGauge::setValue(double new_value) { if(value == new_value) return; if(new_value < min_value) value = min_value; else if(new_value > max_value) value = max_value; else value = new_value; // qDebug("setvalue: %g", value); repaint(); } //--------------------------------------------------------------------------- void TGauge::setRollPitchValue(double _heading, double _roll, double _pitch) { if(value == _heading && roll == _roll && pitch == _pitch) return; value = _heading; roll = _roll; pitch = _pitch; repaint(); } //--------------------------------------------------------------------------- void TGauge::paintEvent(QPaintEvent *event) { QPainter painter; // qDebug("paint value: %g", value); painter.begin(this); painter.setRenderHint(QPainter::Antialiasing); painter.translate(cp); switch(gaugetype) { case Azimuth_GaugeType: drawAzimuthType(&painter, event); break; case Elevation_GaugeType: case MinMax_GaugeType: drawElevationType(&painter, event); break; case RollPitch_GaugeType: drawRollPitchType(&painter, event); break; default: break; } painter.end(); } //--------------------------------------------------------------------------- void TGauge::drawAzimuthType(QPainter *painter, QPaintEvent* /*event*/) { QPointF points[3]; int w = 9; painter->save(); painter->rotate(value); // north left side points[0] = QPointF(-w, 0); points[1] = QPointF(0, -radius); points[2] = QPointF(0, 0); painter->setPen(QPen(Qt::transparent)); painter->setBrush(QBrush(Qt::red)); painter->drawPolygon(points, 3); // north right side points[0] = QPointF(w, 0); points[1] = QPointF(0, -radius); points[2] = QPointF(0, 0); painter->setBrush(QBrush(Qt::darkRed)); painter->drawPolygon(points, 3); // south left side points[0] = QPointF(-w, 0); points[1] = QPointF(0, radius); points[2] = QPointF(0, 0); painter->setBrush(QBrush(Qt::blue)); painter->drawPolygon(points, 3); // south right side points[0] = QPointF(w, 0); points[1] = QPointF(0, radius); points[2] = QPointF(0, 0); painter->setBrush(QBrush(Qt::darkBlue)); painter->drawPolygon(points, 3); painter->restore(); } //--------------------------------------------------------------------------- void TGauge::drawElevationType(QPainter *painter, QPaintEvent* /*event*/) { double rad; #if 1 painter->setFont(*font); painter->setPen(QPen(Qt::black)); drawCircularTicks(painter, true); rad = valuetoangle(value); painter->setPen(QPen(Qt::black)); painter->drawLine(QPointF(0, 0), polarto(radius - 10, rad)); QString str; str.sprintf("%g", value); QPointF pt(-10, radius*3/4); painter->drawText(pt, str); #endif } //--------------------------------------------------------------------------- void TGauge::drawRollPitchType(QPainter *painter, QPaintEvent * /*event*/) { QPointF pt1, pt2; QString str; double rad, v; // draw captions and values painter->setPen(QPen(Qt::black)); font->setBold(true); painter->setFont(*font); QFontMetrics fm(*font); str = "Pitch"; painter->drawText(QPointF(pitch_x - fm.width(str), -radius - fm.xHeight()*2), str); str.sprintf("Heading: %g", value); painter->drawText(QPointF(-radius, -radius - fm.xHeight()*2), str); // N, E, S and W outside the gauge painter->drawText(QPointF(-fm.width("N")/2, -radius - fm.xHeight()/2), "N"); painter->drawText(QPointF(radius + fm.xHeight()/2, fm.xHeight()/2), "E"); painter->drawText(QPointF(-fm.width("S")/2, radius + fm.xHeight()+4), "S"); painter->drawText(QPointF(-radius - fm.width("W") - fm.xHeight()/2, fm.xHeight()/2), "W"); str.sprintf("Roll: %g", roll); painter->drawText(QPointF(-radius, radius + fm.xHeight()), str); font->setBold(false); painter->setFont(*font); // heading (azimuth) and roll drawCircularTicks(painter, false); drawArrow(painter, Qt::darkBlue, value + 180.0); // pitch (elevation) painter->setPen(QPen(Qt::black)); drawVerticalTicks(painter, true); drawVerticalArrow(painter, Qt::darkBlue, pitch); // roll v = radius * 0.5; painter->setPen(QPen(Qt::black)); painter->drawLine(-v, 3, v, 3); painter->drawLine(-v, -3, v, -3); painter->setPen(QPen(Qt::darkBlue)); rad = valuetoangle(roll - 90.0); pt1 = polarto(v, rad); pt2 = polarto(v, rad + M_PI); painter->drawLine(pt1, pt2); drawArrow(painter, Qt::darkBlue, roll - 90.0); drawArrow(painter, Qt::darkBlue, roll + 90.0); } //--------------------------------------------------------------------------- void TGauge::drawCircularTicks(QPainter *painter, bool drawtext) { QFontMetrics fm(*font); QRect txtrect; QPointF pt1, pt2; double a, rad, delta; int i, w; QString str; #if 1 delta = 2; a = min_value; i = 0; while(a <= max_value) { rad = valuetoangle(a); w = (i % 5) == 0 ? 10:5; pt1 = polarto(radius - w, rad); pt2 = polarto(radius, rad); painter->drawLine(pt1, pt2); if(drawtext && (i % 10) == 0) { str.sprintf("%g", a); txtrect = fm.boundingRect(str); if(pt1.x() < 0) pt1 = polarto(radius - w - txtrect.height() / 2.0, rad); painter->drawText(pt1, str); } i += 1; a += delta; } #else delta = 5; i = 0; a = gap; while(a < (360.0 - gap)) { rad = (a + 90.0) * M_PI / 180.0; w = (i % 5) == 0 ? 10:5; painter->drawLine(polarto(radius - w, rad), polarto(radius, rad)); i += 1; a += delta; } #endif } //--------------------------------------------------------------------------- // draw vertical scale to the right (-90...+90) // pitch -90...+90 (elevation) void TGauge::drawVerticalTicks(QPainter *painter, bool drawtext) { QFontMetrics fm(*font); QString str; QPointF pt1; double cx = pitch_x; double a, y; int i, w; painter->drawLine(cx, -radius, cx, radius); a = -90; i = 0; while(a <= 90) { y = radius / 90.0 * a; //w = (i % 5) == 0 ? 10:5; w = (i % 2) == 0 ? 10:5; painter->drawLine(cx, y, cx - w, y); //if(drawtext && (i % 10) == 0) { if(drawtext && (i % 4) == 0) { str.sprintf("%g", -a); pt1.setX(cx - w - fm.width(str) - 5); pt1.setY(y + fm.xHeight() / 2); painter->drawText(pt1, str); } #if 0 i += 1; a += 2; #else i += 1; a += 5; #endif } //qDebug("x: %g y: %g 2r: %g", topright.x(), topright.y(), radius*2.0); } //--------------------------------------------------------------------------- // angle is in degrees void TGauge::drawArrow(QPainter *painter, QColor cl, double angle) { QPointF points[4]; double edge = radius - 5; double w; painter->setBrush(QBrush(cl)); painter->setPen(QPen(cl)); w = 20; // 15 degree edge length points[0] = polarto(edge, valuetoangle(angle)); // arrow sharp edge points[1] = polarto(w, valuetoangle(angle - 165.0), points[0].x(), points[0].y()); points[2] = polarto(edge - w / 2.0, valuetoangle(angle)); points[3] = polarto(w, valuetoangle(angle + 165.0), points[0].x(), points[0].y()); painter->drawPolygon(points, 4); painter->drawLine(points[2], polarto(w, valuetoangle(angle + 180.0), points[2].x(), points[2].y())); } //--------------------------------------------------------------------------- void TGauge::drawVerticalArrow(QPainter *painter, QColor cl, double angle) { QFontMetrics fm(*font); QString str; QPointF points[4]; double cx = pitch_x - 7; double cy = -radius / 90.0 * angle; painter->setBrush(QBrush(cl)); painter->setPen(QPen(cl)); // 15 degree edge length = 20 pixels points[0] = QPointF(cx, cy); points[1] = QPointF(cx - 19, cy + 5); points[2] = QPointF(cx - 11, cy); points[3] = QPointF(cx - 19, cy - 5); painter->drawPolygon(points, 4); painter->drawLine(points[2], QPointF(points[2].x()-20, points[2].y())); str.sprintf("%g", angle); points[0].setX(pitch_x + 5); points[0].setY(cy + fm.xHeight() / 2); painter->drawText(points[0], str); } //--------------------------------------------------------------------------- // angle is in radians QPointF TGauge::polarto(double length, double angle, double dx, double dy) { qreal x = dx + length * cos(angle); qreal y = dy + length * sin(angle); return QPointF(x, y); } //--------------------------------------------------------------------------- // returns the gauge value converted to position in radians double TGauge::valuetoangle(double gauge_value) { double v; v = (90.0 + gap + ((360.0 - 2.0 * gap) / (max_value - min_value) ) * gauge_value) * M_PI / 180.0; return v; } //---------------------------------------------------------------------------
gpl-3.0
mattbernst/polyhartree
tests/test_energy_hf_gamess_us.py
843
#!/usr/bin/env python # -*- coding:utf-8 mode:python; tab-width:4; indent-tabs-mode:nil; py-indent-offset:4 -*- ## """ test_energy_hf_gamess_us ~~~~~~~~~~~~~~ Test GAMESS-US implementations for Hartree-Fock energy jobs. """ import sys import geoprep from adapters import gamess_us from tests.common_testcode import runSuite from tests import energy_hf as eh class GAMESSHFEnergyTestCase(eh.HFEnergyTestCase): def setUp(self): self.G = geoprep.Geotool() self.C = gamess_us.GAMESSUS() def runTests(): try: test_name = sys.argv[1] except IndexError: test_name = None if test_name: result = runSuite(GAMESSHFEnergyTestCase, name = test_name) else: result = runSuite(GAMESSHFEnergyTestCase) return result if __name__ == '__main__': runTests()
gpl-3.0
Mage15/Leaf
LeafStyle/PropertyClasses/SpecificProperties/Text/TextShadowProperty.cs
3510
/* Copyright (C) 2015 Matthew Gefaller This file is part of LeafStyle. LeafStyle is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. LeafStyle is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with LeafStyle. If not, see <http://www.gnu.org/licenses/>. */ using Microsoft.Xna.Framework; using System.Collections.Generic; namespace LeafStyle { public class TextShadowProperty : BasicStyleProperty<TextShadowState> { private Parser.ColorParser colorParser = new Parser.ColorParser(); private Parser.PointParser pointParser = new Parser.PointParser(); public Point Location { get; set; } public int Blur { get; set; } public Microsoft.Xna.Framework.Color Color { get; set; } public TextShadowProperty() : base( defaultState: default(TextShadowState), inherited: true, animatable: true ) { this.StateValues = new Dictionary<string, TextShadowState>() { {"use-values", TextShadowState.UseValues}, {"none", TextShadowState.None}, {"initial", TextShadowState.Initial}, {"inherit", TextShadowState.Inherit} }; } // Look at using Regex to parse public override bool TrySetStateValue(string value) { if (base.TrySetStateValue(value)) { return true; } else if (value != null) { string[] valuesArray = value.Split(new char[] { ' ' }); int index = 0; // Used to move through valuesArray Point location; if (index + 1 < valuesArray.Length && this.pointParser.TryPoint((valuesArray[index] + " " + valuesArray[index + 1]), out location)) { index += 2; // Prepare for next use. Move past the 2 indexes just used this.Location = location; } else // Must contain location { return false; } int blur; if (index < valuesArray.Length && valuesArray[index].Contains("px") && int.TryParse(valuesArray[index].Remove(valuesArray[index].IndexOf("px")), out blur)) { index++; // Prepare for next use this.Blur = blur; } // Blur is optional so no need to fail if not present Microsoft.Xna.Framework.Color color; if (index < valuesArray.Length && this.colorParser.TryColor(valuesArray[index], out color)) { index++; // Prepare for next use this.Color = color; } this.CurrentState = TextShadowState.UseValues; return true; } // Could not parse return false; } } }
gpl-3.0
myszha/qt-ponies
translations/qt-ponies_pl.ts
9775
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.0" language="pl_PL"> <context> <name>ConfigWindow</name> <message> <location filename="../src/configwindow.ui" line="14"/> <source>Qt Ponies</source> <translation>Qt Ponies</translation> </message> <message> <location filename="../src/configwindow.ui" line="60"/> <source>Add pony</source> <translation>Dodaj kucyka</translation> </message> <message> <location filename="../src/configwindow.ui" line="214"/> <source>Remove pony</source> <translation>Usuń kucyka</translation> </message> <message> <location filename="../src/configwindow.ui" line="257"/> <source>&amp;General</source> <translation>O&amp;gólne</translation> </message> <message> <location filename="../src/configwindow.ui" line="311"/> <source>Toggles if ponies are always on top of other windows</source> <translation>Przełącza czy kucyki mają być zawsze na wierzchu</translation> </message> <message> <location filename="../src/configwindow.ui" line="314"/> <source>&amp;Always on top</source> <translation>Z&amp;awsze na wierzchu</translation> </message> <message> <location filename="../src/configwindow.ui" line="399"/> <source>Bypass the X11 window manager, showing ponies on every desktop on top of every window</source> <translation>Omija manager okien, pokazując kucyki na wierzchu na każdym pulpicie</translation> </message> <message> <location filename="../src/configwindow.ui" line="402"/> <source>Show on every &amp;virtual desktop</source> <translation>Pokaż na każdym pulpicie &amp;wirtualnym</translation> </message> <message> <location filename="../src/configwindow.ui" line="386"/> <source>Specifies in which directory the pony data and configuration are</source> <translation>Określa w jakim katalogu znajdują się dane kucyków</translation> </message> <message> <location filename="../src/configwindow.ui" line="389"/> <source>Pony data di&amp;rectory</source> <translation>Katalog danych k&amp;ucyków</translation> </message> <message> <location filename="../src/configwindow.ui" line="324"/> <source>...</source> <translation>...</translation> </message> <message> <location filename="../src/configwindow.ui" line="448"/> <source>Toggle if interactions are to be executed</source> <translation>Włącza interakcje między kucykami</translation> </message> <message> <location filename="../src/configwindow.ui" line="451"/> <source>&amp;Interactions enabled</source> <translation>&amp;Interakcje włączone</translation> </message> <message> <location filename="../src/configwindow.ui" line="263"/> <source>Advanced options</source> <translation>Opcje zaawansowane</translation> </message> <message> <location filename="../src/configwindow.ui" line="288"/> <source>Toggle if debug messages are printed to console</source> <translation>Przełącza wypisywanie wiadomości debugujących do konsoli</translation> </message> <message> <location filename="../src/configwindow.ui" line="291"/> <source>&amp;Debug messages</source> <translation>Wiadomości &amp;debugujące</translation> </message> <message> <location filename="../src/configwindow.ui" line="281"/> <source>Show debug log</source> <translation>Pokaż komunikaty debugowania</translation> </message> <message> <location filename="../src/configwindow.ui" line="412"/> <source>Toggle if effects are enabled</source> <translation>Włącza efekty dla zachowań kucyków</translation> </message> <message> <location filename="../src/configwindow.ui" line="415"/> <source>Ef&amp;fects enabled</source> <translation>E&amp;fekty włączone</translation> </message> <message> <location filename="../src/configwindow.ui" line="461"/> <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Show the ponies in half size&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source> <translation>Pokaż kucyki w połowie rozmiaru</translation> </message> <message> <location filename="../src/configwindow.ui" line="464"/> <source>Small ponies</source> <translation>Małe kucyki</translation> </message> <message> <location filename="../src/configwindow.ui" line="482"/> <source>S&amp;peech</source> <translation>&amp;Mowa</translation> </message> <message> <location filename="../src/configwindow.ui" line="500"/> <source> ms</source> <translation> ms</translation> </message> <message> <location filename="../src/configwindow.ui" line="529"/> <source>For how long the speech is to stay on screen</source> <translation>Jak długo wiadomości tekstowe mają pozostawać na ekranie</translation> </message> <message> <location filename="../src/configwindow.ui" line="532"/> <source>&amp;Text delay</source> <translation>&amp;Czas wyświetlania wiadomości</translation> </message> <message> <location filename="../src/configwindow.ui" line="542"/> <source>Toggles if ponies are to speak</source> <translation>Włącza mowę kucyków</translation> </message> <message> <location filename="../src/configwindow.ui" line="545"/> <source>&amp;Speech enabled</source> <translation>Mow&amp;a włączona</translation> </message> <message> <location filename="../src/configwindow.ui" line="574"/> <source>NOT ACTIVE. Toggles the playing of sounds when a pony speaks.</source> <translation>NIEAKTYWNE. Przełącza odtwarzanie dźwięków gdy kucyk mówi.</translation> </message> <message> <location filename="../src/configwindow.ui" line="577"/> <source>Play s&amp;ounds</source> <translation>Odtwarzaj dźwię&amp;ki</translation> </message> <message> <location filename="../src/configwindow.ui" line="597"/> <source>Sound</source> <translation>Dźwięk</translation> </message> <message> <location filename="../src/configwindow.ui" line="604"/> <source>How frequently ponies speak</source> <translation>Jak często kucyk mówi</translation> </message> <message> <location filename="../src/configwindow.ui" line="607"/> <source>Sp&amp;eech probability</source> <translation>Pra&amp;wdopodobieństwo mowy</translation> </message> <message> <location filename="../src/configwindow.ui" line="620"/> <source> %</source> <translation> %</translation> </message> <message> <location filename="../src/configwindow.ui" line="637"/> <source>Accept</source> <translation>Zapisz</translation> </message> <message> <location filename="../src/configwindow.ui" line="657"/> <source>Reset</source> <translation>Zresetuj</translation> </message> <message> <location filename="../src/configwindow.ui" line="664"/> <source>&amp;Show advanced options</source> <translation>Pokaż opcje &amp;zaawansowane</translation> </message> <message> <location filename="../src/configwindow.ui" line="685"/> <source>toolBar</source> <translation>Toolbar</translation> </message> <message> <location filename="../src/configwindow.cpp" line="97"/> <source>Open configuration</source> <translation>Otwórz konfigurację</translation> </message> <message> <location filename="../src/configwindow.cpp" line="98"/> <source>Close application</source> <translation>Zamknij aplikację</translation> </message> <message> <location filename="../src/configwindow.cpp" line="106"/> <source>Add ponies</source> <translation>Dodaj kucyki</translation> </message> <message> <location filename="../src/configwindow.cpp" line="109"/> <source>Active ponies</source> <translation>Aktywne kucyki</translation> </message> <message> <location filename="../src/configwindow.cpp" line="111"/> <source>Configuration</source> <translation>Konfiguracja</translation> </message> <message> <location filename="../src/configwindow.cpp" line="438"/> <source>Select pony data directory</source> <translation>Wybierz katalog danych kucyków</translation> </message> </context> <context> <name>DebugWindow</name> <message> <location filename="../src/debugwindow.ui" line="14"/> <source>Debug messages</source> <translation>Komunikaty debugowania</translation> </message> </context> <context> <name>Pony</name> <message> <location filename="../src/pony.cpp" line="186"/> <source>Sleeping</source> <translation>Śpi</translation> </message> <message> <location filename="../src/pony.cpp" line="193"/> <source>Remove %1</source> <translation>Usuń %1</translation> </message> <message> <location filename="../src/pony.cpp" line="194"/> <source>Remove every %1</source> <translation>Usuń każdego %1</translation> </message> </context> </TS>
gpl-3.0
IntersectAustralia/anznn
app/reports/question_problems_organiser.rb
3163
# ANZNN - Australian & New Zealand Neonatal Network # Copyright (C) 2017 Intersect Australia Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # Class which organises the validation failures for a batch upload into the structures needed for generating the reports class QuestionProblemsOrganiser attr_accessor :aggregated_problems attr_accessor :raw_problems def initialize self.aggregated_problems = {} self.raw_problems = [] end def add_problems(question_code, baby_code, fatal_warnings, warnings, answer_value) fatal_warnings.each { |fw| add_problem(question_code, baby_code, fw, "Error", answer_value) } warnings.each { |w| add_problem(question_code, baby_code, w, "Warning", answer_value) } end # organise the aggregated problems for display in the summary report - for each problem there's two rows # the first row is the question, problem type, message and count of problem records # the second row is a comma separated list of baby codes that have the problem def aggregated_by_question_and_message problem_records = aggregated_problems.values.collect(&:values).flatten.sort_by { |prob| [ prob.question_code, prob.message ] } table = [] table << ['Column', 'Type', 'Message', 'Number of records'] problem_records.each do |problem| table << [problem.question_code, problem.type, problem.message, problem.baby_codes.size.to_s] table << ["", "", problem.baby_codes.join(", "), ""] end table end # sort the problems by baby code, column name and message def detailed_problems raw_problems.sort_by { |prob| [ prob[0], prob[1], prob[4] ] } end private def add_problem(question_code, baby_code, message, type, answer_value) # for the aggregated report, we count up unique errors by question and error message and keep track of which baby codes have those errors aggregated_problems[question_code] = {} unless aggregated_problems.has_key?(question_code) problems_for_question_code = aggregated_problems[question_code] problems_for_question_code[message] = QuestionProblem.new(question_code, message, type) unless problems_for_question_code.has_key?(message) problem_object = problems_for_question_code[message] problem_object.add_baby_code(baby_code) #for the detail report, splat out the problems into one record per baby-code / question-code / error message #into to an array of arrays, containing: baby-code, question-code, problem-type, value, message raw_problems << [baby_code, question_code, type, answer_value, message] end end
gpl-3.0
cams7/erp
freedom/src/main/java/org/freedom/modulos/std/view/dialog/utility/DLCriaContrato.java
2962
package org.freedom.modulos.std.view.dialog.utility; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Date; import org.freedom.acao.CarregaEvent; import org.freedom.acao.CarregaListener; import org.freedom.infra.model.jdbc.DbConnection; import org.freedom.library.functions.Funcoes; import org.freedom.library.persistence.GuardaCampo; import org.freedom.library.persistence.ListaCampos; import org.freedom.library.swing.component.JLabelPad; import org.freedom.library.swing.component.JTextFieldFK; import org.freedom.library.swing.component.JTextFieldPad; import org.freedom.library.swing.dialog.FDialogo; import org.freedom.library.swing.frame.Aplicativo; import org.freedom.modulos.gms.business.object.TipoMov; import org.freedom.modulos.lvf.business.object.SeqSerie; public class DLCriaContrato extends FDialogo implements CarregaListener, ActionListener { private static final long serialVersionUID = 1L; private JTextFieldPad txtNewCod = new JTextFieldPad( JTextFieldPad.TP_INTEGER, 8, 0 ); private JTextFieldPad txtDescContrato = new JTextFieldPad( JTextFieldPad.TP_STRING, 40, 0 ); private Integer codCli; private String nomeCli; private Integer codContr; public DLCriaContrato( Integer codContr, Integer codCli, String nomeCli ) { this.codCli = codCli; this.nomeCli = nomeCli; this.codContr = codContr; setTitulo( "Confirmação" ); String labeltipo = ""; setAtribos( 300, 200 ); labeltipo = "uma venda"; // Se for uma compra ou venda e deve ser confirmado o codigo // if ( ( "V".equals( tipo ) ) && confirmacodigo ) { adic( new JLabelPad( "Deseja criar " + labeltipo + " agora?" ), 7, 15, 220, 20 ); adic( new JLabelPad( "Nº Pedido" ), 7, 40, 80, 20 ); adic( txtNewCod, 87, 40, 120, 20 ); adic( new JLabelPad( "Descrição do Projeto" ), 7, 63, 250, 20 ); adic( txtDescContrato, 7, 83, 250, 20 ); montaDescProd(); } private void montaDescProd() { String desccontr = " Contrato número " + codContr + " - " + nomeCli ; txtDescContrato.setVlrString( desccontr ); } public void setNewCodigo( int arg ) { txtNewCod.setVlrInteger( arg ); } public int getNewCodigo() { return txtNewCod.getVlrInteger().intValue(); } public String getDescContr() { return txtDescContrato.getVlrString(); } @ Override public void actionPerformed( ActionEvent evt ) { if ( evt.getSource() == btOK ) { if (!"".equals( txtDescContrato.getVlrString())){ OK = true; setVisible(false); } else { Funcoes.mensagemInforma( this, "Descrição do contato é um campo requerido!!!" ); txtDescContrato.requestFocus(); OK = false; } } if (evt.getSource() == btCancel) { OK = false; setVisible(false); } } public void beforeCarrega( CarregaEvent cevt ) { // TODO Auto-generated method stub } public void afterCarrega( CarregaEvent cevt ) { // TODO Auto-generated method stub } }
gpl-3.0
iDenn/monstra-cms
plugins/box/blocks/languages/ru.lang.php
1604
<?php return array( 'blocks' => array( 'Blocks' => 'Блоки', 'Blocks manager' => 'Менеджер блоков', 'Delete' => 'Удалить', 'Edit' => 'Редактировать', 'New block' => 'Новый блок', 'Create new block' => 'Создать новый блок', 'Name' => 'Название', 'Edit block' => 'Редактирование блока', 'Save' => 'Сохранить', 'Actions' => 'Действия', 'Save and exit' => 'Сохранить и выйти', 'Required field' => 'Обязательное поле', 'This block already exists' => 'Такой блок уже существует', 'This block does not exist' => 'Такого блока не существует', 'Delete block: :block' => 'Удалить блок: :block', 'Block content' => 'Содержимое блока', 'Block <i>:name</i> deleted' => 'Сниппет <i>:name</i> удален', 'Your changes to the block <i>:name</i> have been saved.' => 'Ваши изменения к блоку <i>:name</i> были сохранены.', 'Delete block: :block' => 'Удалить блок: :block', 'View Embed Code' => 'Код для вставки', 'Embed Code' => 'Код для вставки', 'Shortcode' => 'Шорткод', 'PHP Code' => 'PHP код', ) );
gpl-3.0
Myzreal/LogZ
src/pl/codefolio/rsk/tests/DatetimeTest.java
2432
package pl.codefolio.rsk.tests; import org.junit.Test; import pl.codefolio.rsk.components.Datetime; import pl.codefolio.rsk.exceptions.InvalidDatetimeFormatException; import static org.junit.Assert.*; /** * -------------------------------------------------------------------- * * LogZ - a parser for DayZ Standalone logs. Copyright (C) 2015 Radoslaw Skupnik This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. * * -------------------------------------------------------------------- * * @author Radoslaw Skupnik * */ public class DatetimeTest { @Test public void basicTest() { try { Datetime time = new Datetime("2015-02-11", "23:00:32", "23:41:18"); assertEquals("2015-2-11 23:41:18", time.getDatetime()); time = new Datetime("2015-02-11", "23:00:32", "00:00:10"); assertEquals("2015-2-12 0:0:10", time.getDatetime()); time = new Datetime("2015-02-28", "23:00:32", "00:00:10"); assertEquals("2015-3-1 0:0:10", time.getDatetime()); time = new Datetime("2015-02-12", "11:00:24", "00:00:10"); assertEquals("2015-2-12 0:0:10", time.getDatetime()); } catch (InvalidDatetimeFormatException e) { e.printStackTrace(); } } @Test public void correctedTest() { try { Datetime time = new Datetime("2015-02-11", "23:00:32", "23:41:18"); assertEquals("2015-02-11 23:41:18", time.getDatetimeCorrected()); time = new Datetime("2015-02-11", "23:00:32", "00:00:10"); assertEquals("2015-02-12 00:00:10", time.getDatetimeCorrected()); time = new Datetime("2015-02-28", "23:00:32", "00:00:10"); assertEquals("2015-03-01 00:00:10", time.getDatetimeCorrected()); time = new Datetime("2015-02-12", "11:00:24", "00:00:10"); assertEquals("2015-02-12 00:00:10", time.getDatetimeCorrected()); } catch (InvalidDatetimeFormatException e) { e.printStackTrace(); } } }
gpl-3.0
zeminlu/comitaco
tests/ase2016/introclass/grade/introclass_e23b96b6_002.java
1081
package ase2016.introclass.grade; public class introclass_e23b96b6_002 { public introclass_e23b96b6_002() { } /*@ @ requires (a > b && b > c && c > d); @ ensures ((\old(score) >= \old(a)) <==> (\result == 1)); @ ensures ((\old(score) >= \old(b) && \old(score)<\old(a)) <==> (\result == 2)); @ ensures ((\old(score) >= \old(c) && \old(score)<\old(b)) <==> (\result == 3)); @ ensures ((\old(score) >= \old(d) && \old(score)<\old(c)) <==> (\result == 4)); @ ensures ((\old(score) < \old(d)) <==> (\result == 5)); @ signals (RuntimeException e) false; @ @*/ public int grade(int a, int b, int c, int d, int score) { if (score > a) { //mutGenLimit 1 return 1; } else if (score < a && score >= b) { //mutGenLimit 1 return 2; } else if (score < b && score >= c) { //mutGenLimit 1 return 3; } else if (score < c && score >= d) { //mutGenLimit 1 return 4; } else if (score < d) { //mutGenLimit 1 return 5; } return 0; //mutGenLimit 1 } }
gpl-3.0
CMPUT301F16T09/Unter
app/src/main/java/com/cmput301f16t09/unter/MyRideRequestsUIActivity.java
6101
package com.cmput301f16t09.unter; import android.content.DialogInterface; import android.content.Intent; import android.graphics.Color; import android.os.Bundle; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; /** * The type My ride requests ui activity. */ public class MyRideRequestsUIActivity extends AppCompatActivity { private PostList postList = new PostList(); private ArrayAdapter<Post> adapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getSupportActionBar().setTitle("Viewing My Ride Requests"); setContentView(R.layout.activity_my_ride_requests_ui); ListView currentPostList = (ListView) findViewById(R.id.listViewMyRideRequests); //Get All posts for the specific user for(Post p : PostListMainController.getPostList(MyRideRequestsUIActivity.this).getPosts()) { if (p.getUsername().equals(CurrentUser.getCurrentUser().getUsername())) { postList.addPost(p); } } adapter = new ArrayAdapter<Post>(this, android.R.layout.simple_list_item_1, postList.getPosts()) { // Set the view @Override public View getView(int position, View convertView, ViewGroup parent) { View view = super.getView(position, convertView, parent); TextView tv = (TextView) view.findViewById(android.R.id.text1); String startLocation = postList.getPost(position).getStartAddress(); String endLocation = postList.getPost(position).getEndAddress(); tv.setText("Start: " + startLocation +"\nEnd: " + endLocation); tv.setTextColor(Color.WHITE); tv.setTextSize(20); return view; } }; currentPostList.setAdapter(adapter); currentPostList.setOnItemClickListener(new AdapterView.OnItemClickListener(){ public void onItemClick(AdapterView<?> adapterView, View view, int pos ,long id){ CurrentUser.setCurrentPost(postList.getPost(pos)); if (CurrentUser.getCurrentPost().getDriver() == null) { Intent RiderRequestPreIntent = new Intent(MyRideRequestsUIActivity.this, RidersRequestDetailsPreUIActivity.class); startActivity(RiderRequestPreIntent); } else { Intent RiderRequestPostIntent = new Intent(MyRideRequestsUIActivity.this, RidersRequestDetailsPostUIActivity.class); startActivity(RiderRequestPostIntent); } } }); currentPostList.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView<?> adapterView, View view, int pos, long id) { final Post postToRemove = postList.getPosts().get(pos); createDeletionDialog(postToRemove); return true; } }); } @Override public void onResume() { super.onResume(); // Update the list of new posts postList.getPosts().clear(); for(Post p : PostListMainController.getPostList(MyRideRequestsUIActivity.this).getPosts()) { if (p.getUsername().equals(CurrentUser.getCurrentUser().getUsername())) { postList.addPost(p); } } adapter.notifyDataSetChanged(); } /** * Create deletion dialog. * * @param post the post */ public void createDeletionDialog(Post post) { // Build the dialog AlertDialog.Builder deleteDialog = new AlertDialog.Builder(MyRideRequestsUIActivity.this); deleteDialog.setMessage("Delete This Post?"); deleteDialog.setCancelable(true); deleteDialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { // Don't do anything if Cancel is clicked, which closes the dialog @Override public void onClick(DialogInterface dialogInterface, int i) { } }); // If delete is pressed deleteDialog.setPositiveButton("Delete", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { try { PostListOnlineController.DeletePostsTask deletePostsTask = new PostListOnlineController.DeletePostsTask(); deletePostsTask.execute(CurrentUser.getCurrentPost()); deletePostsTask.get(); UserListOnlineController.UpdateUsersTask updateUsersTask = new UserListOnlineController.UpdateUsersTask(); updateUsersTask.execute(CurrentUser.getCurrentUser()); updateUsersTask.get(); } catch (Exception e) { e.printStackTrace(); } // Save this change of data into FILENAME PostListMainController.updateMainOfflinePosts(MyRideRequestsUIActivity.this); // Update the list of new posts postList.getPosts().clear(); for(Post p : PostListMainController.getPostList(MyRideRequestsUIActivity.this).getPosts()) { if (p.getUsername().equals(CurrentUser.getCurrentUser().getUsername())) { postList.addPost(p); } } adapter.notifyDataSetChanged(); Toast.makeText(MyRideRequestsUIActivity.this, "Post Deleted", Toast.LENGTH_SHORT).show(); } }); // Show the dialog deleteDialog.show(); } }
gpl-3.0
davidvilla/python-doublex
doublex/safeunicode.py
333
# -*- coding: utf-8 -*- import sys def __if_number_get_string(number): converted_str = number if isinstance(number, (int, float)): converted_str = str(number) return converted_str def get_string(strOrUnicode, encoding='utf-8'): strOrUnicode = __if_number_get_string(strOrUnicode) return strOrUnicode
gpl-3.0
SpoutDev/BukkitBridge
src/main/java/org/spout/bridge/bukkit/entity/BridgeEnderSignal.java
1198
/* * This file is part of BukkitBridge. * * Copyright (c) 2012 Spout LLC <http://www.spout.org/> * BukkitBridge is licensed under the GNU General Public License. * * BukkitBridge is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * BukkitBridge is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.spout.bridge.bukkit.entity; import org.bukkit.entity.EnderSignal; import org.bukkit.entity.EntityType; import org.spout.api.entity.Entity; public class BridgeEnderSignal extends BridgeEntity implements EnderSignal { protected BridgeEnderSignal(Entity handle) { super(handle); } @Override public EntityType getType() { return EntityType.ENDER_SIGNAL; } }
gpl-3.0
gizela/gizela
gizela/xml/GamaLocalObsParser.py
14232
# gizela # # Copyright (C) 2010 Michal Seidl, Tomas Kubin # Author: Tomas Kubin <tomas.kubin@fsv.cvut.cz> # URL: <http://slon.fsv.cvut.cz/gizela> # #$Id: GamaLocalObsParser.py 103 2010-11-29 00:06:19Z tomaskubin $ from gizela.util.Error import Error # parser import xml.parsers.expat # points from gizela.data.PointLocalGama import PointLocalGama from gizela.data.PointCartCovMat import PointCartCovMat #from gizela.data.PointListCovMat import PointListCovMat #from gizela.data.PointList import PointList #from gizela.data.CovMat import CovMat from gizela.data.GamaCoordStatus import GamaCoordStatus from gizela.data.GamaCoordStatus import gama_coord_status_attr_fix from gizela.data.GamaCoordStatus import gama_coord_status_attr_adj # measurements from gizela.data.ObsCluster import ObsCluster from gizela.data.ObsClusterHeightDiff import ObsClusterHeightDiff from gizela.data.ObsDirection import ObsDirection from gizela.data.ObsDistance import ObsDistance from gizela.data.ObsSDistance import ObsSDistance from gizela.data.ObsZAngle import ObsZAngle from gizela.data.ObsHeightDiff import ObsHeightDiff from gizela.data.ObsClusterVector import ObsClusterVector from gizela.data.ObsVector import ObsVector from gizela.data.ObsClusterCoor import ObsClusterCoor # covariance matrix from gizela.data.CovMat import CovMat # units from gizela.util.Unit import Unit class GamaLocalObsParserError(Error): pass class GamaLocalObsParser(object): """ Expat parser for <gama-local> document - measurements Units required: meter, gon (degrees are not allowed) Warning: covariance matrix for observations with unit gon is not correctly readed. Only unit meter is readed correctly. """ __slots__ = ["data", "_parser", "_characterData", "_tagName", "_tagLast", "_tagLLast", "_coor", "_cluster", "_pointListAdj", "_pointListFix", "_clusterList", "_description", "_root"] def __init__(self, data): ''' data : instance for data storage ''' # data self.data=data # create expat parser self._parser = xml.parsers.expat.ParserCreate() # handles self._parser.StartElementHandler = self._handle_start_element self._parser.EndElementHandler = self._handle_end_element self._parser.CharacterDataHandler = self._handle_char_data # internal data self._root=False # is root element ok? self._characterData="" self._tagName="" self._tagLast="" self._tagLLast="" self._coor=False # indicates tag <coordinates> self._cluster=None # actual cluster # setting of lists in data instance self._pointListAdj = self.data.pointListAdj self._pointListFix = self.data.pointListFix self._clusterList = self.data.obsClusterList def parse_file(self, file): '''parses file - file object''' self._parser.ParseFile(file) def parse_string(self, str): '''parses string''' self._parser.Parse(str) def _handle_start_element(self, name, attrs): '''start element handler for method all''' if not self._root: if name == "gama-local": self._root = True else: raise GamaLocalObsParserError, "<gama-local> root element not found" self._tagLLast=self._tagLast self._tagLast=self._tagName self._tagName=name if name=="network" or\ name=="parameters" or\ name=="points-observations": # save attributes if attrs: for aname, val in attrs.items(): #import sys #print >>sys.stderr, "Parameter: %s" % aname #parameters if aname=="update-constrained-coordinates": self.data.param[aname] = val elif aname=="epoch": self.data.param[aname] = float(val) elif aname=="tol-abs": self.data.param[aname] = float(val) / Unit.tolabs # standard deviation elif aname=="direction-stdev" or\ aname=="angle-stdev" or\ aname=="zenith-angle-stdev": self.data.param[aname] = \ float(val) / Unit.angleStdev elif aname=="distance-stdev": val = [float(v) / Unit.distStdev \ for v in val.split()] self.data.param[aname] = val elif aname=="sigma-apr": self.data.stdev["apriori"] = float(val) #self.data.stdev.apriori = float(val) elif aname=="sigma-act": self.data.stdev["used"] = val.strip() #if val.strip() == "apriori": # self.data.stdev.set_use_apriori() #elif val.strip() == "aposteriori": # self.data.stdev.set_use_aposteriori() #else: # raise GamaLocalObsParserError, \ # "unknown sigma-act tag: %s" %val elif aname=="conf-pr": self.data.stdev["probability"] = float(val) #self.data.stdev.set_conf_prob(float(val)) elif aname=="axes-xy": self.data.param[aname] = val #self.data.coordSystemLocal.axesOri = val elif aname=="angles": self.data.param[aname] = val #self.data.coordSystemLocal.bearingOri = val else: import sys sys.stderr.write("unhandled parameter %s = \"%s\"\n" %\ (aname, val)) # points and coordinates elif name=="point": x, y, z, adj, fix = None, None, None, None, None if "x" in attrs: x = float(attrs["x"]) if "y" in attrs: y = float(attrs["y"]) if "z" in attrs: z = float(attrs["z"]) if self._coor: # inside tag <coordinates> point = PointCartCovMat(id = attrs['id'], x=x, y=y,\ z=z) self._cluster.append_obs(point) else: point = PointLocalGama(id = attrs['id'], x=x, y=y, z=z) if "adj" in attrs: point.status = gama_coord_status_attr_adj(attrs["adj"]) self._pointListAdj.add_point(point) elif "fix" in attrs: point.status = gama_coord_status_attr_fix(attrs["fix"]) self._pointListFix.add_point(point) # cluster obs and observations elif name=="obs": if "from" in attrs: fromid = attrs["from"] else: fromid=None if "from_dh" in attrs: fromdh = float(attrs["from_dh"]) else: fromdh=None if "orientation" in attrs: import sys print >>sys.stderr, 'warning: attribute "orientation" not accepted' self._cluster = ObsCluster(fromid=fromid, fromdh=fromdh) self._clusterList.append_cluster(self._cluster) elif name=="direction": if "stdev" in attrs: stdev = float(attrs["stdev"] ) / Unit.angleStdev else: stdev=None if "from_dh" in attrs: fromdh = float(attrs["from_dh"]) else: fromdh=None if "to_dh" in attrs: todh = float(attrs["to_dh"]) else: todh=None val = float(attrs["val"]) / Unit.angleVal direction = ObsDirection(toid=attrs["to"], val=val,\ stdev=stdev, fromdh=fromdh, todh=todh) self._cluster.append_obs(direction) elif name=="distance": if "from" in attrs: fromid = attrs["from"] else: fromid=None if "stdev" in attrs: stdev = float(attrs["stdev"]) / Unit.distStdev else: stdev=None if "from_dh" in attrs: fromdh = float(attrs["from_dh"]) else: fromdh=None if "to_dh" in attrs: todh = float(attrs["to_dh"]) else: todh=None distance = ObsDistance(toid=attrs["to"], val=float(attrs["val"]),\ fromid=fromid, stdev=stdev, fromdh=fromdh, todh=todh) self._cluster.append_obs(distance) elif name=="s-distance": if "from" in attrs: fromid = attrs["from"] else: fromid=None if "stdev" in attrs: stdev = float(attrs["stdev"]) / Unit.distStdev else: stdev=None if "from_dh" in attrs: fromdh = float(attrs["from_dh"]) else: fromdh=None if "to_dh" in attrs: todh = float(attrs["to_dh"]) else: todh=None sdistance = ObsSDistance(toid=attrs["to"], val=float(attrs["val"]),\ fromid=fromid, stdev=stdev, fromdh=fromdh, todh=todh) self._cluster.append_obs(sdistance) elif name=="z-angle": if "from" in attrs: fromid = attrs["from"] else: fromid=None if "stdev" in attrs: stdev = float(attrs["stdev"] ) / Unit.angleStdev else: stdev=None if "from_dh" in attrs: fromdh = float(attrs["from_dh"]) else: fromdh=None if "to_dh" in attrs: todh = float(attrs["to_dh"]) else: todh=None val = float(attrs["val"]) / Unit.angleVal zangle = ObsZAngle(toid=attrs["to"], val=val,\ fromid=fromid, stdev=stdev, fromdh=fromdh, todh=todh) self._cluster.append_obs(zangle) # cluster height-differences and observations elif name=="height-differences": self._cluster = ObsClusterHeightDiff() self._clusterList.append_cluster(self._cluster) elif name=="dh": if "stdev" in attrs: stdev = float(attrs["stdev"]) / Unit.distStdev else: stdev=None if "dist" in attrs: dist = float(attrs["dist"]) / Unit.dhdist else: dist=None dh = ObsHeightDiff(fromid=attrs["from"], toid=attrs["to"], val=float(attrs["val"]), stdev=stdev, dist=dist) self._cluster.append_obs(dh) # cluster vector and observations elif name=="vectors": self._cluster = ObsClusterVector() #self.data["clusterList"].append_cluster(cluster) self._clusterList.append_cluster(self._cluster) elif name=="vec": if "from_dh" in attrs: fromdh = float(attrs["from_dh"]) else: fromdh=None if "to_dh" in attrs: todh = float(attrs["to_dh"]) else: todh=None vec = ObsVector(fromid=attrs["from"], toid=attrs["to"], dx=float(attrs["dx"]), dy=float(attrs["dy"]), dz=float(attrs["dz"])) #fromdh=fromdh, todh=todh) self._cluster.append_obs(vec) # cluster coordinates - observations <point /> are handled in "point" elif name=="coordinates": self._coor = True self._cluster = ObsClusterCoor() self._clusterList.append_cluster(self._cluster) # covariance matrix inside cluster elif name=="cov-mat": self._cluster.covmat = CovMat(dim=int(attrs["dim"]), band=int(attrs["band"])) # tags with nothing to do elif name=="gama-local" or \ name=="description": pass else: import sys sys.stderr.write("unhandled start tag %s\n" % name) def _handle_end_element(self, name): '''end element handler for method all''' # description if name=="description": self.data.description = self._characterData.strip() #import sys #print >>sys.stderr, "Decsr.", self.data.description # covariance matrix elif name=="cov-mat": for val in self._characterData.split(): self._cluster.covmat.append_value(\ float(val) / Unit.distStdev**2) # end section of coordinates elif name=="coordinates": self._coor = False # tags with nothig to do elif name=="point" or\ name=="vectors" or\ name=="vec" or\ name=="gama-local" or\ name=="network" or\ name=="points-observations" or\ name=="parameters" or\ name=="direction" or\ name=="distance" or\ name=="s-distance" or\ name=="z-angle" or\ name=="obs" or\ name=="dh" or\ name=="height-differences": pass else: import sys sys.stderr.write("unhandled end tag \"%s\"\n" % name) self._characterData="" def _handle_char_data(self, data): '''character data handler for method all and info''' self._characterData+=data if __name__=="__main__": print "see gizela/data/GamaLocalDataObs.py"
gpl-3.0
rapgolya/meetup-client
app/src/main/java/hu/bme/aut/mobsoft/mobsoftlab/ui/categories/CategoriesScreen.java
282
package hu.bme.aut.mobsoft.mobsoftlab.ui.categories; import java.util.List; import hu.bme.aut.mobsoft.mobsoftlab.model.Category; /** * Created by rapgo on 2017. 05. 18.. */ public interface CategoriesScreen { public void onCategoriesChange(List<Category> categories); }
gpl-3.0
waikato-datamining/adams-base
adams-net/src/main/java/adams/data/io/input/MultiEmailReader.java
1202
/* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** * MultiEmailReader.java * Copyright (C) 2013 University of Waikato, Hamilton, New Zealand */ package adams.data.io.input; import java.util.List; import adams.core.net.Email; /** * Interface for readers that can read multiple emails at once. * * @author fracpete (fracpete at waikato dot ac dot nz) * @version $Revision$ */ public interface MultiEmailReader extends EmailReader { /** * Reads the emails. * * @return the emails, null in case of an error */ public List<Email> readAll(); }
gpl-3.0
spillerrec/TheBlackHole
src/filesystem/File.hpp
855
/* This file is part of TheBlackHole, which is free software and is licensed * under the terms of the GNU GPL v3.0. (see http://www.gnu.org/licenses/ ) */ #ifndef FILE_HPP #define FILE_HPP #include <QFileInfo> #include "AFileItem.hpp" class File : public AFileItem{ private: class Directory* parent; QFileInfo info; Cached<int64_t> size; public: File( Directory* parent, QFileInfo info ) : parent(parent), info(info) { } int64_t getTotalSize() override { return size.get( [&](){ return info.size(); } ); } int64_t filesCount() override { return 1; } int64_t directoriesCount() override { return 0; } int64_t childrenCount() override { return 0; } AFileItem& getChild( int ) override { return *this; } QString name() override { return info.completeBaseName(); } bool isFolder() const override{ return false; } }; #endif
gpl-3.0
nlegoff/Phraseanet
tests/Alchemy/Tests/Phrasea/Command/Setup/CheckEnvironmentTest.php
571
<?php namespace Alchemy\Tests\Phrasea\Command\Setup; use Alchemy\Phrasea\Command\Setup\CheckEnvironment; class CheckEnvironmentTest extends \PhraseanetTestCase { public function testRunWithoutProblems() { $input = $this->getMock('Symfony\Component\Console\Input\InputInterface'); $output = $this->getMock('Symfony\Component\Console\Output\OutputInterface'); $command = new CheckEnvironment('system:check'); $command->setContainer(self::$DI['cli']); $this->assertLessThan(2, $command->execute($input, $output)); } }
gpl-3.0
rhomicom-systems-tech-gh/Rhomicom-ERP-Desktop
RhomicomERP/EventsAndAttendance/Forms/checkinsForm.designer.cs
233034
namespace EventsAndAttendance.Forms { partial class checkinsForm { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(checkinsForm)); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle21 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle22 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle23 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle24 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle25 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle26 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle27 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle28 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle29 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle30 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle31 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle32 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle33 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle34 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle35 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle36 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle37 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle38 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle39 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle40 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle41 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle42 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel1 = new System.Windows.Forms.Panel(); this.saveLabel = new System.Windows.Forms.Label(); this.groupBox4 = new System.Windows.Forms.GroupBox(); this.smmryDataGridView = new System.Windows.Forms.DataGridView(); this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column10 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewCheckBoxColumn1 = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.smmryContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(); this.exptExSmryMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.rfrshSmryMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.vwSQLSmryMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.rcHstrySmryMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStrip3 = new System.Windows.Forms.ToolStrip(); this.calcSmryButton = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator18 = new System.Windows.Forms.ToolStripSeparator(); this.delSmryButton = new System.Windows.Forms.ToolStripButton(); this.printPrvwRcptButton = new System.Windows.Forms.ToolStripButton(); this.printRcptButton1 = new System.Windows.Forms.ToolStripButton(); this.printRcptButton = new System.Windows.Forms.ToolStripButton(); this.vwSmrySQLButton = new System.Windows.Forms.ToolStripButton(); this.rcHstrySmryButton = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator16 = new System.Windows.Forms.ToolStripSeparator(); this.addChrgButton = new System.Windows.Forms.ToolStripButton(); this.autoBalscheckBox = new System.Windows.Forms.CheckBox(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.itemsDataGridView = new EventsAndAttendance.Classes.MyDataGridView(); this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column19 = new System.Windows.Forms.DataGridViewButtonColumn(); this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column23 = new System.Windows.Forms.DataGridViewButtonColumn(); this.Column4 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column27 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column28 = new System.Windows.Forms.DataGridViewButtonColumn(); this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column25 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column26 = new System.Windows.Forms.DataGridViewButtonColumn(); this.Column8 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column20 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column9 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column17 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column18 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column11 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column7 = new System.Windows.Forms.DataGridViewButtonColumn(); this.Column14 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column12 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column22 = new System.Windows.Forms.DataGridViewButtonColumn(); this.Column15 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column13 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column21 = new System.Windows.Forms.DataGridViewButtonColumn(); this.Column16 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column24 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column29 = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.Column30 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column31 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.docDtContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(); this.addDtMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.delDtMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator(); this.vwExtraInfoMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator(); this.exptExDtMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.rfrshDtMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.vwSQLDtMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.rcHstryDtMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.dteTextBox1 = new System.Windows.Forms.TextBox(); this.salesDocNumTextBox = new System.Windows.Forms.TextBox(); this.salesApprvlStatusTextBox = new System.Windows.Forms.TextBox(); this.salesDocTypeTextBox = new System.Windows.Forms.TextBox(); this.toolStrip2 = new System.Windows.Forms.ToolStrip(); this.addDtButton = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator(); this.delDtButton = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator(); this.vwSQLDtButton = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator(); this.rcHstryDtButton = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator(); this.customInvoiceButton = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator15 = new System.Windows.Forms.ToolStripSeparator(); this.rfrshDtButton = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator14 = new System.Windows.Forms.ToolStripSeparator(); this.prvwInvoiceButton = new System.Windows.Forms.ToolStripButton(); this.printInvoiceButton = new System.Windows.Forms.ToolStripButton(); this.printInvcButton1 = new System.Windows.Forms.ToolStripButton(); this.vwExtraInfoButton = new System.Windows.Forms.ToolStripButton(); this.vwAttchmntsButton = new System.Windows.Forms.ToolStripButton(); this.dscntButton = new System.Windows.Forms.ToolStripButton(); this.label1 = new System.Windows.Forms.Label(); this.salesDocIDTextBox = new System.Windows.Forms.TextBox(); this.toolStrip1 = new System.Windows.Forms.ToolStrip(); this.addCheckInButton = new System.Windows.Forms.ToolStripButton(); this.addRsrvtnButton = new System.Windows.Forms.ToolStripButton(); this.editButton = new System.Windows.Forms.ToolStripButton(); this.deleteButton = new System.Windows.Forms.ToolStripButton(); this.saveButton = new System.Windows.Forms.ToolStripButton(); this.goButton = new System.Windows.Forms.ToolStripButton(); this.rcHstryButton = new System.Windows.Forms.ToolStripButton(); this.vwSQLButton = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator(); this.moveFirstButton = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.movePreviousButton = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel(); this.positionTextBox = new System.Windows.Forms.ToolStripTextBox(); this.totalRecsLabel = new System.Windows.Forms.ToolStripLabel(); this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); this.moveNextButton = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); this.moveLastButton = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); this.dsplySizeComboBox = new System.Windows.Forms.ToolStripComboBox(); this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripLabel3 = new System.Windows.Forms.ToolStripLabel(); this.searchForTextBox = new System.Windows.Forms.ToolStripTextBox(); this.toolStripLabel4 = new System.Windows.Forms.ToolStripLabel(); this.searchInComboBox = new System.Windows.Forms.ToolStripComboBox(); this.resetButton = new System.Windows.Forms.ToolStripButton(); this.groupBox8 = new System.Windows.Forms.GroupBox(); this.groupBox5 = new System.Windows.Forms.GroupBox(); this.showUnsettledCheckBox = new System.Windows.Forms.CheckBox(); this.showActiveCheckBox = new System.Windows.Forms.CheckBox(); this.checkInsListView = new System.Windows.Forms.ListView(); this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.docContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(); this.addMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.editMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.delMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator90 = new System.Windows.Forms.ToolStripSeparator(); this.exptExMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.rfrshMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.vwSQLMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.rcHstryMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.groupBox6 = new System.Windows.Forms.GroupBox(); this.groupBox7 = new System.Windows.Forms.GroupBox(); this.cancelButton = new System.Windows.Forms.Button(); this.imageList2 = new System.Windows.Forms.ImageList(); this.badDebtButton = new System.Windows.Forms.Button(); this.settleBillButton = new System.Windows.Forms.Button(); this.imageList1 = new System.Windows.Forms.ImageList(); this.takeDepositsButton = new System.Windows.Forms.Button(); this.cmplntsButton = new System.Windows.Forms.Button(); this.checkInButton = new System.Windows.Forms.Button(); this.checkOutButton = new System.Windows.Forms.Button(); this.groupBox3 = new System.Windows.Forms.GroupBox(); this.srvcTypeTextBox = new System.Windows.Forms.TextBox(); this.endDteButton = new System.Windows.Forms.Button(); this.strtDteButton = new System.Windows.Forms.Button(); this.endDteTextBox = new System.Windows.Forms.TextBox(); this.strtDteTextBox = new System.Windows.Forms.TextBox(); this.label78 = new System.Windows.Forms.Label(); this.label79 = new System.Windows.Forms.Label(); this.noOfAdultsNumUpDwn = new System.Windows.Forms.NumericUpDown(); this.label6 = new System.Windows.Forms.Label(); this.roomNumTextBox = new System.Windows.Forms.TextBox(); this.fcltyTypeComboBox = new System.Windows.Forms.ComboBox(); this.label14 = new System.Windows.Forms.Label(); this.noOfChdrnNumUpDwn = new System.Windows.Forms.NumericUpDown(); this.label10 = new System.Windows.Forms.Label(); this.roomNumButton = new System.Windows.Forms.Button(); this.label7 = new System.Windows.Forms.Label(); this.docTypeComboBox = new System.Windows.Forms.ComboBox(); this.label15 = new System.Windows.Forms.Label(); this.docIDPrfxComboBox = new System.Windows.Forms.ComboBox(); this.docIDNumTextBox = new System.Windows.Forms.TextBox(); this.label16 = new System.Windows.Forms.Label(); this.docIDTextBox = new System.Windows.Forms.TextBox(); this.roomIDTextBox = new System.Windows.Forms.TextBox(); this.srvcTypeIDTextBox = new System.Windows.Forms.TextBox(); this.label3 = new System.Windows.Forms.Label(); this.attnRegisterButton = new System.Windows.Forms.Button(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.pymntTermsButton = new System.Windows.Forms.Button(); this.pymntTermsTextBox = new System.Windows.Forms.TextBox(); this.exchRateLabel = new System.Windows.Forms.Label(); this.exchRateNumUpDwn = new System.Windows.Forms.NumericUpDown(); this.docStatusTextBox = new System.Windows.Forms.TextBox(); this.pymntMthdButton = new System.Windows.Forms.Button(); this.pymntMthdTextBox = new System.Windows.Forms.TextBox(); this.label5 = new System.Windows.Forms.Label(); this.createdByTextBox = new System.Windows.Forms.TextBox(); this.label4 = new System.Windows.Forms.Label(); this.pymntMthdIDTextBox = new System.Windows.Forms.TextBox(); this.invcCurrButton = new System.Windows.Forms.Button(); this.invcCurrTextBox = new System.Windows.Forms.TextBox(); this.label19 = new System.Windows.Forms.Label(); this.invcCurrIDTextBox = new System.Windows.Forms.TextBox(); this.sponseeNmTextBox = new System.Windows.Forms.TextBox(); this.sponsorNmTextBox = new System.Windows.Forms.TextBox(); this.sponsorIDTextBox = new System.Windows.Forms.TextBox(); this.sponsorSiteIDTextBox = new System.Windows.Forms.TextBox(); this.label8 = new System.Windows.Forms.Label(); this.prcdngToTextBox = new System.Windows.Forms.TextBox(); this.arrvlFromTextBox = new System.Windows.Forms.TextBox(); this.label11 = new System.Windows.Forms.Label(); this.sponsorButton = new System.Windows.Forms.Button(); this.label9 = new System.Windows.Forms.Label(); this.sponseeButton = new System.Windows.Forms.Button(); this.sponseeIDTextBox = new System.Windows.Forms.TextBox(); this.label2 = new System.Windows.Forms.Label(); this.sponseeSiteIDTextBox = new System.Windows.Forms.TextBox(); this.label12 = new System.Windows.Forms.Label(); this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewButtonColumn1 = new System.Windows.Forms.DataGridViewButtonColumn(); this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewButtonColumn2 = new System.Windows.Forms.DataGridViewButtonColumn(); this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewButtonColumn3 = new System.Windows.Forms.DataGridViewButtonColumn(); this.dataGridViewTextBoxColumn9 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn10 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn11 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn12 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewButtonColumn4 = new System.Windows.Forms.DataGridViewButtonColumn(); this.dataGridViewTextBoxColumn13 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn14 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn15 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn16 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn17 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn18 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewButtonColumn5 = new System.Windows.Forms.DataGridViewButtonColumn(); this.dataGridViewTextBoxColumn19 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn20 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewButtonColumn6 = new System.Windows.Forms.DataGridViewButtonColumn(); this.dataGridViewTextBoxColumn21 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn22 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewButtonColumn7 = new System.Windows.Forms.DataGridViewButtonColumn(); this.dataGridViewTextBoxColumn23 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn24 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn25 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewButtonColumn8 = new System.Windows.Forms.DataGridViewButtonColumn(); this.dataGridViewTextBoxColumn26 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewButtonColumn9 = new System.Windows.Forms.DataGridViewButtonColumn(); this.dataGridViewTextBoxColumn27 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn28 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewButtonColumn10 = new System.Windows.Forms.DataGridViewButtonColumn(); this.dataGridViewTextBoxColumn29 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn30 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn31 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn32 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewButtonColumn11 = new System.Windows.Forms.DataGridViewButtonColumn(); this.dataGridViewTextBoxColumn33 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn34 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn35 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn36 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn37 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn38 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewButtonColumn12 = new System.Windows.Forms.DataGridViewButtonColumn(); this.dataGridViewTextBoxColumn39 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn40 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewButtonColumn13 = new System.Windows.Forms.DataGridViewButtonColumn(); this.dataGridViewTextBoxColumn41 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn42 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewButtonColumn14 = new System.Windows.Forms.DataGridViewButtonColumn(); this.dataGridViewTextBoxColumn43 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn44 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn45 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewButtonColumn15 = new System.Windows.Forms.DataGridViewButtonColumn(); this.dataGridViewTextBoxColumn46 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewButtonColumn16 = new System.Windows.Forms.DataGridViewButtonColumn(); this.dataGridViewTextBoxColumn47 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn48 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewButtonColumn17 = new System.Windows.Forms.DataGridViewButtonColumn(); this.dataGridViewTextBoxColumn49 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn50 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn51 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn52 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewButtonColumn18 = new System.Windows.Forms.DataGridViewButtonColumn(); this.dataGridViewTextBoxColumn53 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn54 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn55 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn56 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn57 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn58 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewButtonColumn19 = new System.Windows.Forms.DataGridViewButtonColumn(); this.dataGridViewTextBoxColumn59 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn60 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewButtonColumn20 = new System.Windows.Forms.DataGridViewButtonColumn(); this.dataGridViewTextBoxColumn61 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn62 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewButtonColumn21 = new System.Windows.Forms.DataGridViewButtonColumn(); this.dataGridViewTextBoxColumn63 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn64 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.backgroundWorker2 = new System.ComponentModel.BackgroundWorker(); this.printDialog1 = new System.Windows.Forms.PrintDialog(); this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker(); this.timer1 = new System.Windows.Forms.Timer(); this.printDocument1 = new System.Drawing.Printing.PrintDocument(); this.printPreviewDialog1 = new System.Windows.Forms.PrintPreviewDialog(); this.timer2 = new System.Windows.Forms.Timer(); this.printDocument2 = new System.Drawing.Printing.PrintDocument(); this.panel1.SuspendLayout(); this.groupBox4.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.smmryDataGridView)).BeginInit(); this.smmryContextMenuStrip.SuspendLayout(); this.toolStrip3.SuspendLayout(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.itemsDataGridView)).BeginInit(); this.docDtContextMenuStrip.SuspendLayout(); this.toolStrip2.SuspendLayout(); this.toolStrip1.SuspendLayout(); this.groupBox5.SuspendLayout(); this.docContextMenuStrip.SuspendLayout(); this.groupBox6.SuspendLayout(); this.groupBox7.SuspendLayout(); this.groupBox3.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.noOfAdultsNumUpDwn)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.noOfChdrnNumUpDwn)).BeginInit(); this.groupBox2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.exchRateNumUpDwn)).BeginInit(); this.SuspendLayout(); // // panel1 // this.panel1.AutoScroll = true; this.panel1.BackColor = System.Drawing.Color.Transparent; this.panel1.Controls.Add(this.saveLabel); this.panel1.Controls.Add(this.groupBox4); this.panel1.Controls.Add(this.groupBox1); this.panel1.Controls.Add(this.toolStrip1); this.panel1.Controls.Add(this.groupBox8); this.panel1.Controls.Add(this.groupBox5); this.panel1.Controls.Add(this.groupBox6); this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; this.panel1.Location = new System.Drawing.Point(0, 0); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(1133, 634); this.panel1.TabIndex = 0; // // saveLabel // this.saveLabel.BackColor = System.Drawing.Color.Green; this.saveLabel.Font = new System.Drawing.Font("Times New Roman", 18F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.saveLabel.ForeColor = System.Drawing.Color.White; this.saveLabel.Location = new System.Drawing.Point(113, 233); this.saveLabel.Name = "saveLabel"; this.saveLabel.Size = new System.Drawing.Size(906, 28); this.saveLabel.TabIndex = 7; this.saveLabel.Text = "VALIDATING && APPROVING DOCUMENT....PLEASE WAIT...."; this.saveLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.saveLabel.Visible = false; // // groupBox4 // this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Right))); this.groupBox4.Controls.Add(this.smmryDataGridView); this.groupBox4.Controls.Add(this.toolStrip3); this.groupBox4.Controls.Add(this.autoBalscheckBox); this.groupBox4.ForeColor = System.Drawing.Color.White; this.groupBox4.Location = new System.Drawing.Point(885, 248); this.groupBox4.MinimumSize = new System.Drawing.Size(244, 202); this.groupBox4.Name = "groupBox4"; this.groupBox4.Size = new System.Drawing.Size(244, 292); this.groupBox4.TabIndex = 4; this.groupBox4.TabStop = false; this.groupBox4.Text = "AMOUNT SUMMARY"; // // smmryDataGridView // this.smmryDataGridView.AllowUserToAddRows = false; this.smmryDataGridView.AllowUserToDeleteRows = false; this.smmryDataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.smmryDataGridView.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells; this.smmryDataGridView.BackgroundColor = System.Drawing.Color.White; this.smmryDataGridView.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.smmryDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.dataGridViewTextBoxColumn1, this.dataGridViewTextBoxColumn6, this.Column10, this.dataGridViewTextBoxColumn2, this.dataGridViewCheckBoxColumn1, this.dataGridViewTextBoxColumn3}); this.smmryDataGridView.ContextMenuStrip = this.smmryContextMenuStrip; dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; dataGridViewCellStyle4.BackColor = System.Drawing.Color.Gainsboro; dataGridViewCellStyle4.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); dataGridViewCellStyle4.ForeColor = System.Drawing.Color.White; dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight; dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText; dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.smmryDataGridView.DefaultCellStyle = dataGridViewCellStyle4; this.smmryDataGridView.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter; this.smmryDataGridView.Location = new System.Drawing.Point(3, 46); this.smmryDataGridView.Name = "smmryDataGridView"; this.smmryDataGridView.ReadOnly = true; this.smmryDataGridView.RowHeadersWidth = 21; this.smmryDataGridView.Size = new System.Drawing.Size(235, 240); this.smmryDataGridView.TabIndex = 1; // // dataGridViewTextBoxColumn1 // dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle1.BackColor = System.Drawing.Color.Gainsboro; dataGridViewCellStyle1.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.dataGridViewTextBoxColumn1.DefaultCellStyle = dataGridViewCellStyle1; this.dataGridViewTextBoxColumn1.HeaderText = "Summary Item"; this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1"; this.dataGridViewTextBoxColumn1.ReadOnly = true; this.dataGridViewTextBoxColumn1.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn1.Width = 120; // // dataGridViewTextBoxColumn6 // dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle2.BackColor = System.Drawing.Color.Gainsboro; dataGridViewCellStyle2.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.dataGridViewTextBoxColumn6.DefaultCellStyle = dataGridViewCellStyle2; this.dataGridViewTextBoxColumn6.HeaderText = "Total Amount"; this.dataGridViewTextBoxColumn6.MaxInputLength = 21; this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6"; this.dataGridViewTextBoxColumn6.ReadOnly = true; this.dataGridViewTextBoxColumn6.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn6.Width = 90; // // Column10 // this.Column10.HeaderText = "summary_itm_id"; this.Column10.Name = "Column10"; this.Column10.ReadOnly = true; this.Column10.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.Column10.Visible = false; // // dataGridViewTextBoxColumn2 // this.dataGridViewTextBoxColumn2.HeaderText = "code_behind_id"; this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2"; this.dataGridViewTextBoxColumn2.ReadOnly = true; this.dataGridViewTextBoxColumn2.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn2.Visible = false; // // dataGridViewCheckBoxColumn1 // dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; dataGridViewCellStyle3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128))))); dataGridViewCellStyle3.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle3.NullValue = false; dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.dataGridViewCheckBoxColumn1.DefaultCellStyle = dataGridViewCellStyle3; this.dataGridViewCheckBoxColumn1.HeaderText = "Auto Calc"; this.dataGridViewCheckBoxColumn1.Name = "dataGridViewCheckBoxColumn1"; this.dataGridViewCheckBoxColumn1.ReadOnly = true; this.dataGridViewCheckBoxColumn1.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.dataGridViewCheckBoxColumn1.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewCheckBoxColumn1.Visible = false; this.dataGridViewCheckBoxColumn1.Width = 35; // // dataGridViewTextBoxColumn3 // this.dataGridViewTextBoxColumn3.HeaderText = "itm_type"; this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3"; this.dataGridViewTextBoxColumn3.ReadOnly = true; this.dataGridViewTextBoxColumn3.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn3.Visible = false; // // smmryContextMenuStrip // this.smmryContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.exptExSmryMenuItem, this.rfrshSmryMenuItem, this.vwSQLSmryMenuItem, this.rcHstrySmryMenuItem}); this.smmryContextMenuStrip.Name = "usersContextMenuStrip"; this.smmryContextMenuStrip.Size = new System.Drawing.Size(153, 92); // // exptExSmryMenuItem // this.exptExSmryMenuItem.Image = global::EventsAndAttendance.Properties.Resources.image007; this.exptExSmryMenuItem.Name = "exptExSmryMenuItem"; this.exptExSmryMenuItem.Size = new System.Drawing.Size(152, 22); this.exptExSmryMenuItem.Text = "Export to Excel"; this.exptExSmryMenuItem.Click += new System.EventHandler(this.exptExSmryMenuItem_Click); // // rfrshSmryMenuItem // this.rfrshSmryMenuItem.Image = global::EventsAndAttendance.Properties.Resources.refresh; this.rfrshSmryMenuItem.Name = "rfrshSmryMenuItem"; this.rfrshSmryMenuItem.Size = new System.Drawing.Size(152, 22); this.rfrshSmryMenuItem.Text = "&Refresh"; this.rfrshSmryMenuItem.Click += new System.EventHandler(this.rfrshSmryMenuItem_Click); // // vwSQLSmryMenuItem // this.vwSQLSmryMenuItem.Image = global::EventsAndAttendance.Properties.Resources.sql_icon; this.vwSQLSmryMenuItem.Name = "vwSQLSmryMenuItem"; this.vwSQLSmryMenuItem.Size = new System.Drawing.Size(152, 22); this.vwSQLSmryMenuItem.Text = "&View SQL"; this.vwSQLSmryMenuItem.Click += new System.EventHandler(this.vwSQLSmryMenuItem_Click); // // rcHstrySmryMenuItem // this.rcHstrySmryMenuItem.Image = global::EventsAndAttendance.Properties.Resources.statistics_32; this.rcHstrySmryMenuItem.Name = "rcHstrySmryMenuItem"; this.rcHstrySmryMenuItem.Size = new System.Drawing.Size(152, 22); this.rcHstrySmryMenuItem.Text = "Record History"; this.rcHstrySmryMenuItem.Click += new System.EventHandler(this.rcHstrySmryMenuItem_Click); // // toolStrip3 // this.toolStrip3.BackColor = System.Drawing.Color.WhiteSmoke; this.toolStrip3.Dock = System.Windows.Forms.DockStyle.None; this.toolStrip3.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.calcSmryButton, this.toolStripSeparator18, this.delSmryButton, this.printPrvwRcptButton, this.printRcptButton1, this.printRcptButton, this.vwSmrySQLButton, this.rcHstrySmryButton, this.toolStripSeparator16, this.addChrgButton}); this.toolStrip3.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow; this.toolStrip3.Location = new System.Drawing.Point(5, 17); this.toolStrip3.Margin = new System.Windows.Forms.Padding(3); this.toolStrip3.Name = "toolStrip3"; this.toolStrip3.Size = new System.Drawing.Size(156, 25); this.toolStrip3.Stretch = true; this.toolStrip3.TabIndex = 0; this.toolStrip3.TabStop = true; this.toolStrip3.Text = "ToolStrip2"; // // calcSmryButton // this.calcSmryButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.calcSmryButton.ForeColor = System.Drawing.Color.Black; this.calcSmryButton.Image = global::EventsAndAttendance.Properties.Resources.refresh; this.calcSmryButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.calcSmryButton.Name = "calcSmryButton"; this.calcSmryButton.Size = new System.Drawing.Size(23, 22); this.calcSmryButton.Text = "Calc"; this.calcSmryButton.Click += new System.EventHandler(this.calcSmryButton_Click); // // toolStripSeparator18 // this.toolStripSeparator18.Name = "toolStripSeparator18"; this.toolStripSeparator18.Size = new System.Drawing.Size(6, 25); // // delSmryButton // this.delSmryButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.delSmryButton.ForeColor = System.Drawing.Color.Black; this.delSmryButton.Image = global::EventsAndAttendance.Properties.Resources.delete; this.delSmryButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.delSmryButton.Name = "delSmryButton"; this.delSmryButton.Size = new System.Drawing.Size(23, 22); this.delSmryButton.Text = "Delete Row"; this.delSmryButton.Click += new System.EventHandler(this.delSmryButton_Click); // // printPrvwRcptButton // this.printPrvwRcptButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.printPrvwRcptButton.Image = global::EventsAndAttendance.Properties.Resources.actions_document_preview; this.printPrvwRcptButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.printPrvwRcptButton.Name = "printPrvwRcptButton"; this.printPrvwRcptButton.Size = new System.Drawing.Size(23, 22); this.printPrvwRcptButton.Text = "Print Preview"; this.printPrvwRcptButton.Click += new System.EventHandler(this.printPrvwRcptButton_Click); // // printRcptButton1 // this.printRcptButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.printRcptButton1.Image = global::EventsAndAttendance.Properties.Resources.print_64; this.printRcptButton1.ImageTransparentColor = System.Drawing.Color.Magenta; this.printRcptButton1.Name = "printRcptButton1"; this.printRcptButton1.Size = new System.Drawing.Size(23, 22); this.printRcptButton1.Text = "Print"; this.printRcptButton1.Visible = false; this.printRcptButton1.Click += new System.EventHandler(this.printRcptButton_Click); // // printRcptButton // this.printRcptButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.printRcptButton.Image = global::EventsAndAttendance.Properties.Resources.print_64; this.printRcptButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.printRcptButton.Name = "printRcptButton"; this.printRcptButton.Size = new System.Drawing.Size(23, 22); this.printRcptButton.Text = "Print"; this.printRcptButton.Click += new System.EventHandler(this.printRcptButton_Click); // // vwSmrySQLButton // this.vwSmrySQLButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.vwSmrySQLButton.ForeColor = System.Drawing.Color.Black; this.vwSmrySQLButton.Image = global::EventsAndAttendance.Properties.Resources.sql_icon; this.vwSmrySQLButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.vwSmrySQLButton.Name = "vwSmrySQLButton"; this.vwSmrySQLButton.Size = new System.Drawing.Size(23, 22); this.vwSmrySQLButton.Text = "View SQL"; this.vwSmrySQLButton.Click += new System.EventHandler(this.vwSmrySQLButton_Click); // // rcHstrySmryButton // this.rcHstrySmryButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.rcHstrySmryButton.ForeColor = System.Drawing.Color.Black; this.rcHstrySmryButton.Image = global::EventsAndAttendance.Properties.Resources.statistics_32; this.rcHstrySmryButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.rcHstrySmryButton.Name = "rcHstrySmryButton"; this.rcHstrySmryButton.Size = new System.Drawing.Size(23, 22); this.rcHstrySmryButton.Text = "Record History"; this.rcHstrySmryButton.Click += new System.EventHandler(this.rcHstrySmryButton_Click); // // toolStripSeparator16 // this.toolStripSeparator16.Name = "toolStripSeparator16"; this.toolStripSeparator16.Size = new System.Drawing.Size(6, 25); this.toolStripSeparator16.Visible = false; // // addChrgButton // this.addChrgButton.ForeColor = System.Drawing.Color.Black; this.addChrgButton.Image = global::EventsAndAttendance.Properties.Resources.plus_32; this.addChrgButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.addChrgButton.Name = "addChrgButton"; this.addChrgButton.Size = new System.Drawing.Size(79, 22); this.addChrgButton.Text = "Auto-Bals"; this.addChrgButton.ToolTipText = "Auto Charge Difference"; this.addChrgButton.Visible = false; this.addChrgButton.Click += new System.EventHandler(this.addChrgButton_Click); // // autoBalscheckBox // this.autoBalscheckBox.AutoSize = true; this.autoBalscheckBox.Location = new System.Drawing.Point(167, 21); this.autoBalscheckBox.Name = "autoBalscheckBox"; this.autoBalscheckBox.Size = new System.Drawing.Size(71, 17); this.autoBalscheckBox.TabIndex = 2; this.autoBalscheckBox.Text = "Auto Bals"; this.autoBalscheckBox.UseVisualStyleBackColor = true; this.autoBalscheckBox.CheckedChanged += new System.EventHandler(this.autoBalscheckBox_CheckedChanged); // // groupBox1 // this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.groupBox1.Controls.Add(this.itemsDataGridView); this.groupBox1.Controls.Add(this.dteTextBox1); this.groupBox1.Controls.Add(this.salesDocNumTextBox); this.groupBox1.Controls.Add(this.salesApprvlStatusTextBox); this.groupBox1.Controls.Add(this.salesDocTypeTextBox); this.groupBox1.Controls.Add(this.toolStrip2); this.groupBox1.Controls.Add(this.label1); this.groupBox1.Controls.Add(this.salesDocIDTextBox); this.groupBox1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.groupBox1.ForeColor = System.Drawing.Color.White; this.groupBox1.Location = new System.Drawing.Point(215, 248); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(667, 383); this.groupBox1.TabIndex = 3; this.groupBox1.TabStop = false; this.groupBox1.Text = "REQUESTED SERVICES (BILLS && CHARGES)"; // // itemsDataGridView // this.itemsDataGridView.AllowUserToAddRows = false; this.itemsDataGridView.AllowUserToDeleteRows = false; this.itemsDataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.itemsDataGridView.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells; this.itemsDataGridView.BackgroundColor = System.Drawing.Color.White; this.itemsDataGridView.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.itemsDataGridView.ColumnHeadersHeight = 60; this.itemsDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.Column2, this.Column19, this.Column6, this.Column23, this.Column4, this.Column27, this.Column28, this.Column5, this.Column3, this.Column1, this.Column25, this.Column26, this.Column8, this.Column20, this.Column9, this.Column17, this.Column18, this.Column11, this.Column7, this.Column14, this.Column12, this.Column22, this.Column15, this.Column13, this.Column21, this.Column16, this.Column24, this.Column29, this.Column30, this.Column31}); this.itemsDataGridView.ContextMenuStrip = this.docDtContextMenuStrip; dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle15.BackColor = System.Drawing.SystemColors.Window; dataGridViewCellStyle15.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); dataGridViewCellStyle15.ForeColor = System.Drawing.Color.White; dataGridViewCellStyle15.SelectionBackColor = System.Drawing.SystemColors.Highlight; dataGridViewCellStyle15.SelectionForeColor = System.Drawing.SystemColors.HighlightText; dataGridViewCellStyle15.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.itemsDataGridView.DefaultCellStyle = dataGridViewCellStyle15; this.itemsDataGridView.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter; this.itemsDataGridView.Location = new System.Drawing.Point(3, 46); this.itemsDataGridView.MultiSelect = false; this.itemsDataGridView.Name = "itemsDataGridView"; this.itemsDataGridView.RowHeadersWidth = 21; this.itemsDataGridView.Size = new System.Drawing.Size(661, 334); this.itemsDataGridView.TabIndex = 1; this.itemsDataGridView.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.itemsDataGridView_CellContentClick); this.itemsDataGridView.CellEnter += new System.Windows.Forms.DataGridViewCellEventHandler(this.itemsDataGridView_CellEnter); this.itemsDataGridView.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.itemsDataGridView_CellValueChanged); this.itemsDataGridView.CurrentCellChanged += new System.EventHandler(this.itemsDataGridView_CurrentCellChanged); this.itemsDataGridView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.itemsDataGridView_KeyDown); // // Column2 // dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128))))); dataGridViewCellStyle5.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.Column2.DefaultCellStyle = dataGridViewCellStyle5; this.Column2.Frozen = true; this.Column2.HeaderText = "Item Code"; this.Column2.Name = "Column2"; this.Column2.ReadOnly = true; this.Column2.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.Column2.Width = 65; // // Column19 // this.Column19.Frozen = true; this.Column19.HeaderText = "..."; this.Column19.Name = "Column19"; this.Column19.Text = "..."; this.Column19.Width = 25; // // Column6 // dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle6.BackColor = System.Drawing.Color.Gainsboro; dataGridViewCellStyle6.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.Column6.DefaultCellStyle = dataGridViewCellStyle6; this.Column6.Frozen = true; this.Column6.HeaderText = "Item Description"; this.Column6.Name = "Column6"; this.Column6.ReadOnly = true; this.Column6.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; // // Column23 // this.Column23.Frozen = true; this.Column23.HeaderText = "..."; this.Column23.Name = "Column23"; this.Column23.Width = 25; // // Column4 // dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; dataGridViewCellStyle7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128))))); dataGridViewCellStyle7.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle7.NullValue = "0"; dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.Column4.DefaultCellStyle = dataGridViewCellStyle7; this.Column4.Frozen = true; this.Column4.HeaderText = "Qty"; this.Column4.Name = "Column4"; this.Column4.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.Column4.Width = 40; // // Column27 // dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.Column27.DefaultCellStyle = dataGridViewCellStyle8; this.Column27.Frozen = true; this.Column27.HeaderText = "UOM"; this.Column27.Name = "Column27"; this.Column27.ReadOnly = true; this.Column27.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.Column27.Width = 50; // // Column28 // this.Column28.Frozen = true; this.Column28.HeaderText = "..."; this.Column28.Name = "Column28"; this.Column28.Width = 25; // // Column5 // dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; dataGridViewCellStyle9.BackColor = System.Drawing.Color.Gainsboro; dataGridViewCellStyle9.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); dataGridViewCellStyle9.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight; dataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText; dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.Column5.DefaultCellStyle = dataGridViewCellStyle9; this.Column5.Frozen = true; this.Column5.HeaderText = "Unit Price"; this.Column5.MaxInputLength = 500; this.Column5.Name = "Column5"; this.Column5.ReadOnly = true; this.Column5.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.Column5.Width = 50; // // Column3 // dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; dataGridViewCellStyle10.BackColor = System.Drawing.Color.Gainsboro; dataGridViewCellStyle10.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.Column3.DefaultCellStyle = dataGridViewCellStyle10; this.Column3.DividerWidth = 3; this.Column3.Frozen = true; this.Column3.HeaderText = "Amount"; this.Column3.MaxInputLength = 21; this.Column3.Name = "Column3"; this.Column3.ReadOnly = true; this.Column3.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.Column3.Width = 65; // // Column1 // this.Column1.HeaderText = "Avlbl. Source Doc. Qty"; this.Column1.Name = "Column1"; this.Column1.ReadOnly = true; this.Column1.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.Column1.Visible = false; this.Column1.Width = 50; // // Column25 // dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle11.BackColor = System.Drawing.Color.Gainsboro; dataGridViewCellStyle11.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle11.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.Column25.DefaultCellStyle = dataGridViewCellStyle11; this.Column25.HeaderText = "Consignment Nos."; this.Column25.Name = "Column25"; this.Column25.ReadOnly = true; this.Column25.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.Column25.Visible = false; this.Column25.Width = 75; // // Column26 // this.Column26.HeaderText = "..."; this.Column26.Name = "Column26"; this.Column26.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.Column26.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.Column26.Visible = false; this.Column26.Width = 25; // // Column8 // dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; dataGridViewCellStyle12.BackColor = System.Drawing.Color.WhiteSmoke; dataGridViewCellStyle12.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.Column8.DefaultCellStyle = dataGridViewCellStyle12; this.Column8.HeaderText = "itm_id"; this.Column8.Name = "Column8"; this.Column8.ReadOnly = true; this.Column8.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.Column8.Visible = false; // // Column20 // this.Column20.HeaderText = "Store_id"; this.Column20.Name = "Column20"; this.Column20.ReadOnly = true; this.Column20.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.Column20.Visible = false; // // Column9 // dataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; dataGridViewCellStyle13.BackColor = System.Drawing.Color.WhiteSmoke; dataGridViewCellStyle13.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle13.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.Column9.DefaultCellStyle = dataGridViewCellStyle13; this.Column9.HeaderText = "crncyid"; this.Column9.Name = "Column9"; this.Column9.ReadOnly = true; this.Column9.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.Column9.Visible = false; // // Column17 // this.Column17.HeaderText = "line_id"; this.Column17.Name = "Column17"; this.Column17.ReadOnly = true; this.Column17.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.Column17.Visible = false; // // Column18 // this.Column18.HeaderText = "src_line_id"; this.Column18.Name = "Column18"; this.Column18.ReadOnly = true; this.Column18.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.Column18.Visible = false; // // Column11 // this.Column11.HeaderText = "Tax Code"; this.Column11.Name = "Column11"; this.Column11.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.Column11.Visible = false; this.Column11.Width = 50; // // Column7 // this.Column7.HeaderText = "..."; this.Column7.Name = "Column7"; this.Column7.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.Column7.Text = "..."; this.Column7.Visible = false; this.Column7.Width = 25; // // Column14 // this.Column14.HeaderText = "taxCodeID"; this.Column14.Name = "Column14"; this.Column14.ReadOnly = true; this.Column14.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.Column14.Visible = false; // // Column12 // this.Column12.HeaderText = "Discount Code"; this.Column12.Name = "Column12"; this.Column12.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.Column12.Width = 50; // // Column22 // this.Column22.HeaderText = "..."; this.Column22.Name = "Column22"; this.Column22.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.Column22.Text = "..."; this.Column22.Width = 25; // // Column15 // this.Column15.HeaderText = "dscntID"; this.Column15.Name = "Column15"; this.Column15.ReadOnly = true; this.Column15.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.Column15.Visible = false; // // Column13 // this.Column13.HeaderText = "Extra Charge Code"; this.Column13.Name = "Column13"; this.Column13.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.Column13.Visible = false; this.Column13.Width = 55; // // Column21 // this.Column21.HeaderText = "..."; this.Column21.Name = "Column21"; this.Column21.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.Column21.Text = "..."; this.Column21.Visible = false; this.Column21.Width = 25; // // Column16 // this.Column16.HeaderText = "chargeID"; this.Column16.Name = "Column16"; this.Column16.ReadOnly = true; this.Column16.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.Column16.Visible = false; // // Column24 // dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle14.BackColor = System.Drawing.Color.Gainsboro; dataGridViewCellStyle14.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.Column24.DefaultCellStyle = dataGridViewCellStyle14; this.Column24.HeaderText = "Return Reason"; this.Column24.Name = "Column24"; this.Column24.ReadOnly = true; this.Column24.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.Column24.Visible = false; this.Column24.Width = 300; // // Column29 // this.Column29.HeaderText = "Given Out"; this.Column29.Name = "Column29"; this.Column29.Width = 40; // // Column30 // this.Column30.HeaderText = "Transaction Date / Extra Description"; this.Column30.Name = "Column30"; this.Column30.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.Column30.Width = 150; // // Column31 // this.Column31.HeaderText = "Other Module ID"; this.Column31.Name = "Column31"; this.Column31.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.Column31.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.Column31.Visible = false; this.Column31.Width = 25; // // docDtContextMenuStrip // this.docDtContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.addDtMenuItem, this.delDtMenuItem, this.toolStripSeparator9, this.vwExtraInfoMenuItem, this.toolStripSeparator10, this.exptExDtMenuItem, this.rfrshDtMenuItem, this.vwSQLDtMenuItem, this.rcHstryDtMenuItem}); this.docDtContextMenuStrip.Name = "usersContextMenuStrip"; this.docDtContextMenuStrip.Size = new System.Drawing.Size(194, 170); // // addDtMenuItem // this.addDtMenuItem.Image = global::EventsAndAttendance.Properties.Resources.plus_32; this.addDtMenuItem.Name = "addDtMenuItem"; this.addDtMenuItem.Size = new System.Drawing.Size(193, 22); this.addDtMenuItem.Text = "NEW LINE"; this.addDtMenuItem.Click += new System.EventHandler(this.addDtMenuItem_Click); // // delDtMenuItem // this.delDtMenuItem.Image = global::EventsAndAttendance.Properties.Resources.delete; this.delDtMenuItem.Name = "delDtMenuItem"; this.delDtMenuItem.Size = new System.Drawing.Size(193, 22); this.delDtMenuItem.Text = "DELETE"; this.delDtMenuItem.Click += new System.EventHandler(this.delDtMenuItem_Click); // // toolStripSeparator9 // this.toolStripSeparator9.Name = "toolStripSeparator9"; this.toolStripSeparator9.Size = new System.Drawing.Size(190, 6); // // vwExtraInfoMenuItem // this.vwExtraInfoMenuItem.Image = global::EventsAndAttendance.Properties.Resources.Information; this.vwExtraInfoMenuItem.Name = "vwExtraInfoMenuItem"; this.vwExtraInfoMenuItem.Size = new System.Drawing.Size(193, 22); this.vwExtraInfoMenuItem.Text = "View Extra Information"; this.vwExtraInfoMenuItem.Click += new System.EventHandler(this.vwExtraInfoMenuItem_Click_1); // // toolStripSeparator10 // this.toolStripSeparator10.Name = "toolStripSeparator10"; this.toolStripSeparator10.Size = new System.Drawing.Size(190, 6); // // exptExDtMenuItem // this.exptExDtMenuItem.Image = global::EventsAndAttendance.Properties.Resources.image007; this.exptExDtMenuItem.Name = "exptExDtMenuItem"; this.exptExDtMenuItem.Size = new System.Drawing.Size(193, 22); this.exptExDtMenuItem.Text = "Export to Excel"; this.exptExDtMenuItem.Click += new System.EventHandler(this.exptExDtMenuItem_Click); // // rfrshDtMenuItem // this.rfrshDtMenuItem.Image = global::EventsAndAttendance.Properties.Resources.refresh; this.rfrshDtMenuItem.Name = "rfrshDtMenuItem"; this.rfrshDtMenuItem.Size = new System.Drawing.Size(193, 22); this.rfrshDtMenuItem.Text = "&Refresh"; this.rfrshDtMenuItem.Click += new System.EventHandler(this.rfrshDtMenuItem_Click); // // vwSQLDtMenuItem // this.vwSQLDtMenuItem.Image = global::EventsAndAttendance.Properties.Resources.sql_icon; this.vwSQLDtMenuItem.Name = "vwSQLDtMenuItem"; this.vwSQLDtMenuItem.Size = new System.Drawing.Size(193, 22); this.vwSQLDtMenuItem.Text = "&View SQL"; this.vwSQLDtMenuItem.Click += new System.EventHandler(this.vwSQLDtMenuItem_Click); // // rcHstryDtMenuItem // this.rcHstryDtMenuItem.Image = global::EventsAndAttendance.Properties.Resources.statistics_32; this.rcHstryDtMenuItem.Name = "rcHstryDtMenuItem"; this.rcHstryDtMenuItem.Size = new System.Drawing.Size(193, 22); this.rcHstryDtMenuItem.Text = "Record History"; this.rcHstryDtMenuItem.Click += new System.EventHandler(this.rcHstryDtMenuItem_Click); // // dteTextBox1 // this.dteTextBox1.Location = new System.Drawing.Point(283, 181); this.dteTextBox1.Name = "dteTextBox1"; this.dteTextBox1.Size = new System.Drawing.Size(100, 21); this.dteTextBox1.TabIndex = 206; // // salesDocNumTextBox // this.salesDocNumTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.salesDocNumTextBox.Location = new System.Drawing.Point(509, 23); this.salesDocNumTextBox.MaxLength = 200; this.salesDocNumTextBox.Name = "salesDocNumTextBox"; this.salesDocNumTextBox.Size = new System.Drawing.Size(155, 21); this.salesDocNumTextBox.TabIndex = 201; // // salesApprvlStatusTextBox // this.salesApprvlStatusTextBox.Location = new System.Drawing.Point(563, 23); this.salesApprvlStatusTextBox.MaxLength = 200; this.salesApprvlStatusTextBox.Name = "salesApprvlStatusTextBox"; this.salesApprvlStatusTextBox.ReadOnly = true; this.salesApprvlStatusTextBox.Size = new System.Drawing.Size(47, 21); this.salesApprvlStatusTextBox.TabIndex = 205; this.salesApprvlStatusTextBox.TabStop = false; this.salesApprvlStatusTextBox.Text = "-1"; // // salesDocTypeTextBox // this.salesDocTypeTextBox.Location = new System.Drawing.Point(532, 23); this.salesDocTypeTextBox.MaxLength = 200; this.salesDocTypeTextBox.Name = "salesDocTypeTextBox"; this.salesDocTypeTextBox.ReadOnly = true; this.salesDocTypeTextBox.Size = new System.Drawing.Size(47, 21); this.salesDocTypeTextBox.TabIndex = 204; this.salesDocTypeTextBox.TabStop = false; this.salesDocTypeTextBox.Text = "-1"; // // toolStrip2 // this.toolStrip2.BackColor = System.Drawing.Color.WhiteSmoke; this.toolStrip2.Dock = System.Windows.Forms.DockStyle.None; this.toolStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.addDtButton, this.toolStripSeparator8, this.delDtButton, this.toolStripSeparator11, this.vwSQLDtButton, this.toolStripSeparator12, this.rcHstryDtButton, this.toolStripSeparator13, this.customInvoiceButton, this.toolStripSeparator15, this.rfrshDtButton, this.toolStripSeparator14, this.prvwInvoiceButton, this.printInvoiceButton, this.printInvcButton1, this.vwExtraInfoButton, this.vwAttchmntsButton, this.dscntButton}); this.toolStrip2.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow; this.toolStrip2.Location = new System.Drawing.Point(4, 17); this.toolStrip2.Margin = new System.Windows.Forms.Padding(3); this.toolStrip2.Name = "toolStrip2"; this.toolStrip2.Size = new System.Drawing.Size(500, 25); this.toolStrip2.Stretch = true; this.toolStrip2.TabIndex = 0; this.toolStrip2.TabStop = true; this.toolStrip2.Text = "ToolStrip2"; // // addDtButton // this.addDtButton.ForeColor = System.Drawing.Color.Black; this.addDtButton.Image = global::EventsAndAttendance.Properties.Resources.plus_32; this.addDtButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.addDtButton.Name = "addDtButton"; this.addDtButton.Size = new System.Drawing.Size(53, 22); this.addDtButton.Text = "NEW"; this.addDtButton.ToolTipText = "NEW LINE"; this.addDtButton.Click += new System.EventHandler(this.addDtButton_Click); // // toolStripSeparator8 // this.toolStripSeparator8.Name = "toolStripSeparator8"; this.toolStripSeparator8.Size = new System.Drawing.Size(6, 25); // // delDtButton // this.delDtButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.delDtButton.ForeColor = System.Drawing.Color.Black; this.delDtButton.Image = global::EventsAndAttendance.Properties.Resources.delete; this.delDtButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.delDtButton.Name = "delDtButton"; this.delDtButton.Size = new System.Drawing.Size(23, 22); this.delDtButton.Text = "DELETE"; this.delDtButton.Click += new System.EventHandler(this.delDtButton_Click); // // toolStripSeparator11 // this.toolStripSeparator11.Name = "toolStripSeparator11"; this.toolStripSeparator11.Size = new System.Drawing.Size(6, 25); // // vwSQLDtButton // this.vwSQLDtButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.vwSQLDtButton.ForeColor = System.Drawing.Color.Black; this.vwSQLDtButton.Image = global::EventsAndAttendance.Properties.Resources.sql_icon; this.vwSQLDtButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.vwSQLDtButton.Name = "vwSQLDtButton"; this.vwSQLDtButton.Size = new System.Drawing.Size(23, 22); this.vwSQLDtButton.Text = "View SQL"; this.vwSQLDtButton.Click += new System.EventHandler(this.vwSQLDtButton_Click); // // toolStripSeparator12 // this.toolStripSeparator12.Name = "toolStripSeparator12"; this.toolStripSeparator12.Size = new System.Drawing.Size(6, 25); // // rcHstryDtButton // this.rcHstryDtButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.rcHstryDtButton.ForeColor = System.Drawing.Color.Black; this.rcHstryDtButton.Image = global::EventsAndAttendance.Properties.Resources.statistics_32; this.rcHstryDtButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.rcHstryDtButton.Name = "rcHstryDtButton"; this.rcHstryDtButton.Size = new System.Drawing.Size(23, 22); this.rcHstryDtButton.Text = "Record History"; this.rcHstryDtButton.Click += new System.EventHandler(this.rcHstryDtButton_Click); // // toolStripSeparator13 // this.toolStripSeparator13.Name = "toolStripSeparator13"; this.toolStripSeparator13.Size = new System.Drawing.Size(6, 25); // // customInvoiceButton // this.customInvoiceButton.ForeColor = System.Drawing.Color.Black; this.customInvoiceButton.Image = global::EventsAndAttendance.Properties.Resources.actions_document_preview; this.customInvoiceButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.customInvoiceButton.Name = "customInvoiceButton"; this.customInvoiceButton.Size = new System.Drawing.Size(69, 22); this.customInvoiceButton.Text = "Custom"; this.customInvoiceButton.ToolTipText = "Custom Document Print Preview"; this.customInvoiceButton.Click += new System.EventHandler(this.customInvoiceButton_Click); // // toolStripSeparator15 // this.toolStripSeparator15.Name = "toolStripSeparator15"; this.toolStripSeparator15.Size = new System.Drawing.Size(6, 25); // // rfrshDtButton // this.rfrshDtButton.ForeColor = System.Drawing.Color.Black; this.rfrshDtButton.Image = global::EventsAndAttendance.Properties.Resources.refresh; this.rfrshDtButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.rfrshDtButton.Name = "rfrshDtButton"; this.rfrshDtButton.Size = new System.Drawing.Size(50, 22); this.rfrshDtButton.Text = "Calc"; this.rfrshDtButton.ToolTipText = "Calc Days"; this.rfrshDtButton.Click += new System.EventHandler(this.rfrshDtButton_Click); // // toolStripSeparator14 // this.toolStripSeparator14.Name = "toolStripSeparator14"; this.toolStripSeparator14.Size = new System.Drawing.Size(6, 25); // // prvwInvoiceButton // this.prvwInvoiceButton.ForeColor = System.Drawing.Color.Black; this.prvwInvoiceButton.Image = global::EventsAndAttendance.Properties.Resources.actions_document_preview; this.prvwInvoiceButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.prvwInvoiceButton.Name = "prvwInvoiceButton"; this.prvwInvoiceButton.Size = new System.Drawing.Size(68, 22); this.prvwInvoiceButton.Text = "Preview"; this.prvwInvoiceButton.Click += new System.EventHandler(this.prvwInvoiceButton_Click); // // printInvoiceButton // this.printInvoiceButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.printInvoiceButton.ForeColor = System.Drawing.Color.Black; this.printInvoiceButton.Image = global::EventsAndAttendance.Properties.Resources.print_64; this.printInvoiceButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.printInvoiceButton.Name = "printInvoiceButton"; this.printInvoiceButton.Size = new System.Drawing.Size(23, 22); this.printInvoiceButton.Text = "Print"; this.printInvoiceButton.Click += new System.EventHandler(this.printInvoiceButton_Click); // // printInvcButton1 // this.printInvcButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.printInvcButton1.ForeColor = System.Drawing.Color.Black; this.printInvcButton1.Image = global::EventsAndAttendance.Properties.Resources.print_64; this.printInvcButton1.ImageTransparentColor = System.Drawing.Color.Magenta; this.printInvcButton1.Name = "printInvcButton1"; this.printInvcButton1.Size = new System.Drawing.Size(23, 22); this.printInvcButton1.Text = "Print"; this.printInvcButton1.Visible = false; this.printInvcButton1.Click += new System.EventHandler(this.printInvoiceButton_Click); // // vwExtraInfoButton // this.vwExtraInfoButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.vwExtraInfoButton.Image = global::EventsAndAttendance.Properties.Resources.Information; this.vwExtraInfoButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.vwExtraInfoButton.Name = "vwExtraInfoButton"; this.vwExtraInfoButton.Size = new System.Drawing.Size(23, 22); this.vwExtraInfoButton.Text = "Extra Information"; this.vwExtraInfoButton.Click += new System.EventHandler(this.vwExtraInfoButton_Click); // // vwAttchmntsButton // this.vwAttchmntsButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.vwAttchmntsButton.Image = global::EventsAndAttendance.Properties.Resources.adjunto; this.vwAttchmntsButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.vwAttchmntsButton.Name = "vwAttchmntsButton"; this.vwAttchmntsButton.Size = new System.Drawing.Size(23, 22); this.vwAttchmntsButton.Text = "Attached Documents"; this.vwAttchmntsButton.Click += new System.EventHandler(this.vwAttchmntsButton_Click); // // dscntButton // this.dscntButton.ForeColor = System.Drawing.Color.Black; this.dscntButton.Image = global::EventsAndAttendance.Properties.Resources.plus_32; this.dscntButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.dscntButton.Name = "dscntButton"; this.dscntButton.Size = new System.Drawing.Size(74, 22); this.dscntButton.Text = "Discount"; this.dscntButton.ToolTipText = "DISCOUNT"; this.dscntButton.Click += new System.EventHandler(this.dscntButton_Click); // // label1 // this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label1.Location = new System.Drawing.Point(507, 9); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(87, 13); this.label1.TabIndex = 202; this.label1.Text = "Sales Doc. No.:"; // // salesDocIDTextBox // this.salesDocIDTextBox.Location = new System.Drawing.Point(591, 23); this.salesDocIDTextBox.MaxLength = 200; this.salesDocIDTextBox.Name = "salesDocIDTextBox"; this.salesDocIDTextBox.ReadOnly = true; this.salesDocIDTextBox.Size = new System.Drawing.Size(47, 21); this.salesDocIDTextBox.TabIndex = 203; this.salesDocIDTextBox.TabStop = false; this.salesDocIDTextBox.Text = "-1"; // // toolStrip1 // this.toolStrip1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.toolStrip1.AutoSize = false; this.toolStrip1.Dock = System.Windows.Forms.DockStyle.None; this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.addCheckInButton, this.addRsrvtnButton, this.editButton, this.deleteButton, this.saveButton, this.goButton, this.rcHstryButton, this.vwSQLButton, this.toolStripSeparator6, this.moveFirstButton, this.toolStripSeparator1, this.movePreviousButton, this.toolStripSeparator2, this.toolStripLabel1, this.positionTextBox, this.totalRecsLabel, this.toolStripSeparator3, this.moveNextButton, this.toolStripSeparator4, this.moveLastButton, this.toolStripSeparator5, this.dsplySizeComboBox, this.toolStripSeparator7, this.toolStripLabel3, this.searchForTextBox, this.toolStripLabel4, this.searchInComboBox, this.resetButton}); this.toolStrip1.Location = new System.Drawing.Point(0, 4); this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.Size = new System.Drawing.Size(1129, 25); this.toolStrip1.TabIndex = 0; this.toolStrip1.Text = "toolStrip1"; // // addCheckInButton // this.addCheckInButton.Image = global::EventsAndAttendance.Properties.Resources.plus_32; this.addCheckInButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.addCheckInButton.Name = "addCheckInButton"; this.addCheckInButton.Size = new System.Drawing.Size(111, 22); this.addCheckInButton.Text = "NEW CHECK-IN"; this.addCheckInButton.Click += new System.EventHandler(this.addCheckInButton_Click); // // addRsrvtnButton // this.addRsrvtnButton.Image = global::EventsAndAttendance.Properties.Resources.plus_32; this.addRsrvtnButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.addRsrvtnButton.Name = "addRsrvtnButton"; this.addRsrvtnButton.Size = new System.Drawing.Size(108, 22); this.addRsrvtnButton.Text = "NEW BOOKING"; this.addRsrvtnButton.Click += new System.EventHandler(this.addCheckInButton_Click); // // editButton // this.editButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.editButton.Image = global::EventsAndAttendance.Properties.Resources.edit32; this.editButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.editButton.Name = "editButton"; this.editButton.Size = new System.Drawing.Size(23, 22); this.editButton.Text = "EDIT"; this.editButton.Click += new System.EventHandler(this.editButton_Click); // // deleteButton // this.deleteButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.deleteButton.Image = global::EventsAndAttendance.Properties.Resources.delete; this.deleteButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.deleteButton.Name = "deleteButton"; this.deleteButton.Size = new System.Drawing.Size(23, 22); this.deleteButton.Text = "DELETE"; this.deleteButton.Click += new System.EventHandler(this.delButton_Click); // // saveButton // this.saveButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.saveButton.Image = global::EventsAndAttendance.Properties.Resources.FloppyDisk; this.saveButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.saveButton.Name = "saveButton"; this.saveButton.Size = new System.Drawing.Size(23, 22); this.saveButton.Text = "SAVE"; this.saveButton.Click += new System.EventHandler(this.saveButton_Click); // // goButton // this.goButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.goButton.Image = global::EventsAndAttendance.Properties.Resources.refresh; this.goButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.goButton.Name = "goButton"; this.goButton.Size = new System.Drawing.Size(23, 22); this.goButton.Text = "Go"; this.goButton.Click += new System.EventHandler(this.goButton_Click); // // rcHstryButton // this.rcHstryButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.rcHstryButton.Image = global::EventsAndAttendance.Properties.Resources.statistics_32; this.rcHstryButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.rcHstryButton.Name = "rcHstryButton"; this.rcHstryButton.Size = new System.Drawing.Size(23, 22); this.rcHstryButton.Text = "Record History"; this.rcHstryButton.Click += new System.EventHandler(this.rcHstryButton_Click); // // vwSQLButton // this.vwSQLButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.vwSQLButton.Image = global::EventsAndAttendance.Properties.Resources.sql_icon; this.vwSQLButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.vwSQLButton.Name = "vwSQLButton"; this.vwSQLButton.Size = new System.Drawing.Size(23, 22); this.vwSQLButton.Text = "View SQL"; this.vwSQLButton.Click += new System.EventHandler(this.vwSQLButton_Click); // // toolStripSeparator6 // this.toolStripSeparator6.Name = "toolStripSeparator6"; this.toolStripSeparator6.Size = new System.Drawing.Size(6, 25); // // moveFirstButton // this.moveFirstButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.moveFirstButton.Image = global::EventsAndAttendance.Properties.Resources.DataContainer_MoveFirstHS; this.moveFirstButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.moveFirstButton.Name = "moveFirstButton"; this.moveFirstButton.Size = new System.Drawing.Size(23, 22); this.moveFirstButton.Text = "First"; this.moveFirstButton.Click += new System.EventHandler(this.PnlNavButtons); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25); // // movePreviousButton // this.movePreviousButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.movePreviousButton.Image = global::EventsAndAttendance.Properties.Resources.DataContainer_MovePreviousHS; this.movePreviousButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.movePreviousButton.Name = "movePreviousButton"; this.movePreviousButton.Size = new System.Drawing.Size(23, 22); this.movePreviousButton.Text = "tsbPrevious"; this.movePreviousButton.ToolTipText = "Previous"; this.movePreviousButton.Click += new System.EventHandler(this.PnlNavButtons); // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25); // // toolStripLabel1 // this.toolStripLabel1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.toolStripLabel1.Name = "toolStripLabel1"; this.toolStripLabel1.Size = new System.Drawing.Size(50, 22); this.toolStripLabel1.Text = "Record "; // // positionTextBox // this.positionTextBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.positionTextBox.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.positionTextBox.Name = "positionTextBox"; this.positionTextBox.Size = new System.Drawing.Size(50, 25); this.positionTextBox.TextBoxTextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.positionTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.positionTextBox_KeyDown); // // totalRecsLabel // this.totalRecsLabel.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.totalRecsLabel.Name = "totalRecsLabel"; this.totalRecsLabel.Size = new System.Drawing.Size(49, 22); this.totalRecsLabel.Text = "of Total"; // // toolStripSeparator3 // this.toolStripSeparator3.Name = "toolStripSeparator3"; this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25); // // moveNextButton // this.moveNextButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.moveNextButton.Image = global::EventsAndAttendance.Properties.Resources.DataContainer_MoveNextHS; this.moveNextButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.moveNextButton.Name = "moveNextButton"; this.moveNextButton.Size = new System.Drawing.Size(23, 22); this.moveNextButton.Text = "toolStripButton3"; this.moveNextButton.ToolTipText = "Next"; this.moveNextButton.Click += new System.EventHandler(this.PnlNavButtons); // // toolStripSeparator4 // this.toolStripSeparator4.Name = "toolStripSeparator4"; this.toolStripSeparator4.Size = new System.Drawing.Size(6, 25); // // moveLastButton // this.moveLastButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.moveLastButton.Image = global::EventsAndAttendance.Properties.Resources.DataContainer_MoveLastHS; this.moveLastButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.moveLastButton.Name = "moveLastButton"; this.moveLastButton.Size = new System.Drawing.Size(23, 22); this.moveLastButton.Text = "toolStripButton4"; this.moveLastButton.ToolTipText = "Last"; this.moveLastButton.Click += new System.EventHandler(this.PnlNavButtons); // // toolStripSeparator5 // this.toolStripSeparator5.Name = "toolStripSeparator5"; this.toolStripSeparator5.Size = new System.Drawing.Size(6, 25); // // dsplySizeComboBox // this.dsplySizeComboBox.AutoSize = false; this.dsplySizeComboBox.Items.AddRange(new object[] { "1", "5", "10", "20", "30", "50", "100", "500", "1000", "5000", "10000"}); this.dsplySizeComboBox.Name = "dsplySizeComboBox"; this.dsplySizeComboBox.Size = new System.Drawing.Size(35, 23); this.dsplySizeComboBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.searchForTextBox_KeyDown); // // toolStripSeparator7 // this.toolStripSeparator7.Name = "toolStripSeparator7"; this.toolStripSeparator7.Size = new System.Drawing.Size(6, 25); // // toolStripLabel3 // this.toolStripLabel3.Name = "toolStripLabel3"; this.toolStripLabel3.Size = new System.Drawing.Size(65, 22); this.toolStripLabel3.Text = "Search For:"; // // searchForTextBox // this.searchForTextBox.Name = "searchForTextBox"; this.searchForTextBox.Size = new System.Drawing.Size(80, 25); this.searchForTextBox.Text = "%"; this.searchForTextBox.Enter += new System.EventHandler(this.searchForTextBox_Click); this.searchForTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.searchForTextBox_KeyDown); this.searchForTextBox.Click += new System.EventHandler(this.searchForTextBox_Click); // // toolStripLabel4 // this.toolStripLabel4.Name = "toolStripLabel4"; this.toolStripLabel4.Size = new System.Drawing.Size(58, 22); this.toolStripLabel4.Text = "Search In:"; // // searchInComboBox // this.searchInComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.searchInComboBox.Items.AddRange(new object[] { "Created By", "Customer", "Doc. Status", "Document Number", "Start Date"}); this.searchInComboBox.Name = "searchInComboBox"; this.searchInComboBox.Size = new System.Drawing.Size(121, 25); this.searchInComboBox.Sorted = true; this.searchInComboBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.searchForTextBox_KeyDown); // // resetButton // this.resetButton.Image = global::EventsAndAttendance.Properties.Resources.undo_256; this.resetButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.resetButton.Name = "resetButton"; this.resetButton.Size = new System.Drawing.Size(59, 22); this.resetButton.Text = "RESET"; this.resetButton.Click += new System.EventHandler(this.resetButton_Click); // // groupBox8 // this.groupBox8.Location = new System.Drawing.Point(959, 373); this.groupBox8.Name = "groupBox8"; this.groupBox8.Size = new System.Drawing.Size(146, 49); this.groupBox8.TabIndex = 20; this.groupBox8.TabStop = false; this.groupBox8.Text = "groupBox8"; // // groupBox5 // this.groupBox5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); this.groupBox5.Controls.Add(this.showUnsettledCheckBox); this.groupBox5.Controls.Add(this.showActiveCheckBox); this.groupBox5.Controls.Add(this.checkInsListView); this.groupBox5.Location = new System.Drawing.Point(6, 28); this.groupBox5.Name = "groupBox5"; this.groupBox5.Size = new System.Drawing.Size(204, 603); this.groupBox5.TabIndex = 1; this.groupBox5.TabStop = false; // // showUnsettledCheckBox // this.showUnsettledCheckBox.AutoSize = true; this.showUnsettledCheckBox.BackColor = System.Drawing.Color.Transparent; this.showUnsettledCheckBox.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.showUnsettledCheckBox.ForeColor = System.Drawing.Color.White; this.showUnsettledCheckBox.Location = new System.Drawing.Point(4, 28); this.showUnsettledCheckBox.Name = "showUnsettledCheckBox"; this.showUnsettledCheckBox.Size = new System.Drawing.Size(146, 17); this.showUnsettledCheckBox.TabIndex = 1; this.showUnsettledCheckBox.Text = "Show Only Unsettled Bills"; this.showUnsettledCheckBox.UseVisualStyleBackColor = false; this.showUnsettledCheckBox.CheckedChanged += new System.EventHandler(this.showUnsettledCheckBox_CheckedChanged); // // showActiveCheckBox // this.showActiveCheckBox.AutoSize = true; this.showActiveCheckBox.BackColor = System.Drawing.Color.Transparent; this.showActiveCheckBox.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.showActiveCheckBox.ForeColor = System.Drawing.Color.White; this.showActiveCheckBox.Location = new System.Drawing.Point(4, 12); this.showActiveCheckBox.Name = "showActiveCheckBox"; this.showActiveCheckBox.Size = new System.Drawing.Size(166, 17); this.showActiveCheckBox.TabIndex = 0; this.showActiveCheckBox.Text = "Show Only Active Documents"; this.showActiveCheckBox.UseVisualStyleBackColor = false; this.showActiveCheckBox.CheckedChanged += new System.EventHandler(this.showActiveCheckBox_CheckedChanged); // // checkInsListView // this.checkInsListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.checkInsListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeader3, this.columnHeader2, this.columnHeader1}); this.checkInsListView.ContextMenuStrip = this.docContextMenuStrip; this.checkInsListView.FullRowSelect = true; this.checkInsListView.GridLines = true; this.checkInsListView.HideSelection = false; this.checkInsListView.Location = new System.Drawing.Point(5, 46); this.checkInsListView.Name = "checkInsListView"; this.checkInsListView.Size = new System.Drawing.Size(195, 554); this.checkInsListView.TabIndex = 2; this.checkInsListView.UseCompatibleStateImageBehavior = false; this.checkInsListView.View = System.Windows.Forms.View.Details; this.checkInsListView.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.checkInsListView_ItemSelectionChanged); this.checkInsListView.SelectedIndexChanged += new System.EventHandler(this.checkInsListView_SelectedIndexChanged); // // columnHeader3 // this.columnHeader3.Text = "No."; this.columnHeader3.Width = 35; // // columnHeader2 // this.columnHeader2.Text = "Document Number"; this.columnHeader2.Width = 300; // // columnHeader1 // this.columnHeader1.Text = "CheckINID"; this.columnHeader1.Width = 0; // // docContextMenuStrip // this.docContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.addMenuItem, this.editMenuItem, this.delMenuItem, this.toolStripSeparator90, this.exptExMenuItem, this.rfrshMenuItem, this.vwSQLMenuItem, this.rcHstryMenuItem}); this.docContextMenuStrip.Name = "usersContextMenuStrip"; this.docContextMenuStrip.Size = new System.Drawing.Size(153, 164); // // addMenuItem // this.addMenuItem.Image = global::EventsAndAttendance.Properties.Resources.plus_32; this.addMenuItem.Name = "addMenuItem"; this.addMenuItem.Size = new System.Drawing.Size(152, 22); this.addMenuItem.Text = "NEW"; this.addMenuItem.Click += new System.EventHandler(this.addMenuItem_Click); // // editMenuItem // this.editMenuItem.Image = global::EventsAndAttendance.Properties.Resources.edit32; this.editMenuItem.Name = "editMenuItem"; this.editMenuItem.Size = new System.Drawing.Size(152, 22); this.editMenuItem.Text = "EDIT"; this.editMenuItem.Click += new System.EventHandler(this.editMenuItem_Click); // // delMenuItem // this.delMenuItem.Image = global::EventsAndAttendance.Properties.Resources.delete; this.delMenuItem.Name = "delMenuItem"; this.delMenuItem.Size = new System.Drawing.Size(152, 22); this.delMenuItem.Text = "DELETE"; this.delMenuItem.Click += new System.EventHandler(this.delMenuItem_Click); // // toolStripSeparator90 // this.toolStripSeparator90.Name = "toolStripSeparator90"; this.toolStripSeparator90.Size = new System.Drawing.Size(149, 6); // // exptExMenuItem // this.exptExMenuItem.Image = global::EventsAndAttendance.Properties.Resources.image007; this.exptExMenuItem.Name = "exptExMenuItem"; this.exptExMenuItem.Size = new System.Drawing.Size(152, 22); this.exptExMenuItem.Text = "Export to Excel"; this.exptExMenuItem.Click += new System.EventHandler(this.exptExMenuItem_Click); // // rfrshMenuItem // this.rfrshMenuItem.Image = global::EventsAndAttendance.Properties.Resources.refresh; this.rfrshMenuItem.Name = "rfrshMenuItem"; this.rfrshMenuItem.Size = new System.Drawing.Size(152, 22); this.rfrshMenuItem.Text = "&Refresh"; this.rfrshMenuItem.Click += new System.EventHandler(this.rfrshMenuItem_Click); // // vwSQLMenuItem // this.vwSQLMenuItem.Image = global::EventsAndAttendance.Properties.Resources.sql_icon; this.vwSQLMenuItem.Name = "vwSQLMenuItem"; this.vwSQLMenuItem.Size = new System.Drawing.Size(152, 22); this.vwSQLMenuItem.Text = "&View SQL"; this.vwSQLMenuItem.Click += new System.EventHandler(this.vwSQLMenuItem_Click); // // rcHstryMenuItem // this.rcHstryMenuItem.Image = global::EventsAndAttendance.Properties.Resources.statistics_32; this.rcHstryMenuItem.Name = "rcHstryMenuItem"; this.rcHstryMenuItem.Size = new System.Drawing.Size(152, 22); this.rcHstryMenuItem.Text = "Record History"; this.rcHstryMenuItem.Click += new System.EventHandler(this.rcHstryMenuItem_Click); // // groupBox6 // this.groupBox6.Controls.Add(this.groupBox7); this.groupBox6.Controls.Add(this.groupBox3); this.groupBox6.Controls.Add(this.groupBox2); this.groupBox6.ForeColor = System.Drawing.Color.White; this.groupBox6.Location = new System.Drawing.Point(215, 28); this.groupBox6.Name = "groupBox6"; this.groupBox6.Size = new System.Drawing.Size(879, 219); this.groupBox6.TabIndex = 2; this.groupBox6.TabStop = false; // // groupBox7 // this.groupBox7.Controls.Add(this.cancelButton); this.groupBox7.Controls.Add(this.badDebtButton); this.groupBox7.Controls.Add(this.settleBillButton); this.groupBox7.Controls.Add(this.takeDepositsButton); this.groupBox7.Controls.Add(this.cmplntsButton); this.groupBox7.Controls.Add(this.checkInButton); this.groupBox7.Controls.Add(this.checkOutButton); this.groupBox7.ForeColor = System.Drawing.Color.White; this.groupBox7.Location = new System.Drawing.Point(590, 10); this.groupBox7.Name = "groupBox7"; this.groupBox7.Size = new System.Drawing.Size(282, 203); this.groupBox7.TabIndex = 2; this.groupBox7.TabStop = false; this.groupBox7.Text = "Actions:"; // // cancelButton // this.cancelButton.ForeColor = System.Drawing.Color.Black; this.cancelButton.ImageKey = "90.png"; this.cancelButton.ImageList = this.imageList2; this.cancelButton.Location = new System.Drawing.Point(136, 134); this.cancelButton.Name = "cancelButton"; this.cancelButton.Size = new System.Drawing.Size(139, 32); this.cancelButton.TabIndex = 5; this.cancelButton.Text = "Cancel Document "; this.cancelButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; this.cancelButton.UseVisualStyleBackColor = true; this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); // // imageList2 // this.imageList2.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList2.ImageStream"))); this.imageList2.TransparentColor = System.Drawing.Color.Transparent; this.imageList2.Images.SetKeyName(0, "90.png"); this.imageList2.Images.SetKeyName(1, "LaST (Cobalt) Delete.png"); this.imageList2.Images.SetKeyName(2, "Select.png"); this.imageList2.Images.SetKeyName(3, "tick_32.png"); this.imageList2.Images.SetKeyName(4, "pdf.png"); this.imageList2.Images.SetKeyName(5, "blocked.png"); this.imageList2.Images.SetKeyName(6, "undo_256.png"); this.imageList2.Images.SetKeyName(7, "edit32.png"); // // badDebtButton // this.badDebtButton.ForeColor = System.Drawing.Color.Black; this.badDebtButton.ImageKey = "90.png"; this.badDebtButton.ImageList = this.imageList2; this.badDebtButton.Location = new System.Drawing.Point(136, 166); this.badDebtButton.Name = "badDebtButton"; this.badDebtButton.Size = new System.Drawing.Size(139, 32); this.badDebtButton.TabIndex = 7; this.badDebtButton.Text = "Declare as Bad Debt"; this.badDebtButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; this.badDebtButton.UseVisualStyleBackColor = true; this.badDebtButton.Click += new System.EventHandler(this.badDebtButton_Click); // // settleBillButton // this.settleBillButton.ForeColor = System.Drawing.Color.Black; this.settleBillButton.ImageKey = "investor-icon.png"; this.settleBillButton.ImageList = this.imageList1; this.settleBillButton.Location = new System.Drawing.Point(136, 14); this.settleBillButton.Name = "settleBillButton"; this.settleBillButton.Size = new System.Drawing.Size(139, 60); this.settleBillButton.TabIndex = 1; this.settleBillButton.Text = "Customer\'s Bill Settlement"; this.settleBillButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; this.settleBillButton.UseVisualStyleBackColor = true; this.settleBillButton.Click += new System.EventHandler(this.btnMakePayment_Click); // // imageList1 // this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream"))); this.imageList1.TransparentColor = System.Drawing.Color.Transparent; this.imageList1.Images.SetKeyName(0, "90.png"); this.imageList1.Images.SetKeyName(1, "calendar-icon (1).png"); this.imageList1.Images.SetKeyName(2, "investor-icon.png"); this.imageList1.Images.SetKeyName(3, "person.png"); // // takeDepositsButton // this.takeDepositsButton.ForeColor = System.Drawing.Color.Black; this.takeDepositsButton.ImageKey = "investor-icon.png"; this.takeDepositsButton.ImageList = this.imageList1; this.takeDepositsButton.Location = new System.Drawing.Point(7, 14); this.takeDepositsButton.Name = "takeDepositsButton"; this.takeDepositsButton.Size = new System.Drawing.Size(128, 60); this.takeDepositsButton.TabIndex = 0; this.takeDepositsButton.Text = "Take Customer Deposits"; this.takeDepositsButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; this.takeDepositsButton.UseVisualStyleBackColor = true; this.takeDepositsButton.Click += new System.EventHandler(this.btnMakePayment_Click); // // cmplntsButton // this.cmplntsButton.ForeColor = System.Drawing.Color.Black; this.cmplntsButton.ImageKey = "calendar-icon (1).png"; this.cmplntsButton.ImageList = this.imageList1; this.cmplntsButton.Location = new System.Drawing.Point(136, 74); this.cmplntsButton.Name = "cmplntsButton"; this.cmplntsButton.Size = new System.Drawing.Size(139, 60); this.cmplntsButton.TabIndex = 3; this.cmplntsButton.Text = "Complaints / Observations"; this.cmplntsButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; this.cmplntsButton.UseVisualStyleBackColor = true; this.cmplntsButton.Click += new System.EventHandler(this.cmplntsButton_Click); // // checkInButton // this.checkInButton.ForeColor = System.Drawing.Color.Black; this.checkInButton.ImageKey = "person.png"; this.checkInButton.ImageList = this.imageList1; this.checkInButton.Location = new System.Drawing.Point(7, 74); this.checkInButton.Name = "checkInButton"; this.checkInButton.Size = new System.Drawing.Size(128, 60); this.checkInButton.TabIndex = 2; this.checkInButton.Text = "Convert to a Check In"; this.checkInButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; this.checkInButton.UseVisualStyleBackColor = true; this.checkInButton.Click += new System.EventHandler(this.checkInButton_Click); // // checkOutButton // this.checkOutButton.ForeColor = System.Drawing.Color.Black; this.checkOutButton.ImageKey = "person.png"; this.checkOutButton.ImageList = this.imageList1; this.checkOutButton.Location = new System.Drawing.Point(7, 134); this.checkOutButton.Name = "checkOutButton"; this.checkOutButton.Size = new System.Drawing.Size(128, 64); this.checkOutButton.TabIndex = 4; this.checkOutButton.Text = "Finalize Document"; this.checkOutButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; this.checkOutButton.UseVisualStyleBackColor = true; this.checkOutButton.Click += new System.EventHandler(this.nxtApprvlStatusButton_Click); // // groupBox3 // this.groupBox3.Controls.Add(this.srvcTypeTextBox); this.groupBox3.Controls.Add(this.endDteButton); this.groupBox3.Controls.Add(this.strtDteButton); this.groupBox3.Controls.Add(this.endDteTextBox); this.groupBox3.Controls.Add(this.strtDteTextBox); this.groupBox3.Controls.Add(this.label78); this.groupBox3.Controls.Add(this.label79); this.groupBox3.Controls.Add(this.noOfAdultsNumUpDwn); this.groupBox3.Controls.Add(this.label6); this.groupBox3.Controls.Add(this.roomNumTextBox); this.groupBox3.Controls.Add(this.fcltyTypeComboBox); this.groupBox3.Controls.Add(this.label14); this.groupBox3.Controls.Add(this.noOfChdrnNumUpDwn); this.groupBox3.Controls.Add(this.label10); this.groupBox3.Controls.Add(this.roomNumButton); this.groupBox3.Controls.Add(this.label7); this.groupBox3.Controls.Add(this.docTypeComboBox); this.groupBox3.Controls.Add(this.label15); this.groupBox3.Controls.Add(this.docIDPrfxComboBox); this.groupBox3.Controls.Add(this.docIDNumTextBox); this.groupBox3.Controls.Add(this.label16); this.groupBox3.Controls.Add(this.docIDTextBox); this.groupBox3.Controls.Add(this.roomIDTextBox); this.groupBox3.Controls.Add(this.srvcTypeIDTextBox); this.groupBox3.Controls.Add(this.label3); this.groupBox3.Controls.Add(this.attnRegisterButton); this.groupBox3.ForeColor = System.Drawing.Color.White; this.groupBox3.Location = new System.Drawing.Point(6, 10); this.groupBox3.Name = "groupBox3"; this.groupBox3.Size = new System.Drawing.Size(289, 203); this.groupBox3.TabIndex = 0; this.groupBox3.TabStop = false; this.groupBox3.Text = "Check In Summary"; // // srvcTypeTextBox // this.srvcTypeTextBox.Location = new System.Drawing.Point(87, 60); this.srvcTypeTextBox.MaxLength = 500; this.srvcTypeTextBox.Multiline = true; this.srvcTypeTextBox.Name = "srvcTypeTextBox"; this.srvcTypeTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.srvcTypeTextBox.Size = new System.Drawing.Size(166, 47); this.srvcTypeTextBox.TabIndex = 3; this.srvcTypeTextBox.TextChanged += new System.EventHandler(this.docDteTextBox_TextChanged); this.srvcTypeTextBox.Leave += new System.EventHandler(this.docDteTextBox_Leave); // // endDteButton // this.endDteButton.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.endDteButton.ForeColor = System.Drawing.Color.Black; this.endDteButton.Location = new System.Drawing.Point(255, 131); this.endDteButton.Name = "endDteButton"; this.endDteButton.Size = new System.Drawing.Size(28, 22); this.endDteButton.TabIndex = 7; this.endDteButton.Text = "..."; this.endDteButton.UseVisualStyleBackColor = true; this.endDteButton.Click += new System.EventHandler(this.endDteButton_Click); // // strtDteButton // this.strtDteButton.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.strtDteButton.ForeColor = System.Drawing.Color.Black; this.strtDteButton.Location = new System.Drawing.Point(255, 108); this.strtDteButton.Name = "strtDteButton"; this.strtDteButton.Size = new System.Drawing.Size(28, 22); this.strtDteButton.TabIndex = 5; this.strtDteButton.Text = "..."; this.strtDteButton.UseVisualStyleBackColor = true; this.strtDteButton.Click += new System.EventHandler(this.strtDteButton_Click); // // endDteTextBox // this.endDteTextBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128))))); this.endDteTextBox.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.endDteTextBox.ForeColor = System.Drawing.Color.Black; this.endDteTextBox.Location = new System.Drawing.Point(87, 132); this.endDteTextBox.Name = "endDteTextBox"; this.endDteTextBox.Size = new System.Drawing.Size(166, 21); this.endDteTextBox.TabIndex = 6; this.endDteTextBox.TextChanged += new System.EventHandler(this.docDteTextBox_TextChanged); this.endDteTextBox.Enter += new System.EventHandler(this.endDteTextBox_Enter); this.endDteTextBox.Leave += new System.EventHandler(this.docDteTextBox_Leave); // // strtDteTextBox // this.strtDteTextBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128))))); this.strtDteTextBox.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.strtDteTextBox.ForeColor = System.Drawing.Color.Black; this.strtDteTextBox.Location = new System.Drawing.Point(87, 109); this.strtDteTextBox.Name = "strtDteTextBox"; this.strtDteTextBox.Size = new System.Drawing.Size(166, 21); this.strtDteTextBox.TabIndex = 4; this.strtDteTextBox.TextChanged += new System.EventHandler(this.docDteTextBox_TextChanged); this.strtDteTextBox.Enter += new System.EventHandler(this.strtDteTextBox_Enter); this.strtDteTextBox.Leave += new System.EventHandler(this.docDteTextBox_Leave); // // label78 // this.label78.AutoSize = true; this.label78.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label78.ForeColor = System.Drawing.Color.White; this.label78.Location = new System.Drawing.Point(6, 136); this.label78.Name = "label78"; this.label78.Size = new System.Drawing.Size(55, 13); this.label78.TabIndex = 26; this.label78.Text = "End Date:"; // // label79 // this.label79.AutoSize = true; this.label79.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label79.ForeColor = System.Drawing.Color.White; this.label79.Location = new System.Drawing.Point(6, 113); this.label79.Name = "label79"; this.label79.Size = new System.Drawing.Size(61, 13); this.label79.TabIndex = 24; this.label79.Text = "Start Date:"; // // noOfAdultsNumUpDwn // this.noOfAdultsNumUpDwn.Location = new System.Drawing.Point(87, 155); this.noOfAdultsNumUpDwn.Maximum = new decimal(new int[] { 100000, 0, 0, 0}); this.noOfAdultsNumUpDwn.Name = "noOfAdultsNumUpDwn"; this.noOfAdultsNumUpDwn.Size = new System.Drawing.Size(195, 21); this.noOfAdultsNumUpDwn.TabIndex = 12; this.noOfAdultsNumUpDwn.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this.noOfAdultsNumUpDwn.ValueChanged += new System.EventHandler(this.noOfAdultsNumUpDwn_ValueChanged); // // label6 // this.label6.AutoSize = true; this.label6.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label6.ForeColor = System.Drawing.Color.White; this.label6.Location = new System.Drawing.Point(6, 160); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(82, 13); this.label6.TabIndex = 197; this.label6.Text = "No. of Persons:"; // // roomNumTextBox // this.roomNumTextBox.Location = new System.Drawing.Point(87, 178); this.roomNumTextBox.Name = "roomNumTextBox"; this.roomNumTextBox.Size = new System.Drawing.Size(166, 21); this.roomNumTextBox.TabIndex = 10; this.roomNumTextBox.TextChanged += new System.EventHandler(this.docDteTextBox_TextChanged); this.roomNumTextBox.Leave += new System.EventHandler(this.docDteTextBox_Leave); // // fcltyTypeComboBox // this.fcltyTypeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.fcltyTypeComboBox.FormattingEnabled = true; this.fcltyTypeComboBox.Items.AddRange(new object[] { "Event"}); this.fcltyTypeComboBox.Location = new System.Drawing.Point(187, 13); this.fcltyTypeComboBox.Name = "fcltyTypeComboBox"; this.fcltyTypeComboBox.Size = new System.Drawing.Size(95, 21); this.fcltyTypeComboBox.TabIndex = 1; this.fcltyTypeComboBox.SelectedIndexChanged += new System.EventHandler(this.fcltyTypeComboBox_SelectedIndexChanged); // // label14 // this.label14.AutoSize = true; this.label14.Location = new System.Drawing.Point(6, 182); this.label14.Name = "label14"; this.label14.Size = new System.Drawing.Size(82, 13); this.label14.TabIndex = 186; this.label14.Text = "Price Category:"; // // noOfChdrnNumUpDwn // this.noOfChdrnNumUpDwn.Location = new System.Drawing.Point(189, 132); this.noOfChdrnNumUpDwn.Maximum = new decimal(new int[] { 100000, 0, 0, 0}); this.noOfChdrnNumUpDwn.Name = "noOfChdrnNumUpDwn"; this.noOfChdrnNumUpDwn.Size = new System.Drawing.Size(62, 21); this.noOfChdrnNumUpDwn.TabIndex = 13; this.noOfChdrnNumUpDwn.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this.noOfChdrnNumUpDwn.Visible = false; // // label10 // this.label10.AutoSize = true; this.label10.Location = new System.Drawing.Point(174, 133); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(50, 13); this.label10.TabIndex = 181; this.label10.Text = "Children:"; this.label10.Visible = false; // // roomNumButton // this.roomNumButton.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.roomNumButton.ForeColor = System.Drawing.Color.Black; this.roomNumButton.Location = new System.Drawing.Point(255, 177); this.roomNumButton.Name = "roomNumButton"; this.roomNumButton.Size = new System.Drawing.Size(28, 22); this.roomNumButton.TabIndex = 11; this.roomNumButton.Text = "..."; this.roomNumButton.UseVisualStyleBackColor = true; this.roomNumButton.Click += new System.EventHandler(this.roomNumButton_Click); // // label7 // this.label7.AutoSize = true; this.label7.Location = new System.Drawing.Point(6, 132); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(78, 13); this.label7.TabIndex = 19; this.label7.Text = "Room Number:"; this.label7.Visible = false; // // docTypeComboBox // this.docTypeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.docTypeComboBox.FormattingEnabled = true; this.docTypeComboBox.Items.AddRange(new object[] { "Booking", "Check-In"}); this.docTypeComboBox.Location = new System.Drawing.Point(87, 13); this.docTypeComboBox.Name = "docTypeComboBox"; this.docTypeComboBox.Size = new System.Drawing.Size(94, 21); this.docTypeComboBox.TabIndex = 0; this.docTypeComboBox.SelectedIndexChanged += new System.EventHandler(this.docTypeComboBox_SelectedIndexChanged); // // label15 // this.label15.AutoSize = true; this.label15.Location = new System.Drawing.Point(6, 17); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(60, 13); this.label15.TabIndex = 196; this.label15.Text = "Doc. Type:"; // // docIDPrfxComboBox // this.docIDPrfxComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.docIDPrfxComboBox.FormattingEnabled = true; this.docIDPrfxComboBox.Items.AddRange(new object[] { "PFI", "SO", "SI", "IIR", "IIU", "SR"}); this.docIDPrfxComboBox.Location = new System.Drawing.Point(87, 36); this.docIDPrfxComboBox.Name = "docIDPrfxComboBox"; this.docIDPrfxComboBox.Size = new System.Drawing.Size(41, 21); this.docIDPrfxComboBox.TabIndex = 2; this.docIDPrfxComboBox.SelectedIndexChanged += new System.EventHandler(this.docIDPrfxComboBox_SelectedIndexChanged); // // docIDNumTextBox // this.docIDNumTextBox.Location = new System.Drawing.Point(133, 36); this.docIDNumTextBox.MaxLength = 200; this.docIDNumTextBox.Name = "docIDNumTextBox"; this.docIDNumTextBox.Size = new System.Drawing.Size(149, 21); this.docIDNumTextBox.TabIndex = 2; // // label16 // this.label16.AutoSize = true; this.label16.Location = new System.Drawing.Point(6, 40); this.label16.Name = "label16"; this.label16.Size = new System.Drawing.Size(73, 13); this.label16.TabIndex = 194; this.label16.Text = "Doc. Number:"; // // docIDTextBox // this.docIDTextBox.Location = new System.Drawing.Point(235, 36); this.docIDTextBox.MaxLength = 200; this.docIDTextBox.Name = "docIDTextBox"; this.docIDTextBox.ReadOnly = true; this.docIDTextBox.Size = new System.Drawing.Size(47, 21); this.docIDTextBox.TabIndex = 3; this.docIDTextBox.TabStop = false; this.docIDTextBox.Text = "-1"; // // roomIDTextBox // this.roomIDTextBox.Location = new System.Drawing.Point(172, 178); this.roomIDTextBox.Name = "roomIDTextBox"; this.roomIDTextBox.ReadOnly = true; this.roomIDTextBox.Size = new System.Drawing.Size(33, 21); this.roomIDTextBox.TabIndex = 35; this.roomIDTextBox.Text = "-1"; // // srvcTypeIDTextBox // this.srvcTypeIDTextBox.Location = new System.Drawing.Point(167, 109); this.srvcTypeIDTextBox.Name = "srvcTypeIDTextBox"; this.srvcTypeIDTextBox.ReadOnly = true; this.srvcTypeIDTextBox.Size = new System.Drawing.Size(33, 21); this.srvcTypeIDTextBox.TabIndex = 6; this.srvcTypeIDTextBox.Text = "-1"; this.srvcTypeIDTextBox.Visible = false; // // label3 // this.label3.Location = new System.Drawing.Point(6, 64); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(78, 35); this.label3.TabIndex = 177; this.label3.Text = "Linked Event Description:"; // // attnRegisterButton // this.attnRegisterButton.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.attnRegisterButton.ForeColor = System.Drawing.Color.Black; this.attnRegisterButton.Location = new System.Drawing.Point(255, 59); this.attnRegisterButton.Name = "attnRegisterButton"; this.attnRegisterButton.Size = new System.Drawing.Size(28, 22); this.attnRegisterButton.TabIndex = 3; this.attnRegisterButton.Text = "..."; this.attnRegisterButton.UseVisualStyleBackColor = true; this.attnRegisterButton.Click += new System.EventHandler(this.eventTypeButton_Click); // // groupBox2 // this.groupBox2.Controls.Add(this.pymntTermsButton); this.groupBox2.Controls.Add(this.pymntTermsTextBox); this.groupBox2.Controls.Add(this.exchRateLabel); this.groupBox2.Controls.Add(this.exchRateNumUpDwn); this.groupBox2.Controls.Add(this.docStatusTextBox); this.groupBox2.Controls.Add(this.pymntMthdButton); this.groupBox2.Controls.Add(this.pymntMthdTextBox); this.groupBox2.Controls.Add(this.label5); this.groupBox2.Controls.Add(this.createdByTextBox); this.groupBox2.Controls.Add(this.label4); this.groupBox2.Controls.Add(this.pymntMthdIDTextBox); this.groupBox2.Controls.Add(this.invcCurrButton); this.groupBox2.Controls.Add(this.invcCurrTextBox); this.groupBox2.Controls.Add(this.label19); this.groupBox2.Controls.Add(this.invcCurrIDTextBox); this.groupBox2.Controls.Add(this.sponseeNmTextBox); this.groupBox2.Controls.Add(this.sponsorNmTextBox); this.groupBox2.Controls.Add(this.sponsorIDTextBox); this.groupBox2.Controls.Add(this.sponsorSiteIDTextBox); this.groupBox2.Controls.Add(this.label8); this.groupBox2.Controls.Add(this.prcdngToTextBox); this.groupBox2.Controls.Add(this.arrvlFromTextBox); this.groupBox2.Controls.Add(this.label11); this.groupBox2.Controls.Add(this.sponsorButton); this.groupBox2.Controls.Add(this.label9); this.groupBox2.Controls.Add(this.sponseeButton); this.groupBox2.Controls.Add(this.sponseeIDTextBox); this.groupBox2.Controls.Add(this.label2); this.groupBox2.Controls.Add(this.sponseeSiteIDTextBox); this.groupBox2.Controls.Add(this.label12); this.groupBox2.ForeColor = System.Drawing.Color.White; this.groupBox2.Location = new System.Drawing.Point(298, 10); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(290, 203); this.groupBox2.TabIndex = 1; this.groupBox2.TabStop = false; this.groupBox2.Text = "Customer Information"; // // pymntTermsButton // this.pymntTermsButton.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.pymntTermsButton.ForeColor = System.Drawing.Color.Black; this.pymntTermsButton.ImageKey = "edit32.png"; this.pymntTermsButton.ImageList = this.imageList2; this.pymntTermsButton.Location = new System.Drawing.Point(251, 132); this.pymntTermsButton.Name = "pymntTermsButton"; this.pymntTermsButton.Size = new System.Drawing.Size(28, 23); this.pymntTermsButton.TabIndex = 249; this.pymntTermsButton.UseVisualStyleBackColor = true; this.pymntTermsButton.Click += new System.EventHandler(this.pymntTermsButton_Click); // // pymntTermsTextBox // this.pymntTermsTextBox.Location = new System.Drawing.Point(70, 133); this.pymntTermsTextBox.MaxLength = 9999999; this.pymntTermsTextBox.Multiline = true; this.pymntTermsTextBox.Name = "pymntTermsTextBox"; this.pymntTermsTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.pymntTermsTextBox.Size = new System.Drawing.Size(181, 43); this.pymntTermsTextBox.TabIndex = 11; // // exchRateLabel // this.exchRateLabel.AutoSize = true; this.exchRateLabel.Location = new System.Drawing.Point(4, 90); this.exchRateLabel.Name = "exchRateLabel"; this.exchRateLabel.Size = new System.Drawing.Size(89, 13); this.exchRateLabel.TabIndex = 234; this.exchRateLabel.Text = "Rate (GHS-GHS):"; // // exchRateNumUpDwn // this.exchRateNumUpDwn.DecimalPlaces = 15; this.exchRateNumUpDwn.Increment = new decimal(new int[] { 11, 0, 0, 65536}); this.exchRateNumUpDwn.Location = new System.Drawing.Point(99, 86); this.exchRateNumUpDwn.Maximum = new decimal(new int[] { -1530494977, 232830, 0, 0}); this.exchRateNumUpDwn.Name = "exchRateNumUpDwn"; this.exchRateNumUpDwn.Size = new System.Drawing.Size(152, 21); this.exchRateNumUpDwn.TabIndex = 6; this.exchRateNumUpDwn.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this.exchRateNumUpDwn.Value = new decimal(new int[] { 1, 0, 0, 0}); this.exchRateNumUpDwn.ValueChanged += new System.EventHandler(this.exchRateNumUpDwn_ValueChanged); // // docStatusTextBox // this.docStatusTextBox.Location = new System.Drawing.Point(199, 178); this.docStatusTextBox.MaxLength = 200; this.docStatusTextBox.Name = "docStatusTextBox"; this.docStatusTextBox.ReadOnly = true; this.docStatusTextBox.Size = new System.Drawing.Size(80, 21); this.docStatusTextBox.TabIndex = 15; this.docStatusTextBox.TextChanged += new System.EventHandler(this.docStatusTextBox_TextChanged); // // pymntMthdButton // this.pymntMthdButton.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.pymntMthdButton.ForeColor = System.Drawing.Color.Black; this.pymntMthdButton.Location = new System.Drawing.Point(251, 108); this.pymntMthdButton.Name = "pymntMthdButton"; this.pymntMthdButton.Size = new System.Drawing.Size(28, 23); this.pymntMthdButton.TabIndex = 8; this.pymntMthdButton.Text = "..."; this.pymntMthdButton.UseVisualStyleBackColor = true; this.pymntMthdButton.Click += new System.EventHandler(this.pymntMthdButton_Click); // // pymntMthdTextBox // this.pymntMthdTextBox.Location = new System.Drawing.Point(99, 109); this.pymntMthdTextBox.MaxLength = 200; this.pymntMthdTextBox.Name = "pymntMthdTextBox"; this.pymntMthdTextBox.ReadOnly = true; this.pymntMthdTextBox.Size = new System.Drawing.Size(152, 21); this.pymntMthdTextBox.TabIndex = 7; this.pymntMthdTextBox.TextChanged += new System.EventHandler(this.docDteTextBox_TextChanged); this.pymntMthdTextBox.Leave += new System.EventHandler(this.docDteTextBox_Leave); // // label5 // this.label5.AutoSize = true; this.label5.Location = new System.Drawing.Point(4, 113); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(92, 13); this.label5.TabIndex = 232; this.label5.Text = "Payment Method:"; // // createdByTextBox // this.createdByTextBox.Location = new System.Drawing.Point(70, 178); this.createdByTextBox.MaxLength = 200; this.createdByTextBox.Name = "createdByTextBox"; this.createdByTextBox.ReadOnly = true; this.createdByTextBox.Size = new System.Drawing.Size(126, 21); this.createdByTextBox.TabIndex = 14; // // label4 // this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(7, 182); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(65, 13); this.label4.TabIndex = 185; this.label4.Text = "Created By:"; // // pymntMthdIDTextBox // this.pymntMthdIDTextBox.Location = new System.Drawing.Point(144, 109); this.pymntMthdIDTextBox.MaxLength = 200; this.pymntMthdIDTextBox.Name = "pymntMthdIDTextBox"; this.pymntMthdIDTextBox.ReadOnly = true; this.pymntMthdIDTextBox.Size = new System.Drawing.Size(106, 21); this.pymntMthdIDTextBox.TabIndex = 233; this.pymntMthdIDTextBox.Text = "-1"; // // invcCurrButton // this.invcCurrButton.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.invcCurrButton.ForeColor = System.Drawing.Color.Black; this.invcCurrButton.Location = new System.Drawing.Point(251, 62); this.invcCurrButton.Name = "invcCurrButton"; this.invcCurrButton.Size = new System.Drawing.Size(28, 23); this.invcCurrButton.TabIndex = 5; this.invcCurrButton.Text = "..."; this.invcCurrButton.UseVisualStyleBackColor = true; this.invcCurrButton.Click += new System.EventHandler(this.invcCurrButton_Click); // // invcCurrTextBox // this.invcCurrTextBox.Location = new System.Drawing.Point(99, 63); this.invcCurrTextBox.MaxLength = 200; this.invcCurrTextBox.Name = "invcCurrTextBox"; this.invcCurrTextBox.ReadOnly = true; this.invcCurrTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.invcCurrTextBox.Size = new System.Drawing.Size(152, 21); this.invcCurrTextBox.TabIndex = 2; this.invcCurrTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this.invcCurrTextBox.TextChanged += new System.EventHandler(this.docDteTextBox_TextChanged); this.invcCurrTextBox.Leave += new System.EventHandler(this.docDteTextBox_Leave); // // label19 // this.label19.AutoSize = true; this.label19.Location = new System.Drawing.Point(4, 67); this.label19.Name = "label19"; this.label19.Size = new System.Drawing.Size(93, 13); this.label19.TabIndex = 230; this.label19.Text = "Invoice Currency:"; // // invcCurrIDTextBox // this.invcCurrIDTextBox.Location = new System.Drawing.Point(155, 63); this.invcCurrIDTextBox.MaxLength = 200; this.invcCurrIDTextBox.Name = "invcCurrIDTextBox"; this.invcCurrIDTextBox.ReadOnly = true; this.invcCurrIDTextBox.Size = new System.Drawing.Size(95, 21); this.invcCurrIDTextBox.TabIndex = 4; this.invcCurrIDTextBox.TabStop = false; this.invcCurrIDTextBox.Text = "-1"; // // sponseeNmTextBox // this.sponseeNmTextBox.Location = new System.Drawing.Point(83, 40); this.sponseeNmTextBox.Name = "sponseeNmTextBox"; this.sponseeNmTextBox.Size = new System.Drawing.Size(168, 21); this.sponseeNmTextBox.TabIndex = 1; this.sponseeNmTextBox.TextChanged += new System.EventHandler(this.docDteTextBox_TextChanged); this.sponseeNmTextBox.Leave += new System.EventHandler(this.docDteTextBox_Leave); // // sponsorNmTextBox // this.sponsorNmTextBox.Location = new System.Drawing.Point(83, 17); this.sponsorNmTextBox.Name = "sponsorNmTextBox"; this.sponsorNmTextBox.Size = new System.Drawing.Size(168, 21); this.sponsorNmTextBox.TabIndex = 0; this.sponsorNmTextBox.TextChanged += new System.EventHandler(this.docDteTextBox_TextChanged); this.sponsorNmTextBox.Leave += new System.EventHandler(this.docDteTextBox_Leave); // // sponsorIDTextBox // this.sponsorIDTextBox.Location = new System.Drawing.Point(204, 17); this.sponsorIDTextBox.Name = "sponsorIDTextBox"; this.sponsorIDTextBox.ReadOnly = true; this.sponsorIDTextBox.Size = new System.Drawing.Size(33, 21); this.sponsorIDTextBox.TabIndex = 38; this.sponsorIDTextBox.Text = "-1"; // // sponsorSiteIDTextBox // this.sponsorSiteIDTextBox.Location = new System.Drawing.Point(149, 17); this.sponsorSiteIDTextBox.Name = "sponsorSiteIDTextBox"; this.sponsorSiteIDTextBox.ReadOnly = true; this.sponsorSiteIDTextBox.Size = new System.Drawing.Size(33, 21); this.sponsorSiteIDTextBox.TabIndex = 40; this.sponsorSiteIDTextBox.Text = "-1"; // // label8 // this.label8.AutoSize = true; this.label8.Location = new System.Drawing.Point(4, 134); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(40, 13); this.label8.TabIndex = 185; this.label8.Text = "Terms:"; // // prcdngToTextBox // this.prcdngToTextBox.Location = new System.Drawing.Point(187, 132); this.prcdngToTextBox.Name = "prcdngToTextBox"; this.prcdngToTextBox.Size = new System.Drawing.Size(92, 21); this.prcdngToTextBox.TabIndex = 10; this.prcdngToTextBox.Visible = false; // // arrvlFromTextBox // this.arrvlFromTextBox.Location = new System.Drawing.Point(83, 132); this.arrvlFromTextBox.Name = "arrvlFromTextBox"; this.arrvlFromTextBox.Size = new System.Drawing.Size(91, 21); this.arrvlFromTextBox.TabIndex = 9; this.arrvlFromTextBox.Visible = false; // // label11 // this.label11.AutoSize = true; this.label11.Location = new System.Drawing.Point(4, 137); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(79, 13); this.label11.TabIndex = 179; this.label11.Text = "Place From/To:"; this.label11.Visible = false; // // sponsorButton // this.sponsorButton.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.sponsorButton.ForeColor = System.Drawing.Color.Black; this.sponsorButton.Location = new System.Drawing.Point(251, 16); this.sponsorButton.Name = "sponsorButton"; this.sponsorButton.Size = new System.Drawing.Size(28, 22); this.sponsorButton.TabIndex = 1; this.sponsorButton.Text = "..."; this.sponsorButton.UseVisualStyleBackColor = true; this.sponsorButton.Click += new System.EventHandler(this.sponsorButton_Click); // // label9 // this.label9.AutoSize = true; this.label9.Location = new System.Drawing.Point(4, 21); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(50, 13); this.label9.TabIndex = 36; this.label9.Text = "Sponsor:"; // // sponseeButton // this.sponseeButton.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.sponseeButton.ForeColor = System.Drawing.Color.Black; this.sponseeButton.Location = new System.Drawing.Point(251, 39); this.sponseeButton.Name = "sponseeButton"; this.sponseeButton.Size = new System.Drawing.Size(28, 22); this.sponseeButton.TabIndex = 3; this.sponseeButton.Text = "..."; this.sponseeButton.UseVisualStyleBackColor = true; this.sponseeButton.Click += new System.EventHandler(this.sponseeButton_Click); // // sponseeIDTextBox // this.sponseeIDTextBox.Location = new System.Drawing.Point(230, 40); this.sponseeIDTextBox.Name = "sponseeIDTextBox"; this.sponseeIDTextBox.ReadOnly = true; this.sponseeIDTextBox.Size = new System.Drawing.Size(21, 21); this.sponseeIDTextBox.TabIndex = 14; this.sponseeIDTextBox.Text = "-1"; // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(4, 44); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(62, 13); this.label2.TabIndex = 13; this.label2.Text = "Participant:"; // // sponseeSiteIDTextBox // this.sponseeSiteIDTextBox.Location = new System.Drawing.Point(175, 40); this.sponseeSiteIDTextBox.Name = "sponseeSiteIDTextBox"; this.sponseeSiteIDTextBox.ReadOnly = true; this.sponseeSiteIDTextBox.Size = new System.Drawing.Size(21, 21); this.sponseeSiteIDTextBox.TabIndex = 2; this.sponseeSiteIDTextBox.Text = "-1"; // // label12 // this.label12.AutoSize = true; this.label12.Location = new System.Drawing.Point(175, 135); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(11, 13); this.label12.TabIndex = 181; this.label12.Text = "-"; this.label12.Visible = false; // // dataGridViewTextBoxColumn4 // dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle16.BackColor = System.Drawing.Color.Gainsboro; dataGridViewCellStyle16.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle16.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.dataGridViewTextBoxColumn4.DefaultCellStyle = dataGridViewCellStyle16; this.dataGridViewTextBoxColumn4.Frozen = true; this.dataGridViewTextBoxColumn4.HeaderText = "Item Code"; this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4"; this.dataGridViewTextBoxColumn4.ReadOnly = true; this.dataGridViewTextBoxColumn4.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn4.Width = 80; // // dataGridViewButtonColumn1 // this.dataGridViewButtonColumn1.Frozen = true; this.dataGridViewButtonColumn1.HeaderText = "..."; this.dataGridViewButtonColumn1.Name = "dataGridViewButtonColumn1"; this.dataGridViewButtonColumn1.Text = "..."; this.dataGridViewButtonColumn1.Width = 25; // // dataGridViewTextBoxColumn5 // dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle17.BackColor = System.Drawing.Color.Gainsboro; dataGridViewCellStyle17.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle17.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.dataGridViewTextBoxColumn5.DefaultCellStyle = dataGridViewCellStyle17; this.dataGridViewTextBoxColumn5.Frozen = true; this.dataGridViewTextBoxColumn5.HeaderText = "Item Description"; this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5"; this.dataGridViewTextBoxColumn5.ReadOnly = true; this.dataGridViewTextBoxColumn5.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn5.Width = 120; // // dataGridViewButtonColumn2 // this.dataGridViewButtonColumn2.Frozen = true; this.dataGridViewButtonColumn2.HeaderText = "..."; this.dataGridViewButtonColumn2.Name = "dataGridViewButtonColumn2"; this.dataGridViewButtonColumn2.Width = 25; // // dataGridViewTextBoxColumn7 // dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; dataGridViewCellStyle18.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128))))); dataGridViewCellStyle18.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle18.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.dataGridViewTextBoxColumn7.DefaultCellStyle = dataGridViewCellStyle18; this.dataGridViewTextBoxColumn7.Frozen = true; this.dataGridViewTextBoxColumn7.HeaderText = "Qty"; this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7"; this.dataGridViewTextBoxColumn7.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn7.Width = 40; // // dataGridViewTextBoxColumn8 // this.dataGridViewTextBoxColumn8.Frozen = true; this.dataGridViewTextBoxColumn8.HeaderText = "UOM"; this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8"; this.dataGridViewTextBoxColumn8.ReadOnly = true; this.dataGridViewTextBoxColumn8.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn8.Width = 50; // // dataGridViewButtonColumn3 // this.dataGridViewButtonColumn3.Frozen = true; this.dataGridViewButtonColumn3.HeaderText = "..."; this.dataGridViewButtonColumn3.Name = "dataGridViewButtonColumn3"; this.dataGridViewButtonColumn3.Width = 25; // // dataGridViewTextBoxColumn9 // dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; dataGridViewCellStyle19.BackColor = System.Drawing.Color.Gainsboro; dataGridViewCellStyle19.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.dataGridViewTextBoxColumn9.DefaultCellStyle = dataGridViewCellStyle19; this.dataGridViewTextBoxColumn9.Frozen = true; this.dataGridViewTextBoxColumn9.HeaderText = "Unit Price"; this.dataGridViewTextBoxColumn9.MaxInputLength = 500; this.dataGridViewTextBoxColumn9.Name = "dataGridViewTextBoxColumn9"; this.dataGridViewTextBoxColumn9.ReadOnly = true; this.dataGridViewTextBoxColumn9.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn9.Width = 50; // // dataGridViewTextBoxColumn10 // dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; dataGridViewCellStyle20.BackColor = System.Drawing.Color.Gainsboro; dataGridViewCellStyle20.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle20.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.dataGridViewTextBoxColumn10.DefaultCellStyle = dataGridViewCellStyle20; this.dataGridViewTextBoxColumn10.DividerWidth = 3; this.dataGridViewTextBoxColumn10.Frozen = true; this.dataGridViewTextBoxColumn10.HeaderText = "Amount"; this.dataGridViewTextBoxColumn10.MaxInputLength = 21; this.dataGridViewTextBoxColumn10.Name = "dataGridViewTextBoxColumn10"; this.dataGridViewTextBoxColumn10.ReadOnly = true; this.dataGridViewTextBoxColumn10.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn10.Width = 60; // // dataGridViewTextBoxColumn11 // this.dataGridViewTextBoxColumn11.HeaderText = "Avlbl. Source Doc. Qty"; this.dataGridViewTextBoxColumn11.Name = "dataGridViewTextBoxColumn11"; this.dataGridViewTextBoxColumn11.ReadOnly = true; this.dataGridViewTextBoxColumn11.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn11.Width = 50; // // dataGridViewTextBoxColumn12 // dataGridViewCellStyle21.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle21.BackColor = System.Drawing.Color.Gainsboro; dataGridViewCellStyle21.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle21.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.dataGridViewTextBoxColumn12.DefaultCellStyle = dataGridViewCellStyle21; this.dataGridViewTextBoxColumn12.HeaderText = "Consignment Nos."; this.dataGridViewTextBoxColumn12.Name = "dataGridViewTextBoxColumn12"; this.dataGridViewTextBoxColumn12.ReadOnly = true; this.dataGridViewTextBoxColumn12.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn12.Width = 75; // // dataGridViewButtonColumn4 // this.dataGridViewButtonColumn4.HeaderText = "..."; this.dataGridViewButtonColumn4.Name = "dataGridViewButtonColumn4"; this.dataGridViewButtonColumn4.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.dataGridViewButtonColumn4.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewButtonColumn4.Width = 25; // // dataGridViewTextBoxColumn13 // dataGridViewCellStyle22.BackColor = System.Drawing.Color.WhiteSmoke; dataGridViewCellStyle22.ForeColor = System.Drawing.Color.Black; this.dataGridViewTextBoxColumn13.DefaultCellStyle = dataGridViewCellStyle22; this.dataGridViewTextBoxColumn13.HeaderText = "itm_id"; this.dataGridViewTextBoxColumn13.Name = "dataGridViewTextBoxColumn13"; this.dataGridViewTextBoxColumn13.ReadOnly = true; this.dataGridViewTextBoxColumn13.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn13.Visible = false; // // dataGridViewTextBoxColumn14 // this.dataGridViewTextBoxColumn14.HeaderText = "Store_id"; this.dataGridViewTextBoxColumn14.Name = "dataGridViewTextBoxColumn14"; this.dataGridViewTextBoxColumn14.ReadOnly = true; this.dataGridViewTextBoxColumn14.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn14.Visible = false; // // dataGridViewTextBoxColumn15 // dataGridViewCellStyle23.BackColor = System.Drawing.Color.WhiteSmoke; this.dataGridViewTextBoxColumn15.DefaultCellStyle = dataGridViewCellStyle23; this.dataGridViewTextBoxColumn15.HeaderText = "crncyid"; this.dataGridViewTextBoxColumn15.Name = "dataGridViewTextBoxColumn15"; this.dataGridViewTextBoxColumn15.ReadOnly = true; this.dataGridViewTextBoxColumn15.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn15.Visible = false; // // dataGridViewTextBoxColumn16 // this.dataGridViewTextBoxColumn16.HeaderText = "line_id"; this.dataGridViewTextBoxColumn16.Name = "dataGridViewTextBoxColumn16"; this.dataGridViewTextBoxColumn16.ReadOnly = true; this.dataGridViewTextBoxColumn16.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn16.Visible = false; // // dataGridViewTextBoxColumn17 // this.dataGridViewTextBoxColumn17.HeaderText = "src_line_id"; this.dataGridViewTextBoxColumn17.Name = "dataGridViewTextBoxColumn17"; this.dataGridViewTextBoxColumn17.ReadOnly = true; this.dataGridViewTextBoxColumn17.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn17.Visible = false; // // dataGridViewTextBoxColumn18 // this.dataGridViewTextBoxColumn18.HeaderText = "Tax Code"; this.dataGridViewTextBoxColumn18.Name = "dataGridViewTextBoxColumn18"; this.dataGridViewTextBoxColumn18.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn18.Width = 40; // // dataGridViewButtonColumn5 // this.dataGridViewButtonColumn5.HeaderText = "..."; this.dataGridViewButtonColumn5.Name = "dataGridViewButtonColumn5"; this.dataGridViewButtonColumn5.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewButtonColumn5.Text = "..."; this.dataGridViewButtonColumn5.Width = 25; // // dataGridViewTextBoxColumn19 // this.dataGridViewTextBoxColumn19.HeaderText = "taxCodeID"; this.dataGridViewTextBoxColumn19.Name = "dataGridViewTextBoxColumn19"; this.dataGridViewTextBoxColumn19.ReadOnly = true; this.dataGridViewTextBoxColumn19.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn19.Visible = false; // // dataGridViewTextBoxColumn20 // this.dataGridViewTextBoxColumn20.HeaderText = "Discount Code"; this.dataGridViewTextBoxColumn20.Name = "dataGridViewTextBoxColumn20"; this.dataGridViewTextBoxColumn20.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn20.Width = 55; // // dataGridViewButtonColumn6 // this.dataGridViewButtonColumn6.HeaderText = "..."; this.dataGridViewButtonColumn6.Name = "dataGridViewButtonColumn6"; this.dataGridViewButtonColumn6.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewButtonColumn6.Text = "..."; this.dataGridViewButtonColumn6.Width = 25; // // dataGridViewTextBoxColumn21 // this.dataGridViewTextBoxColumn21.HeaderText = "dscntID"; this.dataGridViewTextBoxColumn21.Name = "dataGridViewTextBoxColumn21"; this.dataGridViewTextBoxColumn21.ReadOnly = true; this.dataGridViewTextBoxColumn21.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn21.Visible = false; // // dataGridViewTextBoxColumn22 // this.dataGridViewTextBoxColumn22.HeaderText = "Extra Charge Code"; this.dataGridViewTextBoxColumn22.Name = "dataGridViewTextBoxColumn22"; this.dataGridViewTextBoxColumn22.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn22.Width = 55; // // dataGridViewButtonColumn7 // this.dataGridViewButtonColumn7.HeaderText = "..."; this.dataGridViewButtonColumn7.Name = "dataGridViewButtonColumn7"; this.dataGridViewButtonColumn7.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewButtonColumn7.Text = "..."; this.dataGridViewButtonColumn7.Width = 25; // // dataGridViewTextBoxColumn23 // this.dataGridViewTextBoxColumn23.HeaderText = "chargeID"; this.dataGridViewTextBoxColumn23.Name = "dataGridViewTextBoxColumn23"; this.dataGridViewTextBoxColumn23.ReadOnly = true; this.dataGridViewTextBoxColumn23.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn23.Visible = false; // // dataGridViewTextBoxColumn24 // dataGridViewCellStyle24.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle24.BackColor = System.Drawing.Color.Gainsboro; dataGridViewCellStyle24.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle24.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.dataGridViewTextBoxColumn24.DefaultCellStyle = dataGridViewCellStyle24; this.dataGridViewTextBoxColumn24.HeaderText = "Return Reason"; this.dataGridViewTextBoxColumn24.Name = "dataGridViewTextBoxColumn24"; this.dataGridViewTextBoxColumn24.ReadOnly = true; this.dataGridViewTextBoxColumn24.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn24.Visible = false; this.dataGridViewTextBoxColumn24.Width = 300; // // dataGridViewTextBoxColumn25 // dataGridViewCellStyle25.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle25.BackColor = System.Drawing.Color.Gainsboro; dataGridViewCellStyle25.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle25.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.dataGridViewTextBoxColumn25.DefaultCellStyle = dataGridViewCellStyle25; this.dataGridViewTextBoxColumn25.Frozen = true; this.dataGridViewTextBoxColumn25.HeaderText = "Item Code"; this.dataGridViewTextBoxColumn25.Name = "dataGridViewTextBoxColumn25"; this.dataGridViewTextBoxColumn25.ReadOnly = true; this.dataGridViewTextBoxColumn25.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn25.Width = 80; // // dataGridViewButtonColumn8 // this.dataGridViewButtonColumn8.Frozen = true; this.dataGridViewButtonColumn8.HeaderText = "..."; this.dataGridViewButtonColumn8.Name = "dataGridViewButtonColumn8"; this.dataGridViewButtonColumn8.Text = "..."; this.dataGridViewButtonColumn8.Width = 25; // // dataGridViewTextBoxColumn26 // dataGridViewCellStyle26.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle26.BackColor = System.Drawing.Color.Gainsboro; dataGridViewCellStyle26.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle26.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.dataGridViewTextBoxColumn26.DefaultCellStyle = dataGridViewCellStyle26; this.dataGridViewTextBoxColumn26.Frozen = true; this.dataGridViewTextBoxColumn26.HeaderText = "Item Description"; this.dataGridViewTextBoxColumn26.Name = "dataGridViewTextBoxColumn26"; this.dataGridViewTextBoxColumn26.ReadOnly = true; this.dataGridViewTextBoxColumn26.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn26.Width = 120; // // dataGridViewButtonColumn9 // this.dataGridViewButtonColumn9.Frozen = true; this.dataGridViewButtonColumn9.HeaderText = "..."; this.dataGridViewButtonColumn9.Name = "dataGridViewButtonColumn9"; this.dataGridViewButtonColumn9.Width = 25; // // dataGridViewTextBoxColumn27 // dataGridViewCellStyle27.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; dataGridViewCellStyle27.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128))))); dataGridViewCellStyle27.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle27.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.dataGridViewTextBoxColumn27.DefaultCellStyle = dataGridViewCellStyle27; this.dataGridViewTextBoxColumn27.Frozen = true; this.dataGridViewTextBoxColumn27.HeaderText = "Qty"; this.dataGridViewTextBoxColumn27.Name = "dataGridViewTextBoxColumn27"; this.dataGridViewTextBoxColumn27.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn27.Width = 40; // // dataGridViewTextBoxColumn28 // this.dataGridViewTextBoxColumn28.Frozen = true; this.dataGridViewTextBoxColumn28.HeaderText = "UOM"; this.dataGridViewTextBoxColumn28.Name = "dataGridViewTextBoxColumn28"; this.dataGridViewTextBoxColumn28.ReadOnly = true; this.dataGridViewTextBoxColumn28.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn28.Width = 50; // // dataGridViewButtonColumn10 // this.dataGridViewButtonColumn10.Frozen = true; this.dataGridViewButtonColumn10.HeaderText = "..."; this.dataGridViewButtonColumn10.Name = "dataGridViewButtonColumn10"; this.dataGridViewButtonColumn10.Width = 25; // // dataGridViewTextBoxColumn29 // dataGridViewCellStyle28.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; dataGridViewCellStyle28.BackColor = System.Drawing.Color.Gainsboro; dataGridViewCellStyle28.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle28.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.dataGridViewTextBoxColumn29.DefaultCellStyle = dataGridViewCellStyle28; this.dataGridViewTextBoxColumn29.Frozen = true; this.dataGridViewTextBoxColumn29.HeaderText = "Unit Price"; this.dataGridViewTextBoxColumn29.MaxInputLength = 500; this.dataGridViewTextBoxColumn29.Name = "dataGridViewTextBoxColumn29"; this.dataGridViewTextBoxColumn29.ReadOnly = true; this.dataGridViewTextBoxColumn29.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn29.Width = 50; // // dataGridViewTextBoxColumn30 // dataGridViewCellStyle29.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; dataGridViewCellStyle29.BackColor = System.Drawing.Color.Gainsboro; dataGridViewCellStyle29.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle29.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.dataGridViewTextBoxColumn30.DefaultCellStyle = dataGridViewCellStyle29; this.dataGridViewTextBoxColumn30.DividerWidth = 3; this.dataGridViewTextBoxColumn30.Frozen = true; this.dataGridViewTextBoxColumn30.HeaderText = "Amount"; this.dataGridViewTextBoxColumn30.MaxInputLength = 21; this.dataGridViewTextBoxColumn30.Name = "dataGridViewTextBoxColumn30"; this.dataGridViewTextBoxColumn30.ReadOnly = true; this.dataGridViewTextBoxColumn30.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn30.Width = 60; // // dataGridViewTextBoxColumn31 // this.dataGridViewTextBoxColumn31.HeaderText = "Avlbl. Source Doc. Qty"; this.dataGridViewTextBoxColumn31.Name = "dataGridViewTextBoxColumn31"; this.dataGridViewTextBoxColumn31.ReadOnly = true; this.dataGridViewTextBoxColumn31.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn31.Width = 50; // // dataGridViewTextBoxColumn32 // dataGridViewCellStyle30.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle30.BackColor = System.Drawing.Color.Gainsboro; dataGridViewCellStyle30.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle30.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.dataGridViewTextBoxColumn32.DefaultCellStyle = dataGridViewCellStyle30; this.dataGridViewTextBoxColumn32.HeaderText = "Consignment Nos."; this.dataGridViewTextBoxColumn32.Name = "dataGridViewTextBoxColumn32"; this.dataGridViewTextBoxColumn32.ReadOnly = true; this.dataGridViewTextBoxColumn32.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn32.Width = 75; // // dataGridViewButtonColumn11 // this.dataGridViewButtonColumn11.HeaderText = "..."; this.dataGridViewButtonColumn11.Name = "dataGridViewButtonColumn11"; this.dataGridViewButtonColumn11.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.dataGridViewButtonColumn11.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewButtonColumn11.Width = 25; // // dataGridViewTextBoxColumn33 // dataGridViewCellStyle31.BackColor = System.Drawing.Color.WhiteSmoke; dataGridViewCellStyle31.ForeColor = System.Drawing.Color.Black; this.dataGridViewTextBoxColumn33.DefaultCellStyle = dataGridViewCellStyle31; this.dataGridViewTextBoxColumn33.HeaderText = "itm_id"; this.dataGridViewTextBoxColumn33.Name = "dataGridViewTextBoxColumn33"; this.dataGridViewTextBoxColumn33.ReadOnly = true; this.dataGridViewTextBoxColumn33.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn33.Visible = false; // // dataGridViewTextBoxColumn34 // this.dataGridViewTextBoxColumn34.HeaderText = "Store_id"; this.dataGridViewTextBoxColumn34.Name = "dataGridViewTextBoxColumn34"; this.dataGridViewTextBoxColumn34.ReadOnly = true; this.dataGridViewTextBoxColumn34.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn34.Visible = false; // // dataGridViewTextBoxColumn35 // dataGridViewCellStyle32.BackColor = System.Drawing.Color.WhiteSmoke; this.dataGridViewTextBoxColumn35.DefaultCellStyle = dataGridViewCellStyle32; this.dataGridViewTextBoxColumn35.HeaderText = "crncyid"; this.dataGridViewTextBoxColumn35.Name = "dataGridViewTextBoxColumn35"; this.dataGridViewTextBoxColumn35.ReadOnly = true; this.dataGridViewTextBoxColumn35.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn35.Visible = false; // // dataGridViewTextBoxColumn36 // this.dataGridViewTextBoxColumn36.HeaderText = "line_id"; this.dataGridViewTextBoxColumn36.Name = "dataGridViewTextBoxColumn36"; this.dataGridViewTextBoxColumn36.ReadOnly = true; this.dataGridViewTextBoxColumn36.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn36.Visible = false; // // dataGridViewTextBoxColumn37 // this.dataGridViewTextBoxColumn37.HeaderText = "src_line_id"; this.dataGridViewTextBoxColumn37.Name = "dataGridViewTextBoxColumn37"; this.dataGridViewTextBoxColumn37.ReadOnly = true; this.dataGridViewTextBoxColumn37.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn37.Visible = false; // // dataGridViewTextBoxColumn38 // this.dataGridViewTextBoxColumn38.HeaderText = "Tax Code"; this.dataGridViewTextBoxColumn38.Name = "dataGridViewTextBoxColumn38"; this.dataGridViewTextBoxColumn38.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn38.Width = 40; // // dataGridViewButtonColumn12 // this.dataGridViewButtonColumn12.HeaderText = "..."; this.dataGridViewButtonColumn12.Name = "dataGridViewButtonColumn12"; this.dataGridViewButtonColumn12.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewButtonColumn12.Text = "..."; this.dataGridViewButtonColumn12.Width = 25; // // dataGridViewTextBoxColumn39 // this.dataGridViewTextBoxColumn39.HeaderText = "taxCodeID"; this.dataGridViewTextBoxColumn39.Name = "dataGridViewTextBoxColumn39"; this.dataGridViewTextBoxColumn39.ReadOnly = true; this.dataGridViewTextBoxColumn39.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn39.Visible = false; // // dataGridViewTextBoxColumn40 // this.dataGridViewTextBoxColumn40.HeaderText = "Discount Code"; this.dataGridViewTextBoxColumn40.Name = "dataGridViewTextBoxColumn40"; this.dataGridViewTextBoxColumn40.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn40.Width = 55; // // dataGridViewButtonColumn13 // this.dataGridViewButtonColumn13.HeaderText = "..."; this.dataGridViewButtonColumn13.Name = "dataGridViewButtonColumn13"; this.dataGridViewButtonColumn13.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewButtonColumn13.Text = "..."; this.dataGridViewButtonColumn13.Width = 25; // // dataGridViewTextBoxColumn41 // this.dataGridViewTextBoxColumn41.HeaderText = "dscntID"; this.dataGridViewTextBoxColumn41.Name = "dataGridViewTextBoxColumn41"; this.dataGridViewTextBoxColumn41.ReadOnly = true; this.dataGridViewTextBoxColumn41.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn41.Visible = false; // // dataGridViewTextBoxColumn42 // this.dataGridViewTextBoxColumn42.HeaderText = "Extra Charge Code"; this.dataGridViewTextBoxColumn42.Name = "dataGridViewTextBoxColumn42"; this.dataGridViewTextBoxColumn42.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn42.Width = 55; // // dataGridViewButtonColumn14 // this.dataGridViewButtonColumn14.HeaderText = "..."; this.dataGridViewButtonColumn14.Name = "dataGridViewButtonColumn14"; this.dataGridViewButtonColumn14.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewButtonColumn14.Text = "..."; this.dataGridViewButtonColumn14.Width = 25; // // dataGridViewTextBoxColumn43 // this.dataGridViewTextBoxColumn43.HeaderText = "chargeID"; this.dataGridViewTextBoxColumn43.Name = "dataGridViewTextBoxColumn43"; this.dataGridViewTextBoxColumn43.ReadOnly = true; this.dataGridViewTextBoxColumn43.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn43.Visible = false; // // dataGridViewTextBoxColumn44 // dataGridViewCellStyle33.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle33.BackColor = System.Drawing.Color.Gainsboro; dataGridViewCellStyle33.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle33.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.dataGridViewTextBoxColumn44.DefaultCellStyle = dataGridViewCellStyle33; this.dataGridViewTextBoxColumn44.HeaderText = "Return Reason"; this.dataGridViewTextBoxColumn44.Name = "dataGridViewTextBoxColumn44"; this.dataGridViewTextBoxColumn44.ReadOnly = true; this.dataGridViewTextBoxColumn44.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn44.Visible = false; this.dataGridViewTextBoxColumn44.Width = 300; // // dataGridViewTextBoxColumn45 // dataGridViewCellStyle34.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle34.BackColor = System.Drawing.Color.Gainsboro; dataGridViewCellStyle34.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle34.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.dataGridViewTextBoxColumn45.DefaultCellStyle = dataGridViewCellStyle34; this.dataGridViewTextBoxColumn45.Frozen = true; this.dataGridViewTextBoxColumn45.HeaderText = "Item Code"; this.dataGridViewTextBoxColumn45.Name = "dataGridViewTextBoxColumn45"; this.dataGridViewTextBoxColumn45.ReadOnly = true; this.dataGridViewTextBoxColumn45.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn45.Width = 80; // // dataGridViewButtonColumn15 // this.dataGridViewButtonColumn15.Frozen = true; this.dataGridViewButtonColumn15.HeaderText = "..."; this.dataGridViewButtonColumn15.Name = "dataGridViewButtonColumn15"; this.dataGridViewButtonColumn15.Text = "..."; this.dataGridViewButtonColumn15.Width = 25; // // dataGridViewTextBoxColumn46 // dataGridViewCellStyle35.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle35.BackColor = System.Drawing.Color.Gainsboro; dataGridViewCellStyle35.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle35.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.dataGridViewTextBoxColumn46.DefaultCellStyle = dataGridViewCellStyle35; this.dataGridViewTextBoxColumn46.Frozen = true; this.dataGridViewTextBoxColumn46.HeaderText = "Item Description"; this.dataGridViewTextBoxColumn46.Name = "dataGridViewTextBoxColumn46"; this.dataGridViewTextBoxColumn46.ReadOnly = true; this.dataGridViewTextBoxColumn46.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn46.Width = 120; // // dataGridViewButtonColumn16 // this.dataGridViewButtonColumn16.Frozen = true; this.dataGridViewButtonColumn16.HeaderText = "..."; this.dataGridViewButtonColumn16.Name = "dataGridViewButtonColumn16"; this.dataGridViewButtonColumn16.Width = 25; // // dataGridViewTextBoxColumn47 // dataGridViewCellStyle36.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; dataGridViewCellStyle36.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128))))); dataGridViewCellStyle36.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle36.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.dataGridViewTextBoxColumn47.DefaultCellStyle = dataGridViewCellStyle36; this.dataGridViewTextBoxColumn47.Frozen = true; this.dataGridViewTextBoxColumn47.HeaderText = "Qty"; this.dataGridViewTextBoxColumn47.Name = "dataGridViewTextBoxColumn47"; this.dataGridViewTextBoxColumn47.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn47.Width = 40; // // dataGridViewTextBoxColumn48 // this.dataGridViewTextBoxColumn48.Frozen = true; this.dataGridViewTextBoxColumn48.HeaderText = "UOM"; this.dataGridViewTextBoxColumn48.Name = "dataGridViewTextBoxColumn48"; this.dataGridViewTextBoxColumn48.ReadOnly = true; this.dataGridViewTextBoxColumn48.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn48.Width = 50; // // dataGridViewButtonColumn17 // this.dataGridViewButtonColumn17.Frozen = true; this.dataGridViewButtonColumn17.HeaderText = "..."; this.dataGridViewButtonColumn17.Name = "dataGridViewButtonColumn17"; this.dataGridViewButtonColumn17.Width = 25; // // dataGridViewTextBoxColumn49 // dataGridViewCellStyle37.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; dataGridViewCellStyle37.BackColor = System.Drawing.Color.Gainsboro; dataGridViewCellStyle37.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle37.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.dataGridViewTextBoxColumn49.DefaultCellStyle = dataGridViewCellStyle37; this.dataGridViewTextBoxColumn49.Frozen = true; this.dataGridViewTextBoxColumn49.HeaderText = "Unit Price"; this.dataGridViewTextBoxColumn49.MaxInputLength = 500; this.dataGridViewTextBoxColumn49.Name = "dataGridViewTextBoxColumn49"; this.dataGridViewTextBoxColumn49.ReadOnly = true; this.dataGridViewTextBoxColumn49.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn49.Width = 50; // // dataGridViewTextBoxColumn50 // dataGridViewCellStyle38.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; dataGridViewCellStyle38.BackColor = System.Drawing.Color.Gainsboro; dataGridViewCellStyle38.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle38.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.dataGridViewTextBoxColumn50.DefaultCellStyle = dataGridViewCellStyle38; this.dataGridViewTextBoxColumn50.DividerWidth = 3; this.dataGridViewTextBoxColumn50.Frozen = true; this.dataGridViewTextBoxColumn50.HeaderText = "Amount"; this.dataGridViewTextBoxColumn50.MaxInputLength = 21; this.dataGridViewTextBoxColumn50.Name = "dataGridViewTextBoxColumn50"; this.dataGridViewTextBoxColumn50.ReadOnly = true; this.dataGridViewTextBoxColumn50.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn50.Width = 60; // // dataGridViewTextBoxColumn51 // this.dataGridViewTextBoxColumn51.HeaderText = "Avlbl. Source Doc. Qty"; this.dataGridViewTextBoxColumn51.Name = "dataGridViewTextBoxColumn51"; this.dataGridViewTextBoxColumn51.ReadOnly = true; this.dataGridViewTextBoxColumn51.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn51.Width = 50; // // dataGridViewTextBoxColumn52 // dataGridViewCellStyle39.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle39.BackColor = System.Drawing.Color.Gainsboro; dataGridViewCellStyle39.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle39.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.dataGridViewTextBoxColumn52.DefaultCellStyle = dataGridViewCellStyle39; this.dataGridViewTextBoxColumn52.HeaderText = "Consignment Nos."; this.dataGridViewTextBoxColumn52.Name = "dataGridViewTextBoxColumn52"; this.dataGridViewTextBoxColumn52.ReadOnly = true; this.dataGridViewTextBoxColumn52.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn52.Width = 75; // // dataGridViewButtonColumn18 // this.dataGridViewButtonColumn18.HeaderText = "..."; this.dataGridViewButtonColumn18.Name = "dataGridViewButtonColumn18"; this.dataGridViewButtonColumn18.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.dataGridViewButtonColumn18.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewButtonColumn18.Width = 25; // // dataGridViewTextBoxColumn53 // dataGridViewCellStyle40.BackColor = System.Drawing.Color.WhiteSmoke; dataGridViewCellStyle40.ForeColor = System.Drawing.Color.Black; this.dataGridViewTextBoxColumn53.DefaultCellStyle = dataGridViewCellStyle40; this.dataGridViewTextBoxColumn53.HeaderText = "itm_id"; this.dataGridViewTextBoxColumn53.Name = "dataGridViewTextBoxColumn53"; this.dataGridViewTextBoxColumn53.ReadOnly = true; this.dataGridViewTextBoxColumn53.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn53.Visible = false; // // dataGridViewTextBoxColumn54 // this.dataGridViewTextBoxColumn54.HeaderText = "Store_id"; this.dataGridViewTextBoxColumn54.Name = "dataGridViewTextBoxColumn54"; this.dataGridViewTextBoxColumn54.ReadOnly = true; this.dataGridViewTextBoxColumn54.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn54.Visible = false; // // dataGridViewTextBoxColumn55 // dataGridViewCellStyle41.BackColor = System.Drawing.Color.WhiteSmoke; this.dataGridViewTextBoxColumn55.DefaultCellStyle = dataGridViewCellStyle41; this.dataGridViewTextBoxColumn55.HeaderText = "crncyid"; this.dataGridViewTextBoxColumn55.Name = "dataGridViewTextBoxColumn55"; this.dataGridViewTextBoxColumn55.ReadOnly = true; this.dataGridViewTextBoxColumn55.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn55.Visible = false; // // dataGridViewTextBoxColumn56 // this.dataGridViewTextBoxColumn56.HeaderText = "line_id"; this.dataGridViewTextBoxColumn56.Name = "dataGridViewTextBoxColumn56"; this.dataGridViewTextBoxColumn56.ReadOnly = true; this.dataGridViewTextBoxColumn56.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn56.Visible = false; // // dataGridViewTextBoxColumn57 // this.dataGridViewTextBoxColumn57.HeaderText = "src_line_id"; this.dataGridViewTextBoxColumn57.Name = "dataGridViewTextBoxColumn57"; this.dataGridViewTextBoxColumn57.ReadOnly = true; this.dataGridViewTextBoxColumn57.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn57.Visible = false; // // dataGridViewTextBoxColumn58 // this.dataGridViewTextBoxColumn58.HeaderText = "Tax Code"; this.dataGridViewTextBoxColumn58.Name = "dataGridViewTextBoxColumn58"; this.dataGridViewTextBoxColumn58.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn58.Width = 40; // // dataGridViewButtonColumn19 // this.dataGridViewButtonColumn19.HeaderText = "..."; this.dataGridViewButtonColumn19.Name = "dataGridViewButtonColumn19"; this.dataGridViewButtonColumn19.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewButtonColumn19.Text = "..."; this.dataGridViewButtonColumn19.Width = 25; // // dataGridViewTextBoxColumn59 // this.dataGridViewTextBoxColumn59.HeaderText = "taxCodeID"; this.dataGridViewTextBoxColumn59.Name = "dataGridViewTextBoxColumn59"; this.dataGridViewTextBoxColumn59.ReadOnly = true; this.dataGridViewTextBoxColumn59.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn59.Visible = false; // // dataGridViewTextBoxColumn60 // this.dataGridViewTextBoxColumn60.HeaderText = "Discount Code"; this.dataGridViewTextBoxColumn60.Name = "dataGridViewTextBoxColumn60"; this.dataGridViewTextBoxColumn60.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn60.Width = 55; // // dataGridViewButtonColumn20 // this.dataGridViewButtonColumn20.HeaderText = "..."; this.dataGridViewButtonColumn20.Name = "dataGridViewButtonColumn20"; this.dataGridViewButtonColumn20.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewButtonColumn20.Text = "..."; this.dataGridViewButtonColumn20.Width = 25; // // dataGridViewTextBoxColumn61 // this.dataGridViewTextBoxColumn61.HeaderText = "dscntID"; this.dataGridViewTextBoxColumn61.Name = "dataGridViewTextBoxColumn61"; this.dataGridViewTextBoxColumn61.ReadOnly = true; this.dataGridViewTextBoxColumn61.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn61.Visible = false; // // dataGridViewTextBoxColumn62 // this.dataGridViewTextBoxColumn62.HeaderText = "Extra Charge Code"; this.dataGridViewTextBoxColumn62.Name = "dataGridViewTextBoxColumn62"; this.dataGridViewTextBoxColumn62.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn62.Width = 55; // // dataGridViewButtonColumn21 // this.dataGridViewButtonColumn21.HeaderText = "..."; this.dataGridViewButtonColumn21.Name = "dataGridViewButtonColumn21"; this.dataGridViewButtonColumn21.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewButtonColumn21.Text = "..."; this.dataGridViewButtonColumn21.Width = 25; // // dataGridViewTextBoxColumn63 // this.dataGridViewTextBoxColumn63.HeaderText = "chargeID"; this.dataGridViewTextBoxColumn63.Name = "dataGridViewTextBoxColumn63"; this.dataGridViewTextBoxColumn63.ReadOnly = true; this.dataGridViewTextBoxColumn63.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn63.Visible = false; // // dataGridViewTextBoxColumn64 // dataGridViewCellStyle42.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle42.BackColor = System.Drawing.Color.Gainsboro; dataGridViewCellStyle42.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle42.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.dataGridViewTextBoxColumn64.DefaultCellStyle = dataGridViewCellStyle42; this.dataGridViewTextBoxColumn64.HeaderText = "Return Reason"; this.dataGridViewTextBoxColumn64.Name = "dataGridViewTextBoxColumn64"; this.dataGridViewTextBoxColumn64.ReadOnly = true; this.dataGridViewTextBoxColumn64.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.dataGridViewTextBoxColumn64.Visible = false; this.dataGridViewTextBoxColumn64.Width = 300; // // backgroundWorker2 // this.backgroundWorker2.WorkerReportsProgress = true; this.backgroundWorker2.WorkerSupportsCancellation = true; this.backgroundWorker2.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorker2_DoWork); this.backgroundWorker2.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.backgroundWorker2_ProgressChanged); this.backgroundWorker2.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.backgroundWorker2_RunWorkerCompleted); // // printDialog1 // this.printDialog1.UseEXDialog = true; // // backgroundWorker1 // this.backgroundWorker1.WorkerReportsProgress = true; this.backgroundWorker1.WorkerSupportsCancellation = true; this.backgroundWorker1.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorker1_DoWork); this.backgroundWorker1.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.backgroundWorker1_ProgressChanged); this.backgroundWorker1.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.backgroundWorker1_RunWorkerCompleted); // // timer1 // this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // // printDocument1 // this.printDocument1.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printDocument1_PrintPage); // // printPreviewDialog1 // this.printPreviewDialog1.AutoScrollMargin = new System.Drawing.Size(0, 0); this.printPreviewDialog1.AutoScrollMinSize = new System.Drawing.Size(0, 0); this.printPreviewDialog1.ClientSize = new System.Drawing.Size(400, 300); this.printPreviewDialog1.Enabled = true; this.printPreviewDialog1.Icon = ((System.Drawing.Icon)(resources.GetObject("printPreviewDialog1.Icon"))); this.printPreviewDialog1.Name = "printPreviewDialog1"; this.printPreviewDialog1.ShowIcon = false; this.printPreviewDialog1.UseAntiAlias = true; this.printPreviewDialog1.Visible = false; // // printDocument2 // this.printDocument2.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printDocument2_PrintPage); // // checkinsForm // this.BackColor = System.Drawing.SystemColors.GradientActiveCaption; this.ClientSize = new System.Drawing.Size(1133, 634); this.Controls.Add(this.panel1); this.DockAreas = WeifenLuo.WinFormsUI.Docking.DockAreas.Document; this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.KeyPreview = true; this.MinimizeBox = false; this.Name = "checkinsForm"; this.ShowIcon = false; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.TabText = "Event Bookings/Registrations/Check Ins"; this.Text = "Event Bookings/Registrations/Check Ins"; this.Load += new System.EventHandler(this.wfnItmLstForm_Load); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.checkinsForm_KeyDown); this.panel1.ResumeLayout(false); this.groupBox4.ResumeLayout(false); this.groupBox4.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.smmryDataGridView)).EndInit(); this.smmryContextMenuStrip.ResumeLayout(false); this.toolStrip3.ResumeLayout(false); this.toolStrip3.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.itemsDataGridView)).EndInit(); this.docDtContextMenuStrip.ResumeLayout(false); this.toolStrip2.ResumeLayout(false); this.toolStrip2.PerformLayout(); this.toolStrip1.ResumeLayout(false); this.toolStrip1.PerformLayout(); this.groupBox5.ResumeLayout(false); this.groupBox5.PerformLayout(); this.docContextMenuStrip.ResumeLayout(false); this.groupBox6.ResumeLayout(false); this.groupBox7.ResumeLayout(false); this.groupBox3.ResumeLayout(false); this.groupBox3.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.noOfAdultsNumUpDwn)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.noOfChdrnNumUpDwn)).EndInit(); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.exchRateNumUpDwn)).EndInit(); this.ResumeLayout(false); } #endregion private System.Windows.Forms.Panel panel1; private System.Windows.Forms.GroupBox groupBox2; private System.Windows.Forms.GroupBox groupBox3; private System.Windows.Forms.ToolStrip toolStrip1; private System.Windows.Forms.ToolStripButton moveFirstButton; private System.Windows.Forms.ToolStripButton movePreviousButton; private System.Windows.Forms.ToolStripLabel toolStripLabel1; private System.Windows.Forms.ToolStripTextBox positionTextBox; private System.Windows.Forms.ToolStripLabel totalRecsLabel; private System.Windows.Forms.ToolStripButton moveNextButton; private System.Windows.Forms.ToolStripButton moveLastButton; private System.Windows.Forms.ToolStripComboBox dsplySizeComboBox; private System.Windows.Forms.ToolStripButton editButton; private System.Windows.Forms.ToolStripButton deleteButton; private System.Windows.Forms.ToolStripButton saveButton; private System.Windows.Forms.ToolStripLabel toolStripLabel3; private System.Windows.Forms.ToolStripLabel toolStripLabel4; private System.Windows.Forms.GroupBox groupBox6; private System.Windows.Forms.Button checkOutButton; private System.Windows.Forms.GroupBox groupBox7; private System.Windows.Forms.Button takeDepositsButton; private System.Windows.Forms.Label label7; private System.Windows.Forms.GroupBox groupBox8; private System.Windows.Forms.Button endDteButton; private System.Windows.Forms.Button strtDteButton; public System.Windows.Forms.TextBox endDteTextBox; public System.Windows.Forms.TextBox strtDteTextBox; private System.Windows.Forms.Label label78; private System.Windows.Forms.Label label79; private System.Windows.Forms.TextBox sponseeIDTextBox; private System.Windows.Forms.Label label2; private System.Windows.Forms.TextBox sponseeNmTextBox; private System.Windows.Forms.Button sponseeButton; private System.Windows.Forms.Button roomNumButton; private System.Windows.Forms.ImageList imageList1; private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; private System.Windows.Forms.ToolStripSeparator toolStripSeparator5; private System.Windows.Forms.ToolStripSeparator toolStripSeparator6; private System.Windows.Forms.ToolStripSeparator toolStripSeparator7; private System.Windows.Forms.TextBox sponsorNmTextBox; private System.Windows.Forms.TextBox sponsorIDTextBox; private System.Windows.Forms.Button sponsorButton; private System.Windows.Forms.Label label9; private System.Windows.Forms.TextBox sponsorSiteIDTextBox; private System.Windows.Forms.TextBox sponseeSiteIDTextBox; private System.Windows.Forms.Button attnRegisterButton; private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label10; private System.Windows.Forms.NumericUpDown noOfChdrnNumUpDwn; private System.Windows.Forms.NumericUpDown noOfAdultsNumUpDwn; private System.Windows.Forms.TextBox arrvlFromTextBox; private System.Windows.Forms.Label label11; private System.Windows.Forms.TextBox prcdngToTextBox; private System.Windows.Forms.Label label12; private System.Windows.Forms.TextBox createdByTextBox; private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label14; private System.Windows.Forms.TextBox pymntTermsTextBox; private System.Windows.Forms.Label label8; private System.Windows.Forms.Button cmplntsButton; private System.Windows.Forms.GroupBox groupBox5; public System.Windows.Forms.ListView checkInsListView; private System.Windows.Forms.ColumnHeader columnHeader3; private System.Windows.Forms.ColumnHeader columnHeader1; private System.Windows.Forms.ColumnHeader columnHeader2; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.ToolStrip toolStrip2; private System.Windows.Forms.ToolStripButton addDtButton; private System.Windows.Forms.ToolStripSeparator toolStripSeparator8; private System.Windows.Forms.ToolStripButton delDtButton; private System.Windows.Forms.ToolStripSeparator toolStripSeparator11; private System.Windows.Forms.ToolStripButton vwSQLDtButton; private System.Windows.Forms.ToolStripSeparator toolStripSeparator12; private System.Windows.Forms.ToolStripButton rcHstryDtButton; private System.Windows.Forms.ToolStripSeparator toolStripSeparator13; private System.Windows.Forms.ToolStripButton rfrshDtButton; private System.Windows.Forms.ToolStripSeparator toolStripSeparator14; private System.Windows.Forms.ToolStripButton prvwInvoiceButton; private System.Windows.Forms.ToolStripButton printInvoiceButton; private System.Windows.Forms.ToolStripButton printInvcButton1; private System.Windows.Forms.ToolStripButton vwExtraInfoButton; private System.Windows.Forms.ToolStripButton vwAttchmntsButton; private System.Windows.Forms.GroupBox groupBox4; private System.Windows.Forms.DataGridView smmryDataGridView; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn6; private System.Windows.Forms.DataGridViewTextBoxColumn Column10; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn2; private System.Windows.Forms.DataGridViewCheckBoxColumn dataGridViewCheckBoxColumn1; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn3; private System.Windows.Forms.ToolStrip toolStrip3; private System.Windows.Forms.ToolStripButton rcHstrySmryButton; private System.Windows.Forms.ToolStripButton calcSmryButton; private System.Windows.Forms.ToolStripSeparator toolStripSeparator18; private System.Windows.Forms.ToolStripButton delSmryButton; private System.Windows.Forms.ToolStripButton printPrvwRcptButton; private System.Windows.Forms.ToolStripButton printRcptButton1; private System.Windows.Forms.ToolStripButton printRcptButton; private System.Windows.Forms.ToolStripButton vwSmrySQLButton; private System.Windows.Forms.ToolStripSeparator toolStripSeparator16; private System.Windows.Forms.Label saveLabel; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn4; private System.Windows.Forms.DataGridViewButtonColumn dataGridViewButtonColumn1; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn5; private System.Windows.Forms.DataGridViewButtonColumn dataGridViewButtonColumn2; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn7; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn8; private System.Windows.Forms.DataGridViewButtonColumn dataGridViewButtonColumn3; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn9; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn10; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn11; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn12; private System.Windows.Forms.DataGridViewButtonColumn dataGridViewButtonColumn4; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn13; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn14; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn15; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn16; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn17; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn18; private System.Windows.Forms.DataGridViewButtonColumn dataGridViewButtonColumn5; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn19; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn20; private System.Windows.Forms.DataGridViewButtonColumn dataGridViewButtonColumn6; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn21; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn22; private System.Windows.Forms.DataGridViewButtonColumn dataGridViewButtonColumn7; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn23; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn24; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn25; private System.Windows.Forms.DataGridViewButtonColumn dataGridViewButtonColumn8; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn26; private System.Windows.Forms.DataGridViewButtonColumn dataGridViewButtonColumn9; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn27; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn28; private System.Windows.Forms.DataGridViewButtonColumn dataGridViewButtonColumn10; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn29; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn30; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn31; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn32; private System.Windows.Forms.DataGridViewButtonColumn dataGridViewButtonColumn11; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn33; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn34; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn35; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn36; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn37; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn38; private System.Windows.Forms.DataGridViewButtonColumn dataGridViewButtonColumn12; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn39; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn40; private System.Windows.Forms.DataGridViewButtonColumn dataGridViewButtonColumn13; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn41; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn42; private System.Windows.Forms.DataGridViewButtonColumn dataGridViewButtonColumn14; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn43; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn44; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn45; private System.Windows.Forms.DataGridViewButtonColumn dataGridViewButtonColumn15; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn46; private System.Windows.Forms.DataGridViewButtonColumn dataGridViewButtonColumn16; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn47; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn48; private System.Windows.Forms.DataGridViewButtonColumn dataGridViewButtonColumn17; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn49; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn50; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn51; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn52; private System.Windows.Forms.DataGridViewButtonColumn dataGridViewButtonColumn18; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn53; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn54; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn55; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn56; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn57; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn58; private System.Windows.Forms.DataGridViewButtonColumn dataGridViewButtonColumn19; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn59; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn60; private System.Windows.Forms.DataGridViewButtonColumn dataGridViewButtonColumn20; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn61; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn62; private System.Windows.Forms.DataGridViewButtonColumn dataGridViewButtonColumn21; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn63; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn64; private EventsAndAttendance.Classes.MyDataGridView itemsDataGridView; private System.Windows.Forms.ContextMenuStrip docDtContextMenuStrip; private System.Windows.Forms.ToolStripMenuItem addDtMenuItem; private System.Windows.Forms.ToolStripMenuItem delDtMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator9; private System.Windows.Forms.ToolStripMenuItem vwExtraInfoMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator10; private System.Windows.Forms.ToolStripMenuItem exptExDtMenuItem; private System.Windows.Forms.ToolStripMenuItem rfrshDtMenuItem; private System.Windows.Forms.ToolStripMenuItem vwSQLDtMenuItem; private System.Windows.Forms.ToolStripMenuItem rcHstryDtMenuItem; private System.Windows.Forms.ContextMenuStrip smmryContextMenuStrip; private System.Windows.Forms.ToolStripMenuItem exptExSmryMenuItem; private System.Windows.Forms.ToolStripMenuItem rfrshSmryMenuItem; private System.Windows.Forms.ToolStripMenuItem vwSQLSmryMenuItem; private System.Windows.Forms.ToolStripMenuItem rcHstrySmryMenuItem; private System.Windows.Forms.ContextMenuStrip docContextMenuStrip; private System.Windows.Forms.ToolStripMenuItem addMenuItem; private System.Windows.Forms.ToolStripMenuItem editMenuItem; private System.Windows.Forms.ToolStripMenuItem delMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator90; private System.Windows.Forms.ToolStripMenuItem exptExMenuItem; private System.Windows.Forms.ToolStripMenuItem rfrshMenuItem; private System.Windows.Forms.ToolStripMenuItem vwSQLMenuItem; private System.Windows.Forms.ToolStripMenuItem rcHstryMenuItem; private System.Windows.Forms.ImageList imageList2; private System.Windows.Forms.Button settleBillButton; private System.Windows.Forms.ComboBox docTypeComboBox; private System.Windows.Forms.Label label15; private System.Windows.Forms.ComboBox docIDPrfxComboBox; public System.Windows.Forms.TextBox docIDNumTextBox; private System.Windows.Forms.Label label16; private System.Windows.Forms.TextBox docIDTextBox; private System.Windows.Forms.ComboBox fcltyTypeComboBox; private System.Windows.Forms.Button cancelButton; public System.Windows.Forms.TextBox salesDocNumTextBox; private System.Windows.Forms.Label label1; private System.Windows.Forms.TextBox salesDocIDTextBox; private System.Windows.Forms.TextBox docStatusTextBox; private System.Windows.Forms.ToolStripButton resetButton; private System.Windows.Forms.Button checkInButton; private System.Windows.Forms.Label exchRateLabel; private System.Windows.Forms.NumericUpDown exchRateNumUpDwn; private System.Windows.Forms.Button pymntMthdButton; private System.Windows.Forms.TextBox pymntMthdTextBox; private System.Windows.Forms.Label label5; private System.Windows.Forms.TextBox pymntMthdIDTextBox; private System.Windows.Forms.Button invcCurrButton; private System.Windows.Forms.TextBox invcCurrTextBox; private System.Windows.Forms.Label label19; private System.Windows.Forms.TextBox invcCurrIDTextBox; private System.Windows.Forms.ToolStripButton rcHstryButton; private System.Windows.Forms.ToolStripButton vwSQLButton; private System.Windows.Forms.TextBox salesApprvlStatusTextBox; private System.Windows.Forms.TextBox salesDocTypeTextBox; private System.ComponentModel.BackgroundWorker backgroundWorker2; private System.Windows.Forms.PrintDialog printDialog1; private System.ComponentModel.BackgroundWorker backgroundWorker1; private System.Windows.Forms.Timer timer1; private System.Drawing.Printing.PrintDocument printDocument1; private System.Windows.Forms.PrintPreviewDialog printPreviewDialog1; private System.Windows.Forms.Timer timer2; private System.Drawing.Printing.PrintDocument printDocument2; private System.Windows.Forms.TextBox dteTextBox1; private System.Windows.Forms.ToolStripButton dscntButton; public System.Windows.Forms.ToolStripTextBox searchForTextBox; public System.Windows.Forms.ToolStripComboBox searchInComboBox; public System.Windows.Forms.ToolStripButton addCheckInButton; public System.Windows.Forms.CheckBox showActiveCheckBox; public System.Windows.Forms.ToolStripButton addRsrvtnButton; public System.Windows.Forms.CheckBox showUnsettledCheckBox; public System.Windows.Forms.ToolStripButton goButton; public System.Windows.Forms.TextBox roomIDTextBox; public System.Windows.Forms.TextBox roomNumTextBox; public System.Windows.Forms.TextBox srvcTypeTextBox; public System.Windows.Forms.TextBox srvcTypeIDTextBox; private System.Windows.Forms.DataGridViewTextBoxColumn Column2; private System.Windows.Forms.DataGridViewButtonColumn Column19; private System.Windows.Forms.DataGridViewTextBoxColumn Column6; private System.Windows.Forms.DataGridViewButtonColumn Column23; private System.Windows.Forms.DataGridViewTextBoxColumn Column4; private System.Windows.Forms.DataGridViewTextBoxColumn Column27; private System.Windows.Forms.DataGridViewButtonColumn Column28; private System.Windows.Forms.DataGridViewTextBoxColumn Column5; private System.Windows.Forms.DataGridViewTextBoxColumn Column3; private System.Windows.Forms.DataGridViewTextBoxColumn Column1; private System.Windows.Forms.DataGridViewTextBoxColumn Column25; private System.Windows.Forms.DataGridViewButtonColumn Column26; private System.Windows.Forms.DataGridViewTextBoxColumn Column8; private System.Windows.Forms.DataGridViewTextBoxColumn Column20; private System.Windows.Forms.DataGridViewTextBoxColumn Column9; private System.Windows.Forms.DataGridViewTextBoxColumn Column17; private System.Windows.Forms.DataGridViewTextBoxColumn Column18; private System.Windows.Forms.DataGridViewTextBoxColumn Column11; private System.Windows.Forms.DataGridViewButtonColumn Column7; private System.Windows.Forms.DataGridViewTextBoxColumn Column14; private System.Windows.Forms.DataGridViewTextBoxColumn Column12; private System.Windows.Forms.DataGridViewButtonColumn Column22; private System.Windows.Forms.DataGridViewTextBoxColumn Column15; private System.Windows.Forms.DataGridViewTextBoxColumn Column13; private System.Windows.Forms.DataGridViewButtonColumn Column21; private System.Windows.Forms.DataGridViewTextBoxColumn Column16; private System.Windows.Forms.DataGridViewTextBoxColumn Column24; private System.Windows.Forms.DataGridViewCheckBoxColumn Column29; private System.Windows.Forms.DataGridViewTextBoxColumn Column30; private System.Windows.Forms.DataGridViewTextBoxColumn Column31; private System.Windows.Forms.ToolStripButton addChrgButton; private System.Windows.Forms.CheckBox autoBalscheckBox; private System.Windows.Forms.Button badDebtButton; private System.Windows.Forms.Label label6; private System.Windows.Forms.ToolStripButton customInvoiceButton; private System.Windows.Forms.ToolStripSeparator toolStripSeparator15; private System.Windows.Forms.Button pymntTermsButton; } }
gpl-3.0
ariesteam/aries
plugins/org.integratedmodelling.aries.http.explorer/src/org/integratedmodelling/aries/webapp/view/STYLE.java
3444
/* Copyright 2011 The ARIES Consortium (http://www.ariesonline.org) This file is part of ARIES. ARIES is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ARIES is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with ARIES. If not, see <http://www.gnu.org/licenses/>. */ package org.integratedmodelling.aries.webapp.view; public class STYLE { public static final String PANEL_HEADER_CLASS = "panel_header"; public static final String MAP_TOOLBAR = "grey_toolbar"; public static final String STATUS_BAR = "status_bar"; public static final String MESSAGE_BAR = "message_bar"; public static final String MESSAGE = "message"; public static final String MODULE_PANEL = "module_working_area"; public static final String MODULE_TITLE = "module_title"; public static final String MODULE_TITLE_COMPUTED = "module_title_computed"; public static final String MODULE_TITLE_DISABLED = "module_title_disabled"; public static final String MODULE_HEADER = "module_header"; public static final String BANNER_AREA = "grey_toolbar"; public static final String BOTTOM_AREA = "grey_toolbar"; public static final String SEPARATOR = "separator"; public static final String SCENARIO_WINDOW = "scenario_window"; public static final String BORDERED = "bordered"; public static final String BRIGHT_BORDER = "bright_border"; public static final String BORDERED_BUTTON_ENABLED = "bordered_button_enabled"; public static final String BORDERED_BUTTON_DISABLED = "bordered_button_disabled"; public static final String BORDERED_TEXT = "bordered_text"; public static final String BORDERED_HTML_TEXT = "bordered_html"; public static final String BORDERED_SUNK = "bordered_sunk"; public static final String BORDERED_SUNK_BG = "bordered_sunk_bg"; public static final String TEXTURED_SUNK = "textured_sunk"; public static final String TEXTURED = "textured"; public static final String BORDERED_SUNK_TOPDOWN = "bordered_sunk_topdown"; public static final String DARK_BG = "dark_bg"; public static final String TEXT_SMALL = "small_text"; public static final String TEXT_VERYSMALL = "smaller_text"; public static final String TEXT_VERYSMALL_SUNK = "smaller_text_sunk"; public static final String TEXT_MAP_TITLE = "maptitle_text"; public static final String TEXT_SMALL_BRIGHT = "small_bright_text"; public static final String TEXT_SMALLER_BRIGHT = "smaller_bright_text"; public static final String TEXT_SMALL_RED = "small_red_text"; public static final String TEXT_BOLD_RED = "bold_red_text"; public static final String TEXT_LARGE_BOLD_RED = "large_bold_red_text"; public static final String TEXT_SMALL_BRIGHT_BORDERED = "small_bright_text_border"; public static final String TEXT_SMALL_BRIGHT_COLORED = "small_bright_text_colored"; public static final String TEXT_LARGE_BOLD_GREY = "large_bold_grey_text"; public static final String GLASSTOP_SMALL = "glassbar_top"; public static final String GLASSBOTTOM_LARGE = "glassbar_bottom_large"; }
gpl-3.0
steaphangreene/simple
simpletexture/stt_upbuttonup.cpp
2105
// ************************************************************************* // This file is part of the SimpleTexture Example Module by Steaphan Greene // // Copyright 2005-2015 Steaphan Greene <steaphan@gmail.com> // // SimpleTexture is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 3 of the License, or // (at your option) any later version. // // SimpleTexture is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with SimpleTexture (see the file named "COPYING"); // If not, see <http://www.gnu.org/licenses/>. // // ************************************************************************* #include "stt_upbuttonup.h" STT_UpButton_Up::STT_UpButton_Up(const SDL_Color &txtcol) { textcol = txtcol; } SDL_Surface *STT_UpButton_Up::BuildTexture(SDL_Surface *surf, const Uint32 xsize, const Uint32 ysize, const SDL_Color &col) { SDL_Surface *ret = BuildInternal(surf, xsize, ysize, base_col(col), light_col(col), dark_col(col)); int width = ysize / 16; if (width > int(xsize / 16)) width = xsize / 16; if (width < 1) width = 1; SDL_Rect point = {width * 2, width * 2, width, width}; for (Uint32 pos = xsize / 4; pos <= xsize / 2; ++pos) { point.x = pos; point.y = ((ysize * 3) / 4) - (ysize * pos / xsize); point.h = (ysize * pos / xsize) - xsize / 4; SDL_FillRect(ret, &point, SDL_MapRGB(ret->format, textcol.r, textcol.g, textcol.b)); point.x = xsize - pos; SDL_FillRect(ret, &point, SDL_MapRGB(ret->format, textcol.r, textcol.g, textcol.b)); } return ret; }
gpl-3.0
bedo2991/ldmr
tests/TestCase/Controller/ManagersControllerTest.php
1341
<?php namespace App\Test\TestCase\Controller; use App\Controller\ManagersController; use Cake\TestSuite\IntegrationTestCase; /** * App\Controller\ManagersController Test Case */ class ManagersControllerTest extends IntegrationTestCase { /** * Fixtures * * @var array */ public $fixtures = [ 'app.managers', 'app.clubs', 'app.validities', 'app.blacklisted_users', 'app.events', 'app.invited_users' ]; /** * Test index method * * @return void */ public function testIndex() { $this->markTestIncomplete('Not implemented yet.'); } /** * Test view method * * @return void */ public function testView() { $this->markTestIncomplete('Not implemented yet.'); } /** * Test add method * * @return void */ public function testAdd() { $this->markTestIncomplete('Not implemented yet.'); } /** * Test edit method * * @return void */ public function testEdit() { $this->markTestIncomplete('Not implemented yet.'); } /** * Test delete method * * @return void */ public function testDelete() { $this->markTestIncomplete('Not implemented yet.'); } }
gpl-3.0
ouyangyu/fdmoodle
auth/fc/fcFPP.php
7119
<?php /************************************************************************/ /* fcFPP: Php class for FirstClass Flexible Provisining Protocol */ /* ============================================================= */ /* */ /* Copyright (c) 2004 SKERIA Utveckling, Teknous */ /* http://skeria.skelleftea.se */ /* */ /* Flexible Provisioning Protocol is a real-time, IP based protocol */ /* which provides direct access to the scriptable remote administration */ /* subsystem of the core FirstClass Server. Using FPP, it is possible to*/ /* implement automated provisioning and administration systems for */ /* FirstClass, avoiding the need for a point and click GUI. FPP can also*/ /* be used to integrate FirstClass components into a larger unified */ /* system. */ /* */ /* This program is free software. You can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation; either version 2 of the License or any */ /* later version. */ /************************************************************************/ /* Author: Torsten Anderson, torsten.anderson@skeria.skelleftea.se */ class fcFPP { var $_hostname; // hostname of FirstClass server we are connection to var $_port; // port on which fpp is running var $_conn = 0; // socket we are connecting on var $_debug = FALSE; // set to true to see some debug info // class constructor function fcFPP($host="localhost", $port="3333") { $this->_hostname = $host; $this->_port = $port; $this->_user = ""; $this->_pwd = ""; } // open a connection to the FirstClass server function open() { if ($this->_debug) echo "Connecting to host "; $host = $this->_hostname; $port = $this->_port; if ($this->_debug) echo "[$host:$port].."; // open the connection to the FirstClass server $conn = fsockopen($host, $port, $errno, $errstr, 5); if (!$conn) { print_error('auth_fcconnfail','auth_fc', '', array('no'=>$errno, 'str'=>$errstr)); return false; } // We are connected if ($this->_debug) echo "connected!"; // Read connection message. $line = fgets ($conn); //+0 $line = fgets ($conn); //new line // store the connection in this class, so we can use it later $this->_conn = & $conn; return true; } // close any open connections function close() { // get the current connection $conn = &$this->_conn; // close it if it's open if ($conn) { fclose($conn); // cleanup the variable unset($this->_conn); return true; } return; } // Authenticate to the FirstClass server function login($userid, $passwd) { // we did have a connection right?! if ($this->_conn) { # Send username fputs($this->_conn,"$userid\r\n"); $line = fgets ($this->_conn); //new line $line = fgets ($this->_conn); //+0 $line = fgets ($this->_conn); //new line # Send password fputs($this->_conn,"$passwd\r\n"); $line = fgets ($this->_conn); //new line $line = fgets ($this->_conn); //+0 $line = fgets ($this->_conn); //+0 or message if ($this->_debug) echo $line; if (preg_match ("/^\+0/", $line)) { //+0, user with subadmin privileges $this->_user = $userid; $this->_pwd = $passwd; return TRUE; } elseif (strpos($line, 'You are not allowed')) { // Denied access but a valid user and password // "Sorry. You are not allowed to login with the FPP interface" return TRUE; } else { //Invalid user or password return FALSE; } } return FALSE; } // Get the list of groups the user is a member of function getGroups($userid) { $groups = array(); // we must be logged in as a user with subadmin privileges if ($this->_conn AND $this->_user) { # Send BA-command to get groups fputs($this->_conn,"GET USER '" . $userid . "' 4 -1\r"); $line = ""; while (!$line) { $line = trim(fgets ($this->_conn)); } $n = 0; while ($line AND !preg_match("/^\+0/", $line) AND $line != "-1003") { list( , , $groups[$n++]) = explode(" ",$line,3); $line = trim(fgets ($this->_conn)); } if ($this->_debug) echo "getGroups:" . implode(",",$groups); } return $groups; } // Check if the user is member of any of the groups. // Return the list of groups the user is member of. function isMemberOf($userid, $groups) { $usergroups = array_map("strtolower",$this->getGroups($userid)); $groups = array_map("strtolower",$groups); $result = array_intersect($groups,$usergroups); if ($this->_debug) echo "isMemberOf:" . implode(",",$result); return $result; } function getUserInfo($userid, $field) { $userinfo = ""; if ($this->_conn AND $this->_user) { # Send BA-command to get data fputs($this->_conn,"GET USER '" . $userid . "' " . $field . "\r"); $line = ""; while (!$line) { $line = trim(fgets ($this->_conn)); } $n = 0; while ($line AND !preg_match("/^\+0/", $line)) { list( , , $userinfo) = explode(" ",$line,3); $line = trim(fgets ($this->_conn)); } if ($this->_debug) echo "getUserInfo:" . $userinfo; } return str_replace('\r',' ',trim($userinfo,'"')); } function getResume($userid) { $resume = ""; $pattern = "/\[.+:.+\..+\]/"; // Remove references to pictures in resumes if ($this->_conn AND $this->_user) { # Send BA-command to get data fputs($this->_conn,"GET RESUME '" . $userid . "' 6\r"); $line = ""; while (!$line) { $line = trim(fgets ($this->_conn)); } $n = 0; while ($line AND !preg_match("/^\+0/", $line)) { $resume .= preg_replace($pattern,"",str_replace('\r',"\n",trim($line,'6 '))); $line = trim(fgets ($this->_conn)); //print $line; } if ($this->_debug) echo "getResume:" . $resume; } return $resume; } } ?>
gpl-3.0
NYRDS/PD-classes
com/nyrds/android/util/FileSystem.java
969
package com.nyrds.android.util; import java.io.File; import android.content.Context; public class FileSystem { static private Context m_context; static public void setContext(Context context) { m_context = context; } static public File getInteralStorageFile(String fileName) { File storageDir = m_context.getFilesDir(); File file = new File(storageDir, fileName); return file; } static public String[] listInternalStorage() { File storageDir = m_context.getFilesDir(); return storageDir.list(); } static public String getInteralStorageFileName(String fileName) { return getInteralStorageFile(fileName).getAbsolutePath(); } static public File getExternalStorageFile(String fileName) { File storageDir = m_context.getExternalFilesDir(null); File file = new File(storageDir, fileName); return file; } static public String getExternalStorageFileName(String fname) { return getExternalStorageFile(fname).getAbsolutePath(); } }
gpl-3.0
adaptive-learning/robomission
frontend/src/reducers/student.js
917
import { FETCH_STUDENT_SUCCESS, FETCH_PRACTICE_OVERVIEW_SUCCESS } from '../action-types'; export default function reduceStudent(state = {}, action) { switch (action.type) { case FETCH_STUDENT_SUCCESS: return { ...state, level: action.payload.level, credits: action.payload.credits, activeCredits: action.payload.activeCredits, practiceOverviewUrl: action.payload.practiceOverviewUrl, startTaskUrl: action.payload.startTaskUrl, watchInstructionUrl: action.payload.watchInstructionUrl, reportProgramEditUrl: action.payload.reportProgramEditUrl, reportProgramExecutionUrl: action.payload.reportProgramExecutionUrl, }; case FETCH_PRACTICE_OVERVIEW_SUCCESS: return { ...state, mission: action.payload.mission, phase: action.payload.phase, }; default: return state; } }
gpl-3.0
ruhr-universitaet-bochum/jpdfsigner
src/main/java/de/rub/dez6a3/jpdfsigner/view/UI/CustomMenuBarUI.java
1971
/* * JPDFSigner - Sign PDFs online using smartcards (CustomMenuBarUI.java) * Copyright (C) 2013 Ruhr-Universitaet Bochum - Daniel Moczarski, Haiko te Neues * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/gpl.txt>. * */ /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package de.rub.dez6a3.jpdfsigner.view.UI; import java.awt.Color; import java.awt.GradientPaint; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.RenderingHints; import javax.swing.JComponent; import javax.swing.JOptionPane; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.basic.BasicMenuBarUI; /** * * @author dan */ public class CustomMenuBarUI extends BasicMenuBarUI { public void installUI(JComponent c) { super.installUI(c); } public void paint(Graphics g, JComponent c){ Graphics2D g2 = (Graphics2D)g; GradientPaint gp = new GradientPaint(0, 0, new Color(215, 215, 215), 0, c.getHeight(), new Color(190, 190, 190)); g2.setPaint(gp); g2.fillRect(0, 0, c.getWidth(), c.getHeight()); g2.setColor(Color.white); g2.drawLine(0, 0, 0, c.getHeight()); g2.drawLine(c.getWidth()-1,0, c.getWidth()-1, c.getHeight()); } public static ComponentUI createUI(JComponent c) { return new CustomMenuBarUI(); } }
gpl-3.0
Redolith/ReActions
core/src/main/java/me/fromgate/reactions/actions/ActionMobSpawn.java
1186
/* * ReActions, Minecraft bukkit plugin * (c)2012-2017, fromgate, fromgate@gmail.com * http://dev.bukkit.org/server-mods/reactions/ * * This file is part of ReActions. * * ReActions is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * ReActions is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with ReActions. If not, see <http://www.gnorg/licenses/>. * */ package me.fromgate.reactions.actions; import me.fromgate.reactions.util.Param; import me.fromgate.reactions.util.mob.MobSpawn; import org.bukkit.entity.Player; public class ActionMobSpawn extends Action { @Override public boolean execute(Player p, Param params) { MobSpawn.mobSpawn(p, params); return true; } }
gpl-3.0
projectestac/alexandria
html/langpacks/pt/report_progress.php
1766
<?php // This file is part of Moodle - https://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <https://www.gnu.org/licenses/>. /** * Strings for component 'report_progress', language 'pt', version '3.11'. * * @package report_progress * @category string * @copyright 1999 Martin Dougiamas and contributors * @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); $string['activityorder'] = 'Ordem das atividades'; $string['allactivitiesandresources'] = 'Todas as atividades e recursos'; $string['alphabetical'] = 'Alfabética'; $string['include'] = 'Incluir'; $string['orderincourse'] = 'Ordem da disciplina'; $string['page-report-progress-index'] = 'Relatório de conclusão das atividades'; $string['page-report-progress-user'] = 'Relatório de conclusão das atividades do utilizador'; $string['page-report-progress-x'] = 'Qualquer relatório de conclusão das atividades'; $string['pluginname'] = 'Conclusão das atividades'; $string['privacy:metadata'] = 'O Relatório de conclusão das atividades mostra apenas dados armazenados noutros locais.'; $string['progress:view'] = 'Ver relatórios de conclusão das atividades';
gpl-3.0
gmarcais/pvof
unittests/test_pipe_open.cc
1853
#include <gtest/gtest.h> #include <src/pipe_open.hpp> #include <stdexcept> TEST(PipeOpen, echo) { const char* text = "Hello there"; const char* echo_cmd[] = { "/bin/echo", text, 0 }; pipe_open echo_pipe(echo_cmd); EXPECT_TRUE(echo_pipe.good()); std::string res; getline(echo_pipe, res); EXPECT_EQ(0, res.compare(text)); } TEST(PipeOpen, echoe) { const char* lines[2] = { "Line one", "Second line" }; const char* echo_cmd[] = { "/bin/echo", "-e", lines[0], "\n", lines[1], 0 }; pipe_open echo_pipe(echo_cmd); int i = 0; std::string line; while(getline(echo_pipe, line)) { ASSERT_GT(2, i); // echo added a space between the arguments. EXPECT_EQ(strlen(lines[i]) + 1, line.size()); if(i == 0) { EXPECT_EQ(' ', line.at(line.size() - 1)); line.resize(line.size() - 1); EXPECT_STREQ(lines[i], line.c_str()); } else { EXPECT_EQ(' ', line.at(0)); EXPECT_STREQ(lines[i], line.c_str() + 1); } ++i; } EXPECT_EQ(2, i); } TEST(PipeOpen, status) { const char* true_cmd[] = { "true", 0 }; const char* false_cmd[] = { "false", 0 }; pipe_open true_pipe(true_cmd); std::pair<int, int> res = true_pipe.status(); ASSERT_EQ(0, res.first); ASSERT_TRUE(WIFEXITED(res.second)); ASSERT_EQ(0, WEXITSTATUS(res.second)); pipe_open false_pipe(false_cmd); res = false_pipe.status(); ASSERT_EQ(0, res.first); ASSERT_TRUE(WIFEXITED(res.second)); ASSERT_EQ(1, WEXITSTATUS(res.second)); } TEST(PipeOpen, fail) { // I hope this command does not exists const char* no_cmd[] = { "qwertyuiopasdfghjklzxcvbnm", 0 }; EXPECT_THROW(pipe_open no_pipe(no_cmd), std::runtime_error); pipe_open no_pipe_no_check(no_cmd, false); std::string line; EXPECT_FALSE(getline(no_pipe_no_check, line)); EXPECT_TRUE(line.empty()); EXPECT_FALSE(no_pipe_no_check.good()); }
gpl-3.0
freeipa/ipa-docker-test-runner
ipadocker/__init__.py
57
# Author: Martin Babinsky # See LICENSE file for license
gpl-3.0
NathanKell/Ferram-Aerospace-Research
FerramAerospaceResearch/FARDebugAndSettings.cs
23912
/* Ferram Aerospace Research v0.15.6.3 "Kindelberger" ========================= Aerodynamics model for Kerbal Space Program Copyright 2015, Michael Ferrara, aka Ferram4 This file is part of Ferram Aerospace Research. Ferram Aerospace Research is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Ferram Aerospace Research is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Ferram Aerospace Research. If not, see <http://www.gnu.org/licenses/>. Serious thanks: a.g., for tons of bugfixes and code-refactorings stupid_chris, for the RealChuteLite implementation Taverius, for correcting a ton of incorrect values Tetryds, for finding lots of bugs and issues and not letting me get away with them, and work on example crafts sarbian, for refactoring code for working with MechJeb, and the Module Manager updates ialdabaoth (who is awesome), who originally created Module Manager Regex, for adding RPM support DaMichel, for some ferramGraph updates and some control surface-related features Duxwing, for copy editing the readme CompatibilityChecker by Majiir, BSD 2-clause http://opensource.org/licenses/BSD-2-Clause Part.cfg changes powered by sarbian & ialdabaoth's ModuleManager plugin; used with permission http://forum.kerbalspaceprogram.com/threads/55219 ModularFLightIntegrator by Sarbian, Starwaster and Ferram4, MIT: http://opensource.org/licenses/MIT http://forum.kerbalspaceprogram.com/threads/118088 Toolbar integration powered by blizzy78's Toolbar plugin; used with permission http://forum.kerbalspaceprogram.com/threads/60863 */ using System; using System.Collections.Generic; using System.Text.RegularExpressions; using UnityEngine; using KSP; using KSP.UI.Screens; using FerramAerospaceResearch.FARGUI; using ferram4; namespace FerramAerospaceResearch { [KSPAddon(KSPAddon.Startup.MainMenu, true)] public class FARDebugAndSettings : MonoBehaviour { public static KSP.IO.PluginConfiguration config; private IButton FARDebugButtonBlizzy = null; private ApplicationLauncherButton FARDebugButtonStock = null; private bool debugMenu = false; private bool inputLocked = false; private Rect debugWinPos = new Rect(50, 50, 700, 250); private static Texture2D cLTexture = new Texture2D(25, 15); private static Texture2D cDTexture = new Texture2D(25, 15); private static Texture2D cMTexture = new Texture2D(25, 15); private static Texture2D l_DTexture = new Texture2D(25, 15); private enum MenuTab { DebugAndData, AeroStress, AtmComposition } private static string[] MenuTab_str = new string[] { "Difficulty and Debug", "Aerodynamic Failure", "Atm Composition", }; public static string[] FlowMode_str = new string[] { "NO_FLOW", "ALL_VESSEL", "STAGE_PRIORITY_FLOW", "STACK_PRIORITY_SEARCH", }; private MenuTab activeTab = MenuTab.DebugAndData; private int aeroStressIndex = 0; private int atmBodyIndex = 1; void Start() { if (!CompatibilityChecker.IsAllCompatible()) { this.enabled = false; return; } FerramAerospaceResearch.FARAeroComponents.FARAeroSection.GenerateCrossFlowDragCurve(); FARAeroStress.LoadStressTemplates(); FARAeroUtil.LoadAeroDataFromConfig(); //LoadConfigs(); GameObject.DontDestroyOnLoad(this); debugMenu = false; if (FARDebugValues.useBlizzyToolbar && FARDebugButtonBlizzy != null) { FARDebugButtonBlizzy = ToolbarManager.Instance.add("FerramAerospaceResearch", "FARDebugButtonBlizzy"); FARDebugButtonBlizzy.TexturePath = "FerramAerospaceResearch/Textures/icon_button_blizzy"; FARDebugButtonBlizzy.ToolTip = "FAR Debug Options"; FARDebugButtonBlizzy.OnClick += (e) => debugMenu = !debugMenu; } else GameEvents.onGUIApplicationLauncherReady.Add(OnGUIAppLauncherReady); } void OnGUIAppLauncherReady() { if (ApplicationLauncher.Ready && FARDebugButtonStock == null) { FARDebugButtonStock = ApplicationLauncher.Instance.AddModApplication( onAppLaunchToggleOn, onAppLaunchToggleOff, DummyVoid, DummyVoid, DummyVoid, DummyVoid, ApplicationLauncher.AppScenes.SPACECENTER, (Texture)GameDatabase.Instance.GetTexture("FerramAerospaceResearch/Textures/icon_button_stock", false)); } } void onAppLaunchToggleOn() { debugMenu = true; } void onAppLaunchToggleOff() { debugMenu = false; } void DummyVoid() { } public void OnGUI() { if (HighLogic.LoadedScene != GameScenes.SPACECENTER) { debugMenu = false; if (inputLocked) { InputLockManager.RemoveControlLock("FARDebugLock"); inputLocked = false; } return; } GUI.skin = HighLogic.Skin; if (debugMenu) { debugWinPos = GUILayout.Window("FARDebug".GetHashCode(), debugWinPos, debugWindow, "FAR Debug Options, v0.15", GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)); if (!inputLocked && debugWinPos.Contains(GUIUtils.GetMousePos())) { InputLockManager.SetControlLock(ControlTypes.KSC_ALL, "FARDebugLock"); inputLocked = true; } else if (inputLocked && !debugWinPos.Contains(GUIUtils.GetMousePos())) { InputLockManager.RemoveControlLock("FARDebugLock"); inputLocked = false; } } else if (inputLocked) { InputLockManager.RemoveControlLock("FARDebugLock"); inputLocked = false; } } private void debugWindow(int windowID) { GUIStyle thisStyle = new GUIStyle(GUI.skin.toggle); thisStyle.stretchHeight = true; thisStyle.stretchWidth = true; thisStyle.padding = new RectOffset(4, 4, 4, 4); thisStyle.margin = new RectOffset(4, 4, 4, 4); GUIStyle buttonStyle = new GUIStyle(GUI.skin.button); buttonStyle.stretchHeight = true; buttonStyle.stretchWidth = true; buttonStyle.padding = new RectOffset(4, 4, 4, 4); buttonStyle.margin = new RectOffset(4, 4, 4, 4); GUIStyle boxStyle = new GUIStyle(GUI.skin.box); boxStyle.stretchHeight = true; boxStyle.stretchWidth = true; boxStyle.padding = new RectOffset(4, 4, 4, 4); boxStyle.margin = new RectOffset(4, 4, 4, 4); activeTab = (MenuTab)GUILayout.SelectionGrid((int)activeTab, MenuTab_str, 3); if (activeTab == MenuTab.DebugAndData) DebugAndDataTab(thisStyle); else if (activeTab == MenuTab.AeroStress) AeroStressTab(buttonStyle, boxStyle); else AeroDataTab(buttonStyle, boxStyle); // SaveWindowPos.x = windowPos.x;3 // SaveWindowPos.y = windowPos.y; GUI.DragWindow(); debugWinPos = GUIUtils.ClampToScreen(debugWinPos); } private void AeroDataTab(GUIStyle buttonStyle, GUIStyle boxStyle) { int i = 0; GUILayout.BeginVertical(boxStyle); FARControllableSurface.timeConstant = GUIUtils.TextEntryForDouble("Ctrl Surf Time Constant:", 160, FARControllableSurface.timeConstant); FARControllableSurface.timeConstantFlap = GUIUtils.TextEntryForDouble("Flap Time Constant:", 160, FARControllableSurface.timeConstantFlap); FARControllableSurface.timeConstantSpoiler = GUIUtils.TextEntryForDouble("Spoiler Time Constant:", 160, FARControllableSurface.timeConstantSpoiler); GUILayout.EndVertical(); GUILayout.BeginVertical(); GUILayout.Label("Celestial Body Atmosperic Properties"); GUILayout.BeginHorizontal(); GUILayout.BeginVertical(boxStyle); GUILayout.BeginHorizontal(); int j = 0; for (i = 0; i < FlightGlobals.Bodies.Count; i++) { CelestialBody body = FlightGlobals.Bodies[i]; if (!body.atmosphere) continue; bool active = GUILayout.Toggle(i == atmBodyIndex, body.GetName(), buttonStyle, GUILayout.Width(150), GUILayout.Height(40)); if (active) atmBodyIndex = i; if ((j + 1) % 4 == 0) { GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); } j++; } GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.BeginVertical(boxStyle); int flightGlobalsIndex = FlightGlobals.Bodies[atmBodyIndex].flightGlobalsIndex; double[] atmProperties = FARAeroUtil.bodyAtmosphereConfiguration[flightGlobalsIndex]; atmProperties[0] = GUIUtils.TextEntryForDouble("Gas Viscosity:", 80, atmProperties[0]); atmProperties[1] = GUIUtils.TextEntryForDouble("Ref Temp for Viscosity:", 80, atmProperties[1]); FARAeroUtil.bodyAtmosphereConfiguration[flightGlobalsIndex] = atmProperties; GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.EndVertical(); } private void AeroStressTab(GUIStyle buttonStyle, GUIStyle boxStyle) { int i = 0; int removeIndex = -1; GUILayout.BeginHorizontal(); GUILayout.BeginVertical(boxStyle); for (i = 0; i < FARAeroStress.StressTemplates.Count; i++) { GUILayout.BeginHorizontal(); bool active = GUILayout.Toggle(i == aeroStressIndex, FARAeroStress.StressTemplates[i].name, buttonStyle, GUILayout.Width(150)); if (GUILayout.Button("-", buttonStyle, GUILayout.Width(30), GUILayout.Height(30))) removeIndex = i; GUILayout.EndHorizontal(); if (active) aeroStressIndex = i; } if (removeIndex >= 0) { FARAeroStress.StressTemplates.RemoveAt(removeIndex); if (aeroStressIndex == removeIndex && removeIndex > 0) aeroStressIndex--; removeIndex = -1; } if (GUILayout.Button("+", buttonStyle, GUILayout.Width(30), GUILayout.Height(30))) { FARPartStressTemplate newTemplate = new FARPartStressTemplate(); newTemplate.XZmaxStress = 500; newTemplate.YmaxStress = 500; newTemplate.name = "default"; newTemplate.isSpecialTemplate = false; newTemplate.minNumResources = 0; newTemplate.resources = new List<string>(); newTemplate.excludeResources = new List<string>(); newTemplate.rejectUnlistedResources = false; newTemplate.crewed = false; newTemplate.flowModeNeeded = false; newTemplate.flowMode = ResourceFlowMode.NO_FLOW; FARAeroStress.StressTemplates.Add(newTemplate); } GUILayout.EndVertical(); GUILayout.BeginVertical(boxStyle); FARPartStressTemplate activeTemplate = FARAeroStress.StressTemplates[aeroStressIndex]; string tmp; GUIUtils.TextEntryField("Name:", 80, ref activeTemplate.name); activeTemplate.YmaxStress = GUIUtils.TextEntryForDouble("Axial (Y-axis) Max Stress:", 240, activeTemplate.YmaxStress); activeTemplate.XZmaxStress = GUIUtils.TextEntryForDouble("Lateral (X,Z-axis) Max Stress:", 240, activeTemplate.XZmaxStress); activeTemplate.crewed = GUILayout.Toggle(activeTemplate.crewed, "Requires Crew Compartment"); tmp = activeTemplate.minNumResources.ToString(); GUIUtils.TextEntryField("Min Num Resources:", 80, ref tmp); tmp = Regex.Replace(tmp, @"[^\d]", ""); activeTemplate.minNumResources = Convert.ToInt32(tmp); GUILayout.Label("Req Resources:"); StringListUpdateGUI(activeTemplate.resources, buttonStyle, boxStyle); GUILayout.Label("Exclude Resources:"); StringListUpdateGUI(activeTemplate.excludeResources, buttonStyle, boxStyle); activeTemplate.rejectUnlistedResources = GUILayout.Toggle(activeTemplate.rejectUnlistedResources, "Reject Unlisted Res"); activeTemplate.flowModeNeeded = GUILayout.Toggle(activeTemplate.flowModeNeeded, "Requires Specific Flow Mode"); if (activeTemplate.flowModeNeeded) { activeTemplate.flowMode = (ResourceFlowMode)GUILayout.SelectionGrid((int)activeTemplate.flowMode, FlowMode_str, 1); } activeTemplate.isSpecialTemplate = GUILayout.Toggle(activeTemplate.isSpecialTemplate, "Special Hardcoded Usage"); FARAeroStress.StressTemplates[aeroStressIndex] = activeTemplate; GUILayout.EndVertical(); GUILayout.EndHorizontal(); } private void StringListUpdateGUI(List<string> stringList, GUIStyle thisStyle, GUIStyle boxStyle) { int removeIndex = -1; GUILayout.BeginVertical(boxStyle); for (int i = 0; i < stringList.Count; i++) { string tmp = stringList[i]; GUILayout.BeginHorizontal(); tmp = GUILayout.TextField(tmp, GUILayout.Height(30)); if (GUILayout.Button("-", thisStyle, GUILayout.Width(30), GUILayout.Height(30))) removeIndex = i; GUILayout.EndHorizontal(); if (removeIndex >= 0) break; stringList[i] = tmp; } if (removeIndex >= 0) { stringList.RemoveAt(removeIndex); removeIndex = -1; } if (GUILayout.Button("+", thisStyle, GUILayout.Width(30), GUILayout.Height(30))) stringList.Add(""); GUILayout.EndVertical(); } private void DebugAndDataTab(GUIStyle thisStyle) { GUILayout.BeginHorizontal(); GUILayout.BeginVertical(GUILayout.Width(250)); GUILayout.Label("Debug / Cheat Options"); FARDebugValues.allowStructuralFailures = GUILayout.Toggle(FARDebugValues.allowStructuralFailures, "Allow Aero-structural Failures", thisStyle); GUILayout.Label("Editor GUI Graph Colors"); Color tmpColor = GUIColors.Instance[0]; ChangeColor("Cl", ref tmpColor, ref cLTexture); GUIColors.Instance[0] = tmpColor; tmpColor = GUIColors.Instance[1]; ChangeColor("Cd", ref tmpColor, ref cDTexture); GUIColors.Instance[1] = tmpColor; tmpColor = GUIColors.Instance[2]; ChangeColor("Cm", ref tmpColor, ref cMTexture); GUIColors.Instance[2] = tmpColor; tmpColor = GUIColors.Instance[3]; ChangeColor("L_D", ref tmpColor, ref l_DTexture); GUIColors.Instance[3] = tmpColor; FARActionGroupConfiguration.DrawGUI(); GUILayout.Label("Other Options"); // DaMichel: put it above the toolbar toggle FARDebugValues.aeroFailureExplosions = GUILayout.Toggle(FARDebugValues.aeroFailureExplosions, "Aero Failures Create Explosions", thisStyle); FARDebugValues.showMomentArrows = GUILayout.Toggle(FARDebugValues.showMomentArrows, "Show Torque Arrows in Aero Overlay", thisStyle); if (ToolbarManager.ToolbarAvailable) { FARDebugValues.useBlizzyToolbar = GUILayout.Toggle(FARDebugValues.useBlizzyToolbar, "Use Blizzy78 Toolbar instead of Stock AppManager", thisStyle); bool tmp = FARDebugValues.useBlizzyToolbar; if (tmp != FARDebugValues.useBlizzyToolbar) { if (FARDebugButtonStock != null) ApplicationLauncher.Instance.RemoveModApplication(FARDebugButtonStock); if (FARDebugButtonBlizzy != null) FARDebugButtonBlizzy.Destroy(); if (FARDebugValues.useBlizzyToolbar) { FARDebugButtonBlizzy = ToolbarManager.Instance.add("ferram4", "FARDebugButtonBlizzy"); FARDebugButtonBlizzy.TexturePath = "FerramAerospaceResearch/Textures/icon_button_blizzy"; FARDebugButtonBlizzy.ToolTip = "FAR Debug Options"; FARDebugButtonBlizzy.OnClick += (e) => debugMenu = !debugMenu; } else GameEvents.onGUIApplicationLauncherReady.Add(OnGUIAppLauncherReady); } } GUILayout.EndVertical(); GUILayout.BeginVertical(); FARSettingsScenarioModule.Instance.DisplaySelection(); GUILayout.EndVertical(); GUILayout.EndHorizontal(); } private void ChangeColor(string colorTitle, ref Color input, ref Texture2D texture) { GUILayout.BeginHorizontal(); GUILayout.Label(colorTitle + " (r,g,b):", GUILayout.Width(80)); bool updateTexture = false; GUILayout.BeginHorizontal(GUILayout.Width(100)); float tmp = input.r; input.r = (float)GUIUtils.TextEntryForDouble("", 0, input.r); updateTexture |= tmp != input.r; GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(GUILayout.Width(100)); tmp = input.g; input.g = (float)GUIUtils.TextEntryForDouble("", 0, input.g); updateTexture |= tmp != input.g; GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(GUILayout.Width(100)); tmp = input.b; input.b = (float)GUIUtils.TextEntryForDouble("", 0, input.b); updateTexture |= tmp != input.b; GUILayout.EndHorizontal(); if (updateTexture) ReColorTexture(ref input, ref texture); Rect textRect = GUILayoutUtility.GetRect(25, 15); textRect.Set(textRect.x, textRect.y + 10, textRect.width, textRect.height); GUI.DrawTexture(textRect, texture); GUILayout.EndHorizontal(); } public static void ReColorTexture(ref Color color, ref Texture2D texture) { for (int i = 0; i < texture.width; i++) for (int j = 0; j < texture.height; j++) texture.SetPixel(i, j, color); texture.Apply(); } public static void LoadConfigs(ConfigNode node) { config = KSP.IO.PluginConfiguration.CreateForType<FARSettingsScenarioModule>(); config.load(); bool tmp; if (node.HasValue("allowStructuralFailures") && bool.TryParse(node.GetValue("allowStructuralFailures"), out tmp)) FARDebugValues.allowStructuralFailures = tmp; else FARDebugValues.allowStructuralFailures = true; if (node.HasValue("showMomentArrows") && bool.TryParse(node.GetValue("showMomentArrows"), out tmp)) FARDebugValues.showMomentArrows = tmp; else FARDebugValues.showMomentArrows = false; if (node.HasValue("useBlizzyToolbar") && bool.TryParse(node.GetValue("useBlizzyToolbar"), out tmp)) FARDebugValues.useBlizzyToolbar = tmp; else FARDebugValues.useBlizzyToolbar = false; if (node.HasValue("aeroFailureExplosions") && bool.TryParse(node.GetValue("aeroFailureExplosions"), out tmp)) FARDebugValues.aeroFailureExplosions = tmp; else FARDebugValues.aeroFailureExplosions = true; FARAeroStress.LoadStressTemplates(); FARAeroUtil.LoadAeroDataFromConfig(); FARActionGroupConfiguration.LoadConfiguration(); FARAnimOverrides.LoadAnimOverrides(); Color tmpColor = GUIColors.Instance[0]; ReColorTexture(ref tmpColor, ref cLTexture); GUIColors.Instance[0] = tmpColor; tmpColor = GUIColors.Instance[1]; ReColorTexture(ref tmpColor, ref cDTexture); GUIColors.Instance[1] = tmpColor; tmpColor = GUIColors.Instance[2]; ReColorTexture(ref tmpColor, ref cMTexture); GUIColors.Instance[2] = tmpColor; tmpColor = GUIColors.Instance[3]; ReColorTexture(ref tmpColor, ref l_DTexture); GUIColors.Instance[3] = tmpColor; } public static void SaveConfigs(ConfigNode node) { node.AddValue("allowStructuralFailures", FARDebugValues.allowStructuralFailures); node.AddValue("showMomentArrows", FARDebugValues.showMomentArrows); node.AddValue("useBlizzyToolbar", FARDebugValues.useBlizzyToolbar & ToolbarManager.ToolbarAvailable); node.AddValue("aeroFailureExplosions", FARDebugValues.aeroFailureExplosions); FARAeroUtil.SaveCustomAeroDataToConfig(); FARAeroStress.SaveCustomStressTemplates(); FARActionGroupConfiguration.SaveConfigruration(); GUIColors.Instance.SaveColors(); config.save(); } void OnDestroy() { if (!CompatibilityChecker.IsAllCompatible()) return; //SaveConfigs(); GameEvents.onGUIApplicationLauncherReady.Remove(OnGUIAppLauncherReady); if (FARDebugButtonStock != null) ApplicationLauncher.Instance.RemoveModApplication(FARDebugButtonStock); if (FARDebugButtonBlizzy != null) FARDebugButtonBlizzy.Destroy(); } } public static class FARDebugValues { //Right-click menu options public static bool allowStructuralFailures = true; public static bool showMomentArrows = false; public static bool useBlizzyToolbar = false; public static bool aeroFailureExplosions = true; } }
gpl-3.0
zeiss-microscopy/libCZI
Doc/html/structlib_c_z_i_1_1_pyramid_statistics.js
513
var structlib_c_z_i_1_1_pyramid_statistics = [ [ "PyramidLayerInfo", "structlib_c_z_i_1_1_pyramid_statistics_1_1_pyramid_layer_info.html", "structlib_c_z_i_1_1_pyramid_statistics_1_1_pyramid_layer_info" ], [ "PyramidLayerStatistics", "structlib_c_z_i_1_1_pyramid_statistics_1_1_pyramid_layer_statistics.html", "structlib_c_z_i_1_1_pyramid_statistics_1_1_pyramid_layer_statistics" ], [ "scenePyramidStatistics", "structlib_c_z_i_1_1_pyramid_statistics.html#a07ba65bd447d746f10ab578060d25959", null ] ];
gpl-3.0
MX-Linux/mx-system-sounds
translations/mx-system-sounds_he_IL.ts
8742
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.1" language="he_IL"> <context> <name>MainWindow</name> <message> <location filename="../mainwindow.ui" line="14"/> <location filename="../mainwindow.cpp" line="72"/> <location filename="../mainwindow.cpp" line="279"/> <location filename="../mainwindow.cpp" line="291"/> <location filename="../mainwindow.cpp" line="325"/> <source>MX System Sounds</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mainwindow.ui" line="48"/> <source>Event Sounds</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mainwindow.ui" line="61"/> <source>Session Sounds</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mainwindow.ui" line="68"/> <source>XFCE Event Sounds</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mainwindow.ui" line="75"/> <source>Login</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mainwindow.ui" line="82"/> <source>XFCE Input Feedback Sounds</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mainwindow.ui" line="89"/> <source>Logout</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mainwindow.ui" line="118"/> <source>Custom Sounds</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mainwindow.ui" line="125"/> <source>Theme</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mainwindow.ui" line="132"/> <location filename="../mainwindow.ui" line="153"/> <source>Login Sound</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mainwindow.ui" line="139"/> <location filename="../mainwindow.ui" line="185"/> <source>...</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mainwindow.ui" line="164"/> <location filename="../mainwindow.ui" line="207"/> <location filename="../mainwindow.ui" line="210"/> <source>Theme Default</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mainwindow.ui" line="167"/> <source>Use Default</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mainwindow.ui" line="178"/> <location filename="../mainwindow.ui" line="196"/> <source>Logout Sound</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mainwindow.ui" line="229"/> <source>Borealis</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mainwindow.ui" line="260"/> <source>About this application</source> <translation type="unfinished">מידע לגבי התוכנה הזו</translation> </message> <message> <location filename="../mainwindow.ui" line="263"/> <source>About...</source> <translation type="unfinished">אודות...</translation> </message> <message> <location filename="../mainwindow.ui" line="270"/> <source>Alt+B</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mainwindow.ui" line="286"/> <source>Display help </source> <translation type="unfinished"></translation> </message> <message> <location filename="../mainwindow.ui" line="289"/> <source>Help</source> <translation type="unfinished">עזרה</translation> </message> <message> <location filename="../mainwindow.ui" line="296"/> <source>Alt+H</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mainwindow.ui" line="354"/> <source>Apply</source> <translation type="unfinished">אשר</translation> </message> <message> <location filename="../mainwindow.ui" line="380"/> <source>Quit application</source> <translation type="unfinished">יציאה מהתוכנה</translation> </message> <message> <location filename="../mainwindow.ui" line="383"/> <source>Close</source> <translation type="unfinished">סגור</translation> </message> <message> <location filename="../mainwindow.ui" line="390"/> <source>Alt+N</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mainwindow.cpp" line="278"/> <source>About MX System Sounds</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mainwindow.cpp" line="279"/> <source>Version: </source> <translation type="unfinished">גרסה:</translation> </message> <message> <location filename="../mainwindow.cpp" line="280"/> <source>Configure Event &amp; Session Sounds</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mainwindow.cpp" line="282"/> <source>Copyright (c) MX Linux</source> <translation type="unfinished">זכויות שמורות MX Linux</translation> </message> <message> <location filename="../mainwindow.cpp" line="283"/> <location filename="../mainwindow.cpp" line="291"/> <source>License</source> <translation type="unfinished">רשיון</translation> </message> <message> <location filename="../mainwindow.cpp" line="284"/> <source>Changelog</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mainwindow.cpp" line="285"/> <source>Cancel</source> <translation type="unfinished">ביטול</translation> </message> <message> <location filename="../mainwindow.cpp" line="300"/> <source>&amp;Close</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mainwindow.cpp" line="344"/> <location filename="../mainwindow.cpp" line="374"/> <source>Select Sound File</source> <translation type="unfinished"></translation> </message> <message> <location filename="../mainwindow.cpp" line="344"/> <location filename="../mainwindow.cpp" line="374"/> <source>Sound Files (*.mp3 *.m4a *.aac *.flac *.ogg *.oga *.wav)</source> <translation type="unfinished"></translation> </message> </context> <context> <name>mxsystemsounds</name> <message> <source>About this application</source> <translation type="vanished">מידע לגבי התוכנה הזו</translation> </message> <message> <source>About...</source> <translation type="vanished">אודות...</translation> </message> <message> <source>Help</source> <translation type="vanished">עזרה</translation> </message> <message> <source>Apply</source> <translation type="vanished">אשר</translation> </message> <message> <source>Quit application</source> <translation type="vanished">יציאה מהתוכנה</translation> </message> <message> <source>Close</source> <translation type="vanished">סגור</translation> </message> <message> <source>Version: </source> <translation type="vanished">גרסה:</translation> </message> <message> <source>Copyright (c) MX Linux</source> <translation type="vanished">זכויות שמורות MX Linux</translation> </message> <message> <source>License</source> <translation type="vanished">רשיון</translation> </message> <message> <source>Cancel</source> <translation type="vanished">ביטול</translation> </message> </context> </TS>
gpl-3.0
fishjar/gabe-study-notes
java/test/HorrorShow.java
660
//: HorrorShow.java // Extending an interface with inheritance interface Monster { void menace(); } interface DangerousMonster extends Monster { void destroy(); } interface Lethal { void kill(); } class DragonZilla implements DangerousMonster { public void menace() { } public void destroy() { } } interface Vampire extends DangerousMonster, Lethal { void drinkBlood(); } class HorrorShow { static void u(Monster b) { b.menace(); } static void v(DangerousMonster d) { d.menace(); d.destroy(); } public static void main(String[] args) { DragonZilla if2 = new DragonZilla(); u(if2); v(if2); } } /// :~
gpl-3.0
fparadis2/mox
Source/Mox.Engine/Tests/Source/Rule Engine/Flow/Parts/GivePriorityTests.cs
2522
// Copyright (c) François Paradis // This file is part of Mox, a card game simulator. // // Mox is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, version 3 of the License. // // Mox is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Mox. If not, see <http://www.gnu.org/licenses/>. using System; using NUnit.Framework; namespace Mox.Flow.Parts { [TestFixture] public class GivePriorityTests : PartTestBase { #region Variables private GivePriority m_part; private MockPlayerAction m_mockAction; #endregion #region Setup / Teardown public override void Setup() { base.Setup(); m_mockAction = new MockPlayerAction { ExpectedPlayer = m_playerA }; m_part = new GivePriority(m_playerA); } #endregion #region Tests [Test] public void Test_Invalid_construction_arguments() { Assert.Throws<ArgumentNullException>(delegate { new GivePriority(null); }); } [Test] public void Test_If_player_returns_null_it_returns_null() { Assert.IsNull(ExecuteWithChoice(m_part, null)); Assert.IsTrue(m_lastContext.PopArgument<bool>(GivePriority.ArgumentToken)); Assert.Collections.IsEmpty(m_lastContext.ScheduledParts); } [Test] public void Test_If_player_returns_an_invalid_action_it_retries() { m_mockAction.IsValid = false; Assert.AreEqual(m_part, ExecuteWithChoice(m_part, m_mockAction)); Assert.Collections.IsEmpty(m_lastContext.ScheduledParts); } [Test] public void Test_If_player_returns_a_valid_action_it_is_executed() { m_mockAction.IsValid = true; Assert.IsNull(ExecuteWithChoice(m_part, m_mockAction)); Assert.IsFalse(m_lastContext.PopArgument<bool>(GivePriority.ArgumentToken)); Assert.Collections.IsEmpty(m_lastContext.ScheduledParts); } #endregion } }
gpl-3.0
LEDfan/keywi
content_scripts/confirm.js
958
/** * @copyright (C) 2017 Tobia De Koninck * @copyright (C) 2017 Robin Jadoul * * This file is part of Keywi. * Keywi is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Keywi is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Keywi. If not, see <http://www.gnu.org/licenses/>. */ browser.runtime.onMessage.addListener(function (request, sender, sendResponse) { if (request.type === 'confirm') { const userInput = confirm(request.msg); sendResponse({'userInput': userInput}); } });
gpl-3.0
trackplus/Genji
src/main/java/com/aurel/track/item/consInf/RaciRoleAction.java
5189
/** * Genji Scrum Tool and Issue Tracker * Copyright (C) 2015 Steinbeis GmbH & Co. KG Task Management Solutions * <a href="http://www.trackplus.com">Genji Scrum Tool</a> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* $Id:$ */ package com.aurel.track.item.consInf; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import org.apache.struts2.ServletActionContext; import org.apache.struts2.interceptor.SessionAware; import com.aurel.track.Constants; import com.aurel.track.beans.TPersonBean; import com.aurel.track.errors.ErrorData; import com.aurel.track.fieldType.runtime.base.WorkItemContext; import com.aurel.track.item.ItemDetailBL; import com.aurel.track.json.JSONUtility; import com.aurel.track.util.StringArrayParameterUtils; import com.opensymphony.xwork2.ActionSupport; import com.opensymphony.xwork2.Preparable; /** * Action class with "load", "save" (add from popup) operations * for consultant/informant groups/persons * @author Tamas Ruff * */ public class RaciRoleAction extends ActionSupport implements Preparable,SessionAware { private static final long serialVersionUID = 3809471451325218395L; private Map<String, Object> session; private Locale locale; private boolean create; private String raciRole; private Integer workItemID; private Integer projectID; private Integer issueTypeID; private ConsInfEdit consInfEdit; //internals private ConsInfShow consInfShow; private Integer person; @Override public void prepare() throws Exception { locale = (Locale) session.get(Constants.LOCALE_KEY); create=(workItemID==null); WorkItemContext ctx=(WorkItemContext)session.get("workItemContext"); person = ((TPersonBean) session.get(Constants.USER_KEY)).getObjectID(); if(ctx!=null){ consInfShow = ctx.getConsInfShow(); }else{ consInfShow = new ConsInfShow(); ConsInfBL.loadConsInfFromDb(workItemID, person, consInfShow); } consInfEdit = new ConsInfEdit(); } /** * Loads the not yet selected raci-persons. * Depending on create or edit mode * it loads from session or from database */ public String load() { List<ErrorData> errors; if (create) { errors = RaciRoleBL.loadFromSession(projectID, issueTypeID, raciRole, consInfEdit, consInfShow); } else { errors = RaciRoleBL.loadFromDb(projectID, issueTypeID, workItemID, raciRole, consInfEdit); } if (errors!=null && !errors.isEmpty()) { Iterator<ErrorData> iterator = errors.iterator(); ErrorData errorData = iterator.next(); addActionError(getText(errorData.getResourceKey())); } JSONUtility.encodeJSON(ServletActionContext.getResponse(), ItemDetailBL.encodeJSON_AddRole(consInfEdit)); return null; } /** * Saves the checked raci-persons. * Depending on create or edit mode * it saves in session or in database * @return */ public String save() { String selectedPersonsStr=consInfEdit.getSelectedPersonsStr(); if(selectedPersonsStr!=null){ consInfEdit.setSelectedPersons(StringArrayParameterUtils.splitSelectionAsIntegerArray(selectedPersonsStr,",")); } List<ErrorData> errors; if (create) { errors = RaciRoleBL.saveToSession(projectID,issueTypeID, person, raciRole, consInfEdit, consInfShow); } else { errors = RaciRoleBL.saveToDb(projectID,issueTypeID, workItemID, raciRole, consInfEdit, person, locale); } String result; if (errors!=null && !errors.isEmpty()) { Iterator<ErrorData> iterator = errors.iterator(); ErrorData errorData = iterator.next(); result=JSONUtility.encodeJSONFailure(getText(errorData.getResourceKey())); }else{ result=JSONUtility.encodeJSONSuccess(); } JSONUtility.encodeJSON(ServletActionContext.getResponse(), result); return null; } @Override public void setSession(Map<String, Object> session) { this.session = session; } public String getRaciRole() { return raciRole; } public void setRaciRole(String raciRole) { this.raciRole = raciRole; } public Integer getWorkItemID() { return workItemID; } public void setWorkItemID(Integer workItemID) { this.workItemID = workItemID; } public Integer getProjectID() { return projectID; } public void setProjectID(Integer projectID) { this.projectID = projectID; } public Integer getIssueTypeID() { return issueTypeID; } public void setIssueTypeID(Integer issueTypeID) { this.issueTypeID = issueTypeID; } public ConsInfEdit getConsInfEdit() { return consInfEdit; } public void setConsInfEdit(ConsInfEdit consInfEdit) { this.consInfEdit = consInfEdit; } }
gpl-3.0
andmar8/Panopto-Java-SerializableObjects
src/panopto/resource/collections/impl/Groups.java
1817
/* * This file is part of Panopto-Java-SerializableObjects. * * Panopto-Java-SerializableObjects is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Panopto-Java-SerializableObjects is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Panopto-Java-SerializableObjects. If not, see <http://www.gnu.org/licenses/>. * * Copyright: Andrew Martin, Newcastle University * */ package panopto.resource.collections.impl; //java import java.util.List; //javax import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import panopto.resource.Group; @XmlRootElement(name="groups") public class Groups { private List<Group> groups; public Groups(){this.groups = new java.util.ArrayList<Group>();} public Groups(List<Group> groups){this.groups = groups;} @XmlElement(name="group") public List<Group> getGroups(){return this.groups;} public void setGroups(List<Group> groups){this.groups = groups;} public void addGroup(Group group){this.groups.add(group);} public Group getAGroup(String groupId) { Group temp; java.util.Iterator<Group> i = this.groups.iterator(); while(i.hasNext()) { temp = i.next(); if(temp.getId().equals(groupId)) { return temp; } } return null; } }
gpl-3.0
deinonychuscowboy/derecho
src/DerechoBundle/Lib/Form/Settings/Theme.php
394
<?php namespace DerechoBundle\Lib\Form\Settings; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; class Theme extends AbstractType { public function buildForm(FormBuilderInterface $builder,array $options) { $builder->add("value","choice",["choices"=>["theme-clean"=>"Clean","theme-rich"=>"Rich","theme-plateau"=>"Plateau"],"label"=>false]); } }
gpl-3.0
noxsnono/Bomberman_42
src/map/mapparser.class.cpp
9453
// ************************************************************************** // // 24 Bomb // // By: rcargou <rcargou@student.42.fr> ::: :::::::: // // By: nmohamed <nmohamed@student.42.fr> :+: :+: :+: // // By: adjivas <adjivas@student.42.fr> +:+ +:+ +:+ // // By: vjacquie <vjacquie@student.42.fr> +#+ +:+ +#+ // // By: jmoiroux <jmoiroux@student.42.fr> +#+#+#+#+#+ +#+ // // Created: 2015/10/16 17:03:20 by rcargou #+# #+# // // Updated: 2015/10/27 14:00:02 by rcargou ### ########.fr // // // // ************************************************************************** // #include <mapparser.class.hpp> #include <entity.class.hpp> #include <wall.class.hpp> #include <bomb.class.hpp> #include <fire.class.hpp> #include <player.class.hpp> #include <enemy.class.hpp> #include <boss.class.hpp> #include <globject.class.hpp> #include <event.class.hpp> Entity *** Mapparser::map_from_file( char *map_path ) { if (NULL != main_event->map) Mapparser::free_old_map(); Entity *** tmp = Mapparser::map_alloc(); Entity * elem = NULL; std::fstream file; std::string line; std::string casemap; int i = 0, j = globject::mapY_size - 1, x = 0; Mapparser::valid_map(map_path); file.open(map_path , std::fstream::in); for (int x = 0; x < 3; x++) std::getline(file, line); while (j >= 0) { i = ((globject::mapX_size - 1) * 4 ); x = globject::mapX_size - 1; std::getline(file, line); while (i >= 0) { casemap += line[i]; casemap += line[i + 1]; casemap += line[i + 2]; elem = Mapparser::get_entity_from_map( casemap, (float)x, (float)j ); if (elem->type == PLAYER || elem->type == ENEMY || elem->type == BOSS) { tmp[j][x] = Factory::create_empty((int)x, (int)j); main_event->char_list.push_back(elem); } else tmp[j][x] = elem; casemap.clear(); i -= 4; x--; if ( i < 0 ) break; } j--; } main_event->w_log("Mapparser::map_from_file LOADED"); return tmp; } Entity * Mapparser::get_entity_from_map( std::string & casemap, float x, float y) { Entity * tmp = NULL; if ( g_mapcase.count(casemap) == 0) { main_event->w_error("Map file Case Syntax error/doesn't exist"); throw std::exception(); } else { switch (g_mapcase.at(casemap)) { case EMPTY: return static_cast<Entity*>( Factory::create_empty(x, y) ); case WALL_INDESTRUCTIBLE: return static_cast<Entity*>( Factory::create_wall(WALL_INDESTRUCTIBLE, x, y, WALL_INDESTRUCTIBLE) ); case WALL_HP_1: return static_cast<Entity*>( Factory::create_wall(WALL_HP_1, x, y, WALL_HP_1) ); case WALL_HP_2: return static_cast<Entity*>( Factory::create_wall(WALL_HP_2, x, y, WALL_HP_2) ); case WALL_HP_3: return static_cast<Entity*>( Factory::create_wall(WALL_HP_3, x, y, WALL_HP_3) ); case WALL_HP_4: return static_cast<Entity*>( Factory::create_wall(WALL_HP_4, x, y, WALL_HP_4) ); case ENEMY1: return static_cast<Entity*>( Factory::create_enemy(ENEMY, x, y, ENEMY1) ); case ENEMY2: return static_cast<Entity*>( Factory::create_enemy(ENEMY, x, y, ENEMY2) ); case ENEMY3: return static_cast<Entity*>( Factory::create_enemy(ENEMY, x, y, ENEMY3) ); case ENEMY4: return static_cast<Entity*>( Factory::create_enemy(ENEMY, x, y, ENEMY4) ); case ENEMY5: return static_cast<Entity*>( Factory::create_enemy(ENEMY, x, y, ENEMY5) ); case BOSS_A: return static_cast<Entity*>( Factory::create_boss(BOSS, x, y, BOSS_A, BOSS_A) ); case BOSS_B: return static_cast<Entity*>( Factory::create_boss(BOSS, x, y, BOSS_B, BOSS_B) ); case BOSS_C: return static_cast<Entity*>( Factory::create_boss(BOSS, x, y, BOSS_C, BOSS_C) ); case BOSS_D: return static_cast<Entity*>( Factory::create_boss(BOSS, x, y, BOSS_C, BOSS_D) ); case PLAYER1: return static_cast<Entity*>( Factory::create_player( PLAYER, x, y, PLAYER1) ); case PLAYER2: return static_cast<Entity*>( Factory::create_player( PLAYER, x, y, PLAYER2) ); case PLAYER3: return static_cast<Entity*>( Factory::create_player( PLAYER, x, y, PLAYER3) ); case PLAYER4: return static_cast<Entity*>( Factory::create_player( PLAYER, x, y, PLAYER4) ); case PLAYER5: return static_cast<Entity*>( Factory::create_player( PLAYER, x, y, PLAYER5) ); case PLAYER6: return static_cast<Entity*>( Factory::create_player( PLAYER, x, y, PLAYER6) ); case PLAYER7: return static_cast<Entity*>( Factory::create_player( PLAYER, x, y, PLAYER7) ); case PLAYER8: return static_cast<Entity*>( Factory::create_player( PLAYER, x, y, PLAYER8) ); case PLAYER9: return static_cast<Entity*>( Factory::create_player( PLAYER, x, y, PLAYER9) ); case PLAYER10: return static_cast<Entity*>( Factory::create_player( PLAYER, x, y, PLAYER10) ); case BONUS_POWER_UP: return static_cast<Entity*>( Factory::create_player( BONUS, x, y, BONUS_POWER_UP) ); case BONUS_PLUS_ONE: return static_cast<Entity*>( Factory::create_player( BONUS, x, y, BONUS_PLUS_ONE) ); case BONUS_KICK: return static_cast<Entity*>( Factory::create_player( BONUS, x, y, BONUS_KICK) ); case BONUS_CHANGE: return static_cast<Entity*>( Factory::create_player( BONUS, x, y, BONUS_CHANGE) ); case BONUS_REMOTE_BOMB: return static_cast<Entity*>( Factory::create_player( BONUS, x, y, BONUS_REMOTE_BOMB) ); case BONUS_SPEED_UP: return static_cast<Entity*>( Factory::create_player( BONUS, x, y, BONUS_SPEED_UP) ); default: return static_cast<Entity*>( Factory::create_empty(x, y) ); } } return tmp; } int Mapparser::valid_map( char const *map_path ) { std::fstream file; std::string line; int x = 0, y = 0, j = 0; if( access( map_path, F_OK ) < 0 ) { main_event->w_error("Mapparser::valid_map file access error"); throw std::exception(); } file.open(map_path , std::fstream::in); if (!file.is_open()) { main_event->w_error("Mapparser::valid_map file open error"); throw std::exception(); } std::getline(file, line); // y: 20 if (line.length() >= 4) x = std::stoi(&line[3]); else main_event->w_exception("map line 1 error"); std::getline(file, line); // x: 20 if (line.length() >= 4) y = std::stoi(&line[3]); else main_event->w_exception("map line 2 error"); std::getline(file, line); // <-- MAP --> j = 0; while ( std::getline(file, line) ) { if ((int)line.length() != (4 * x - 1) ) { main_event->w_exception("width doesn't correspond"); } if (j >= y - 1) break; j++; } if (j != y - 1) main_event->w_exception("Map height doesn't correspond"); file.close(); return 0; } Entity *** Mapparser::map_alloc() { // return map 2d without entity int y = 0; Entity *** new_map = NULL; // TO DELETE SI SEGFAULT // if (main_event->map != NULL) { // while (y < globject::mapY_size) { // std::free(main_event->map[y]); // main_event->map[y] = NULL; // y++; // } // std::free(main_event->map); // main_event->map = NULL; // } ///////////////////// new_map = (Entity ***)std::malloc(sizeof(Entity **) * globject::mapY_size); if (new_map == NULL) { main_event->w_error("Mapparser::map_alloc() new_map Allocation error"); throw std::exception(); } y = 0; while (y < globject::mapY_size) { new_map[y] = NULL; new_map[y] = (Entity **)std::malloc(sizeof(Entity *) * globject::mapX_size); if (new_map[y] == NULL) { main_event->w_error("Mapparser::map_alloc() new_map[y] Allocation error"); throw std::exception(); } y++; } return new_map; } void Mapparser::free_old_map() { int y = 0; while (y < globject::mapY_size) { if (NULL != main_event->map[y]) std::free( main_event->map[y]); y++; } if (NULL != main_event->map) std::free(main_event->map); main_event->map = NULL; } void Mapparser::get_error() const { if (NULL != Mapparser::error) std::cerr << Mapparser::error; } std::string * Mapparser::error = NULL; Mapparser::Mapparser() {} Mapparser::~Mapparser() {} Mapparser::Mapparser( Mapparser const & src ) { *this = src; } Mapparser & Mapparser::operator=( Mapparser const & rhs ) { if (this != &rhs) { this->error = rhs.error; } return *this; }
gpl-3.0
CLLKazan/iCQA
qa-engine/forum_modules/sximporter/importer.py
30733
# -*- coding: utf-8 -*- from datetime import datetime import time import re import os import gc from django.utils.translation import ugettext as _ from django.utils.encoding import force_unicode try: from cPickle import loads, dumps except ImportError: from pickle import loads, dumps from copy import deepcopy from base64 import b64encode, b64decode from zlib import compress, decompress from xml.sax import make_parser from xml.sax.handler import ContentHandler def create_orm(): from django.conf import settings from south.orm import FakeORM get_migration_number_re = re.compile(r'^((\d+)_.*)\.py$') migrations_folder = os.path.join(settings.SITE_SRC_ROOT, 'forum/migrations') highest_number = 0 highest_file = None for f in os.listdir(migrations_folder): if os.path.isfile(os.path.join(migrations_folder, f)): m = get_migration_number_re.match(f) if m: found = int(m.group(2)) if found > highest_number: highest_number = found highest_file = m.group(1) mod = __import__('forum.migrations.%s' % highest_file, globals(), locals(), ['forum.migrations']) return FakeORM(getattr(mod, 'Migration'), "forum") orm = create_orm() class SXTableHandler(ContentHandler): def __init__(self, fname, callback): self.in_row = False self.el_data = {} self.ch_data = '' self.fname = fname.lower() self.callback = callback def startElement(self, name, attrs): if name.lower() == self.fname: pass elif name.lower() == "row": self.in_row = True for i in attrs.keys(): self.el_data[i.lower()] = attrs.get(i) def characters(self, ch): self.ch_data += ch def endElement(self, name): if name.lower() == self.fname: pass elif name.lower() == "row": if self.el_data: self.callback(self.el_data) self.in_row = False del self.el_data self.el_data = {} elif self.in_row: self.el_data[name.lower()] = self.ch_data.strip() del self.ch_data self.ch_data = '' def readTable(path, name, callback): parser = make_parser() handler = SXTableHandler(name, callback) parser.setContentHandler(handler) f = os.path.join(path, "%s.xml" % name) parser.parse(f) def dbsafe_encode(value): return force_unicode(b64encode(compress(dumps(deepcopy(value))))) def getText(el): rc = "" for node in el.childNodes: if node.nodeType == node.TEXT_NODE: rc = rc + node.data return rc.strip() msstrip = re.compile(r'^(.*)\.\d+') def readTime(ts): noms = msstrip.match(ts) if noms: ts = noms.group(1) try: return datetime(*time.strptime(ts, '%Y-%m-%dT%H:%M:%S')[0:6]) except ValueError: return datetime(*time.strptime(ts, '%Y-%m-%d')[0:3]) #def readEl(el): # return dict([(n.tagName.lower(), getText(n)) for n in el.childNodes if n.nodeType == el.ELEMENT_NODE]) #def readTable(dump, name): # for e in minidom.parseString(dump.read("%s.xml" % name)).getElementsByTagName('row'): # yield readEl(e) #return [readEl(e) for e in minidom.parseString(dump.read("%s.xml" % name)).getElementsByTagName('row')] class UnknownUser(object): def __init__(self, id): self._id = id def __str__(self): return _("user-%(id)s") % {'id': self._id} def __unicode__(self): return self.__str__() def encode(self, *args): return self.__str__() class IdMapper(dict): def __init__(self): self.default = 1 def __getitem__(self, key): key = int(key) return super(IdMapper, self).get(key, self.default) def __setitem__(self, key, value): super(IdMapper, self).__setitem__(int(key), int(value)) class IdIncrementer(): def __init__(self, initial): self.value = initial def inc(self): self.value += 1 openidre = re.compile('^https?\:\/\/') def userimport(path, options): usernames = [] openids = set() uidmapper = IdMapper() authenticated_user = options.get('authenticated_user', None) owneruid = options.get('owneruid', None) #check for empty values if not owneruid: owneruid = None else: owneruid = int(owneruid) def callback(sxu): create = True set_mapper_defaults = False if sxu.get('id','-1') == '-1': return #print "\n".join(["%s : %s" % i for i in sxu.items()]) if (owneruid and (int(sxu.get('id')) == owneruid)) or ( (not owneruid) and len(uidmapper)): set_mapper_defaults = True if authenticated_user: osqau = orm.User.objects.get(id=authenticated_user.id) for assoc in orm.AuthKeyUserAssociation.objects.filter(user=osqau): openids.add(assoc.key) uidmapper[owneruid] = osqau.id create = False sxbadges = sxu.get('badgesummary', None) badges = {'1':'0', '2':'0', '3':'0'} if sxbadges: badges.update(dict([b.split('=') for b in sxbadges.split()])) if create: username = sxu.get('displayname').strip() if username in usernames: username += " " + sxu.get('id') #if options.get('mergesimilar', False) and sxu.get('email', 'INVALID') == user_by_name[username].email: # osqau = user_by_name[username] # create = False # uidmapper[sxu.get('id')] = osqau.id osqau = orm.User( id = sxu.get('id'), username = username, password = '!', email = sxu.get('emailhash', ''), is_active = True, date_joined = readTime(sxu.get('creationdate')), last_seen = readTime(sxu.get('lastaccessdate')), about = sxu.get('aboutme', ''), date_of_birth = sxu.get('birthday', None) and readTime(sxu['birthday']) or None, website = sxu.get('websiteurl', ''), reputation = int(sxu.get('reputation')), gold = int(badges['1']), silver = int(badges['2']), bronze = int(badges['3']), real_name = sxu.get('realname', '')[:30], location = sxu.get('location', ''), ) osqau.save() user_joins = orm.Action( action_type = "userjoins", action_date = osqau.date_joined, user = osqau ) user_joins.save() rep = orm.ActionRepute( value = 1, user = osqau, date = osqau.date_joined, action = user_joins ) rep.save() try: orm.SubscriptionSettings.objects.get(user=osqau) except: s = orm.SubscriptionSettings(user=osqau) s.save() uidmapper[osqau.id] = osqau.id else: new_about = sxu.get('aboutme', None) if new_about and osqau.about != new_about: if osqau.about: osqau.about = "%s\n|\n%s" % (osqau.about, new_about) else: osqau.about = new_about osqau.username = sxu.get('displayname') osqau.email = sxu.get('emailhash', '') osqau.reputation += int(sxu.get('reputation')) osqau.gold += int(badges['1']) osqau.silver += int(badges['2']) osqau.bronze += int(badges['3']) osqau.date_joined = readTime(sxu.get('creationdate')) osqau.website = sxu.get('websiteurl', '') osqau.date_of_birth = sxu.get('birthday', None) and readTime(sxu['birthday']) or None osqau.location = sxu.get('location', '') osqau.real_name = sxu.get('realname', '') #merged_users.append(osqau.id) osqau.save() if set_mapper_defaults: uidmapper[-1] = osqau.id uidmapper.default = osqau.id usernames.append(osqau.username) readTable(path, "users", callback) #if uidmapper[-1] == -1: # uidmapper[-1] = 1 return uidmapper def add_post_state(name, post, action): if not "(%s)" % name in post.state_string: post.state_string = "%s(%s)" % (post.state_string, name) post.save() try: state = orm.NodeState.objects.get(node=post, state_type=name) state.action = action state.save() except: state = orm.NodeState(node=post, state_type=name, action=action) state.save() def remove_post_state(name, post): if "(%s)" % name in post.state_string: try: state = orm.NodeState.objects.get(state_type=name, post=post) state.delete() except: pass post.state_string = "".join("(%s)" % s for s in re.findall('\w+', post.state_string) if s != name) def postimport(dump, uidmap,tagmap): all = [] def callback(sxpost): nodetype = (sxpost.get('posttypeid') == '1') and "nodetype" or "answer" post = orm.Node( node_type = nodetype, id = sxpost['id'], added_at = readTime(sxpost['creationdate']), body = sxpost['body'], score = sxpost.get('score', 0), author_id = sxpost.get('deletiondate', None) and 1 or uidmap[sxpost.get('owneruserid', 1)] ) post.save() create_action = orm.Action( action_type = (nodetype == "nodetype") and "ask" or "answer", user_id = post.author_id, node = post, action_date = post.added_at ) create_action.save() if sxpost.get('lasteditoruserid', None): revise_action = orm.Action( action_type = "revise", user_id = uidmap[sxpost.get('lasteditoruserid')], node = post, action_date = readTime(sxpost['lasteditdate']), ) revise_action.save() post.last_edited = revise_action if sxpost.get('communityowneddate', None): wikify_action = orm.Action( action_type = "wikify", user_id = uidmap[1], node = post, action_date = readTime(sxpost['communityowneddate']) ) wikify_action.save() add_post_state("wiki", post, wikify_action) if sxpost.get('lastactivityuserid', None): post.last_activity_by_id = uidmap[sxpost['lastactivityuserid']] post.last_activity_at = readTime(sxpost['lastactivitydate']) else: post.last_activity_by_id = post.author_id post.last_activity_at = post.added_at if sxpost.get('posttypeid') == '1': #question post.node_type = "question" post.title = sxpost['title'] tagnames = sxpost['tags'].replace(u'ö', '-').replace(u'é', '').replace(u'à', '')\ .replace('><',' ').replace('>','').replace('<','') post.tagnames = tagnames post.extra_count = sxpost.get('viewcount', 0) tags = [] for name in tagnames.split(' '): try: otag = tagmap.get(name, orm.Tag.objects.get(name = name)) otag.used_count += 1 except orm.Tag.DoesNotExist: otag = orm.Tag( name = name, used_count = 1, created_by_id = uidmap[1] ) tagmap[otag.name] = otag otag.save() tags.append(otag) post.tags = tags elif 'parentid' in sxpost: post.parent_id = sxpost['parentid'] post.save() all.append(int(post.id)) create_and_activate_revision(post) del post readTable(dump, "posts", callback) return all def comment_import(dump, uidmap, posts): currid = IdIncrementer(max(posts)) mapping = {} def callback(sxc): currid.inc() oc = orm.Node( id = currid.value, node_type = "comment", added_at = readTime(sxc['creationdate']), author_id = uidmap[sxc.get('userid', 1)], body = sxc['text'], parent_id = sxc.get('postid'), ) if sxc.get('deletiondate', None): delete_action = orm.Action( action_type = "delete", user_id = uidmap[sxc['deletionuserid']], action_date = readTime(sxc['deletiondate']) ) oc.author_id = uidmap[sxc['deletionuserid']] oc.save() delete_action.node = oc delete_action.save() add_post_state("deleted", oc, delete_action) else: oc.author_id = uidmap[sxc.get('userid', 1)] oc.save() create_action = orm.Action( action_type = "comment", user_id = oc.author_id, node = oc, action_date = oc.added_at ) create_and_activate_revision(oc) create_action.save() oc.save() posts.append(int(oc.id)) mapping[int(sxc['id'])] = int(oc.id) readTable(dump, "comments", callback) return posts, mapping def add_tags_to_post(post, tagmap): tags = [tag for tag in [tagmap.get(name.strip()) for name in post.tagnames.split(u' ') if name] if tag] post.tagnames = " ".join([t.name for t in tags]).strip() post.tags = tags def create_and_activate_revision(post): rev = orm.NodeRevision( author_id = post.author_id, body = post.body, node_id = post.id, revised_at = post.added_at, revision = 1, summary = 'Initial revision', tagnames = post.tagnames, title = post.title, ) rev.save() post.active_revision_id = rev.id post.save() def post_vote_import(dump, uidmap, posts): user2vote = [] def callback(sxv): action = orm.Action( user_id=uidmap[sxv.get('userid',1)], action_date = readTime(sxv['creationdate']), ) if not int(sxv['postid']) in posts: return node = orm.Node.objects.get(id=sxv['postid']) action.node = node if sxv['votetypeid'] == '1': answer = node question = orm.Node.objects.get(id=answer.parent_id) action.action_type = "acceptanswer" action.save() answer.marked = True question.extra_ref_id = answer.id answer.save() question.save() elif sxv['votetypeid'] in ('2', '3'): action.action_type = (sxv['votetypeid'] == '2') and "voteup" or "votedown" action.save() if not (action.node.id, action.user_id) in user2vote: user2vote.append((action.node.id, action.user_id)) ov = orm.Vote( node_id = action.node.id, user_id = action.user_id, voted_at = action.action_date, value = sxv['votetypeid'] == '2' and 1 or -1, action = action ) ov.save() elif sxv['votetypeid'] in ('4', '12', '13'): action.action_type = "flag" action.save() of = orm.Flag( node = action.node, user_id = action.user_id, flagged_at = action.action_date, reason = '', action = action ) of.save() elif sxv['votetypeid'] == '5': action.action_type = "favorite" action.save() elif sxv['votetypeid'] == '6': action.action_type = "close" #action.extra = dbsafe_encode(close_reasons[sxv['comment']]) action.save() node.marked = True node.save() elif sxv['votetypeid'] == '7': action.action_type = "unknown" action.save() node.marked = False node.save() remove_post_state("closed", node) elif sxv['votetypeid'] == '10': action.action_type = "delete" action.save() elif sxv['votetypeid'] == '11': action.action_type = "unknown" action.save() remove_post_state("deleted", node) else: action.action_type = "unknown" action.save() if sxv.get('targetrepchange', None): rep = orm.ActionRepute( action = action, date = action.action_date, user_id = uidmap[sxv['targetuserid']], value = int(sxv['targetrepchange']) ) rep.save() if sxv.get('voterrepchange', None): rep = orm.ActionRepute( action = action, date = action.action_date, user_id = uidmap[sxv['userid']], value = int(sxv['voterrepchange']) ) rep.save() if action.action_type in ("acceptanswer", "delete", "close"): state = {"acceptanswer": "accepted", "delete": "deleted", "close": "closed"}[action.action_type] add_post_state(state, node, action) readTable(dump, "votes", callback) def comment_vote_import(dump, uidmap, comments): user2vote = [] comments2score = {} def callback(sxv): if sxv['votetypeid'] == "2": comment_id = comments[int(sxv['postcommentid'])] user_id = uidmap[sxv['userid']] if not (comment_id, user_id) in user2vote: user2vote.append((comment_id, user_id)) action = orm.Action( action_type = "voteupcomment", user_id = user_id, action_date = readTime(sxv['creationdate']), node_id = comment_id ) action.save() ov = orm.Vote( node_id = comment_id, user_id = user_id, voted_at = action.action_date, value = 1, action = action ) ov.save() if not comment_id in comments2score: comments2score[comment_id] = 1 else: comments2score[comment_id] += 1 readTable(dump, "Comments2Votes", callback) for cid, score in comments2score.items(): orm.Node.objects.filter(id=cid).update(score=score) def badges_import(dump, uidmap, post_list): obadges = dict([(b.cls, b) for b in orm.Badge.objects.all()]) user_badge_count = {} osqaawards = [] def get_badge(name): if name in obadges: return obadges[name] try: obadges[name] = orm.Badge.objects.get(cls = name) except orm.Badge.DoesNotExist: obadges[name] = None return obadges[name] def callback(sxa): badge = get_badge(sxa['name']) if badge is None: return user_id = uidmap[sxa['userid']] if not user_badge_count.get(user_id, None): user_badge_count[user_id] = 0 action = orm.Action( action_type = "award", user_id = user_id, action_date = readTime(sxa['date']) ) action.save() osqaa = orm.Award( user_id = uidmap[sxa['userid']], badge = badge, node_id = post_list[user_badge_count[user_id]], awarded_at = action.action_date, action = action ) osqaa.save() badge.awarded_count += 1 user_badge_count[user_id] += 1 readTable(dump, "badges", callback) def save_setting(k, v): try: kv = orm.KeyValue.objects.get(key=k) kv.value = v except: kv = orm.KeyValue(key = k, value = v) kv.save() def pages_import(dump, currid): currid = IdIncrementer(currid) registry = {} def callback(sxp): currid.inc() page = orm.Node( id = currid.value, node_type = "page", title = sxp['name'], body = b64decode(sxp['value']), extra = dbsafe_encode({ 'path': sxp['url'][1:], 'mimetype': sxp['contenttype'], 'template': (sxp['usemaster'] == "true") and "default" or "none", 'render': "html", 'sidebar': "", 'sidebar_wrap': True, 'sidebar_render': "html", 'comments': False }), author_id = 1 ) create_and_activate_revision(page) page.save() registry[sxp['url'][1:]] = page.id create_action = orm.Action( action_type = "newpage", user_id = page.author_id, node = page ) create_action.save() if sxp['active'] == "true" and sxp['contenttype'] == "text/html": pub_action = orm.Action( action_type = "publish", user_id = page.author_id, node = page ) pub_action.save() add_post_state("published", page, pub_action) readTable(dump, "FlatPages", callback) save_setting('STATIC_PAGE_REGISTRY', dbsafe_encode(registry)) sx2osqa_set_map = { u'theme.html.name': 'APP_TITLE', u'theme.html.footer': 'CUSTOM_FOOTER', u'theme.html.sidebar': 'SIDEBAR_UPPER_TEXT', u'theme.html.sidebar-low': 'SIDEBAR_LOWER_TEXT', u'theme.html.welcome': 'APP_INTRO', u'theme.html.head': 'CUSTOM_HEAD', u'theme.html.header': 'CUSTOM_HEADER', u'theme.css': 'CUSTOM_CSS', } html_codes = ( ('&amp;', '&'), ('&lt;', '<'), ('&gt;', '>'), ('&quot;', '"'), ('&#39;', "'"), ) def html_decode(html): html = force_unicode(html) for args in html_codes: html = html.replace(*args) return html def static_import(dump): sx_unknown = {} def callback(set): if unicode(set['name']) in sx2osqa_set_map: save_setting(sx2osqa_set_map[set['name']], dbsafe_encode(html_decode(set['value']))) else: sx_unknown[set['name']] = html_decode(set['value']) readTable(dump, "ThemeTextResources", callback) save_setting('SXIMPORT_UNKNOWN_SETS', dbsafe_encode(sx_unknown)) def disable_triggers(): from south.db import db if db.backend_name == "postgres": db.execute_many(PG_DISABLE_TRIGGERS) db.commit_transaction() db.start_transaction() def enable_triggers(): from south.db import db if db.backend_name == "postgres": db.start_transaction() db.execute_many(PG_ENABLE_TRIGGERS) db.commit_transaction() def reset_sequences(): from south.db import db if db.backend_name == "postgres": db.start_transaction() db.execute_many(PG_SEQUENCE_RESETS) db.commit_transaction() def reindex_fts(): from south.db import db if db.backend_name == "postgres": db.start_transaction() db.execute_many("UPDATE forum_noderevision set id = id WHERE TRUE;") db.commit_transaction() def sximport(dump, options): try: disable_triggers() triggers_disabled = True except: triggers_disabled = False imported = [] try: uidmap = userimport(dump, options) imported.append("Users") except IOError: return imported try: tagmap = {} posts = postimport(dump, uidmap, tagmap) gc.collect() imported.append("Posts") posts, comments = comment_import(dump, uidmap, posts) gc.collect() imported.append("Comments") post_vote_import(dump, uidmap, posts) gc.collect() #comment_vote_import(dump, uidmap, comments) #gc.collect() imported.append("Votes") badges_import(dump, uidmap, posts) imported.append("Badges") #pages_import(dump, max(posts)) #imported.append("FlatPages") #static_import(dump) #imported.append("ThemeTextResources") gc.collect() except IOError: pass from south.db import db db.commit_transaction() reset_sequences() if triggers_disabled: enable_triggers() reindex_fts() return imported PG_DISABLE_TRIGGERS = """ ALTER table auth_user DISABLE TRIGGER ALL; ALTER table auth_user_groups DISABLE TRIGGER ALL; ALTER table auth_user_user_permissions DISABLE TRIGGER ALL; ALTER table forum_keyvalue DISABLE TRIGGER ALL; ALTER table forum_action DISABLE TRIGGER ALL; ALTER table forum_actionrepute DISABLE TRIGGER ALL; ALTER table forum_subscriptionsettings DISABLE TRIGGER ALL; ALTER table forum_validationhash DISABLE TRIGGER ALL; ALTER table forum_authkeyuserassociation DISABLE TRIGGER ALL; ALTER table forum_tag DISABLE TRIGGER ALL; ALTER table forum_markedtag DISABLE TRIGGER ALL; ALTER table forum_node DISABLE TRIGGER ALL; ALTER table forum_nodestate DISABLE TRIGGER ALL; ALTER table forum_node_tags DISABLE TRIGGER ALL; ALTER table forum_noderevision DISABLE TRIGGER ALL; ALTER table forum_node_tags DISABLE TRIGGER ALL; ALTER table forum_questionsubscription DISABLE TRIGGER ALL; ALTER table forum_vote DISABLE TRIGGER ALL; ALTER table forum_flag DISABLE TRIGGER ALL; ALTER table forum_badge DISABLE TRIGGER ALL; ALTER table forum_award DISABLE TRIGGER ALL; ALTER table forum_openidnonce DISABLE TRIGGER ALL; ALTER table forum_openidassociation DISABLE TRIGGER ALL; """ PG_ENABLE_TRIGGERS = """ ALTER table auth_user ENABLE TRIGGER ALL; ALTER table auth_user_groups ENABLE TRIGGER ALL; ALTER table auth_user_user_permissions ENABLE TRIGGER ALL; ALTER table forum_keyvalue ENABLE TRIGGER ALL; ALTER table forum_action ENABLE TRIGGER ALL; ALTER table forum_actionrepute ENABLE TRIGGER ALL; ALTER table forum_subscriptionsettings ENABLE TRIGGER ALL; ALTER table forum_validationhash ENABLE TRIGGER ALL; ALTER table forum_authkeyuserassociation ENABLE TRIGGER ALL; ALTER table forum_tag ENABLE TRIGGER ALL; ALTER table forum_markedtag ENABLE TRIGGER ALL; ALTER table forum_node ENABLE TRIGGER ALL; ALTER table forum_nodestate ENABLE TRIGGER ALL; ALTER table forum_node_tags ENABLE TRIGGER ALL; ALTER table forum_noderevision ENABLE TRIGGER ALL; ALTER table forum_node_tags ENABLE TRIGGER ALL; ALTER table forum_questionsubscription ENABLE TRIGGER ALL; ALTER table forum_vote ENABLE TRIGGER ALL; ALTER table forum_flag ENABLE TRIGGER ALL; ALTER table forum_badge ENABLE TRIGGER ALL; ALTER table forum_award ENABLE TRIGGER ALL; ALTER table forum_openidnonce ENABLE TRIGGER ALL; ALTER table forum_openidassociation ENABLE TRIGGER ALL; """ PG_SEQUENCE_RESETS = """ SELECT setval('"auth_user_id_seq"', coalesce(max("id"), 1) + 2, max("id") IS NOT null) FROM "auth_user"; SELECT setval('"auth_user_groups_id_seq"', coalesce(max("id"), 1) + 2, max("id") IS NOT null) FROM "auth_user_groups"; SELECT setval('"auth_user_user_permissions_id_seq"', coalesce(max("id"), 1) + 2, max("id") IS NOT null) FROM "auth_user_user_permissions"; SELECT setval('"forum_keyvalue_id_seq"', coalesce(max("id"), 1) + 2, max("id") IS NOT null) FROM "forum_keyvalue"; SELECT setval('"forum_action_id_seq"', coalesce(max("id"), 1) + 2, max("id") IS NOT null) FROM "forum_action"; SELECT setval('"forum_actionrepute_id_seq"', coalesce(max("id"), 1) + 2, max("id") IS NOT null) FROM "forum_actionrepute"; SELECT setval('"forum_subscriptionsettings_id_seq"', coalesce(max("id"), 1) + 2, max("id") IS NOT null) FROM "forum_subscriptionsettings"; SELECT setval('"forum_validationhash_id_seq"', coalesce(max("id"), 1) + 2, max("id") IS NOT null) FROM "forum_validationhash"; SELECT setval('"forum_authkeyuserassociation_id_seq"', coalesce(max("id"), 1) + 2, max("id") IS NOT null) FROM "forum_authkeyuserassociation"; SELECT setval('"forum_tag_id_seq"', coalesce(max("id"), 1) + 2, max("id") IS NOT null) FROM "forum_tag"; SELECT setval('"forum_markedtag_id_seq"', coalesce(max("id"), 1) + 2, max("id") IS NOT null) FROM "forum_markedtag"; SELECT setval('"forum_node_id_seq"', coalesce(max("id"), 1) + 2, max("id") IS NOT null) FROM "forum_node"; SELECT setval('"forum_nodestate_id_seq"', coalesce(max("id"), 1) + 2, max("id") IS NOT null) FROM "forum_nodestate"; SELECT setval('"forum_node_tags_id_seq"', coalesce(max("id"), 1) + 2, max("id") IS NOT null) FROM "forum_node_tags"; SELECT setval('"forum_noderevision_id_seq"', coalesce(max("id"), 1) + 2, max("id") IS NOT null) FROM "forum_noderevision"; SELECT setval('"forum_node_tags_id_seq"', coalesce(max("id"), 1) + 2, max("id") IS NOT null) FROM "forum_node_tags"; SELECT setval('"forum_questionsubscription_id_seq"', coalesce(max("id"), 1) + 2, max("id") IS NOT null) FROM "forum_questionsubscription"; SELECT setval('"forum_vote_id_seq"', coalesce(max("id"), 1) + 2, max("id") IS NOT null) FROM "forum_vote"; SELECT setval('"forum_flag_id_seq"', coalesce(max("id"), 1) + 2, max("id") IS NOT null) FROM "forum_flag"; SELECT setval('"forum_badge_id_seq"', coalesce(max("id"), 1) + 2, max("id") IS NOT null) FROM "forum_badge"; SELECT setval('"forum_award_id_seq"', coalesce(max("id"), 1) + 2, max("id") IS NOT null) FROM "forum_award"; SELECT setval('"forum_openidnonce_id_seq"', coalesce(max("id"), 1) + 2, max("id") IS NOT null) FROM "forum_openidnonce"; SELECT setval('"forum_openidassociation_id_seq"', coalesce(max("id"), 1) + 2, max("id") IS NOT null) FROM "forum_openidassociation"; """
gpl-3.0
Rafiot/GostCrypt-Linux
Volume/VolumePasswordCache.cpp
1153
/* Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved. Governed by the TrueCrypt License 3.0 the full text of which is contained in the file License.txt included in TrueCrypt binary and source code distribution packages. */ #include "VolumePasswordCache.h" namespace GostCrypt { CachedPasswordList VolumePasswordCache::GetPasswords () { CachedPasswordList passwords; foreach_ref (const VolumePassword &password, CachedPasswords) passwords.push_back (make_shared <VolumePassword> (VolumePassword (password))); return passwords; } void VolumePasswordCache::Store (const VolumePassword &newPassword) { CachedPasswordList::iterator iter = CachedPasswords.begin(); foreach_ref (const VolumePassword &password, CachedPasswords) { if (newPassword == password) { CachedPasswords.erase (iter); break; } iter++; } CachedPasswords.push_front (make_shared <VolumePassword> (VolumePassword (newPassword))); if (CachedPasswords.size() > Capacity) CachedPasswords.pop_back(); } CachedPasswordList VolumePasswordCache::CachedPasswords; }
gpl-3.0
bionimbuz/Bionimbuz
src/main/java/br/unb/cic/bionimbuz/rest/request/GetConfigurationsRequest.java
557
package br.unb.cic.bionimbuz.rest.request; import com.fasterxml.jackson.annotation.JsonProperty; /** * * @author Vinicius */ public class GetConfigurationsRequest implements RequestInfo { @JsonProperty(value = "request") private boolean request; public GetConfigurationsRequest() { } public GetConfigurationsRequest(boolean request) { this.request = request; } public boolean isRequest() { return request; } public void setRequest(boolean request) { this.request = request; } }
gpl-3.0
aeyde/reaction
imports/plugins/core/accounts/client/containers/loginInline.js
3012
import React, { Component } from "react"; import PropTypes from "prop-types"; import { Meteor } from "meteor/meteor"; import { Reaction, i18next } from "/client/api"; import { registerComponent, composeWithTracker } from "@reactioncommerce/reaction-components"; import LoginInline from "../components/loginInline"; import { Cart } from "/lib/collections"; class LoginInlineContainer extends Component { static propTypes = { isStripeEnabled: PropTypes.bool } constructor(props) { super(props); this.state = { isStripeEnabled: props.isStripeEnabled, renderEmailForm: false }; } componentWillReceiveProps(nextProps) { this.setState({ isStripeEnabled: nextProps.isStripeEnabled }); } pushCartWorkflow = () => { Meteor.call("workflow/pushCartWorkflow", "coreCartWorkflow", "checkoutLogin", (error) => { if (error) { // Do not bother to try to advance workflow if we can't go beyond login. return; } const cart = Cart.findOne({ userId: Meteor.userId() }); // If there's already a billing and shipping address selected, push beyond address book if (cart && cart.billing[0] && cart.billing[0].address && cart.shipping[0] && cart.shipping[0].address) { Meteor.call("workflow/pushCartWorkflow", "coreCartWorkflow", "checkoutAddressBook"); } }); } continueAsGuest = (event) => { event.preventDefault(); if (this.state.isStripeEnabled) { this.setState({ renderEmailForm: true }); } else { this.pushCartWorkflow(); } } /** * @method handleEmailSubmit * @summary Handle submitting the email form * @param {Event} event - the event that fired * @param {String} email - anonymous user's email * @return {undefined} undefined */ handleEmailSubmit = (event, email) => { event.preventDefault(); const userId = Meteor.userId(); Meteor.call("cart/setAnonymousUserEmail", userId, email, (error) => { if (error) { Alerts.toast(i18next.t("mail.alerts.addCartEmailFailed"), "error"); } else { this.pushCartWorkflow(); } }); } render() { return ( <LoginInline continueAsGuest={this.continueAsGuest} renderEmailForm={this.state.renderEmailForm} handleEmailSubmit={this.handleEmailSubmit} /> ); } } function composer(props, onData) { let isStripeEnabled = false; const subscription = Reaction.Subscriptions.Packages; const primaryShopId = Reaction.getPrimaryShopId(); const stripePkg = Reaction.getPackageSettingsWithOptions({ shopId: primaryShopId, name: "reaction-stripe", enabled: true }); if (subscription.ready()) { if (stripePkg) { isStripeEnabled = true; } onData(null, { isStripeEnabled }); } } registerComponent("LoginInline", LoginInlineContainer, composeWithTracker(composer)); export default composeWithTracker(composer)(LoginInlineContainer);
gpl-3.0
kleinfeld/medpy
bin/medpy_join_xd_to_xplus1d.py
6092
#!/usr/bin/python """ Joins a number of XD volumes into a (X+1)D volume. Copyright (C) 2013 Oskar Maier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ # build-in modules import argparse from argparse import RawTextHelpFormatter import logging # third-party modules import scipy # path changes # own modules from medpy.io import load, save, header from medpy.core import Logger from medpy.core.exceptions import ArgumentError from medpy.io.header import __update_header_from_array_nibabel,\ __is_header_nibabel # information __author__ = "Oskar Maier" __version__ = "r0.1.2, 2012-05-25" __email__ = "oskar.maier@googlemail.com" __status__ = "Release" __description__ = """ Joins a number of XD volumes into a (X+1)D volume. One common use is when a number of 3D volumes, each representing a moment in time, are availabel. With this script they can be joined into a proper 4D volume. WARNING: Setting the spacing of the new dimension to any other value than 1 only works when the first input image is of type NIfTI. In case of images loaded by the ITK wrapper (e.g. *.mha), this even leads to a segmentation fault! Copyright (C) 2013 Oskar Maier This program comes with ABSOLUTELY NO WARRANTY; This is free software, and you are welcome to redistribute it under certain conditions; see the LICENSE file or <http://www.gnu.org/licenses/> for details. """ # code def main(): # parse cmd arguments parser = getParser() parser.parse_args() args = getArguments(parser) # prepare logger logger = Logger.getInstance() if args.debug: logger.setLevel(logging.DEBUG) elif args.verbose: logger.setLevel(logging.INFO) # load first input image as example example_data, example_header = load(args.inputs[0]) # test if the supplied position is valid if args.position > example_data.ndim or args.position < 0: raise ArgumentError('The supplied position for the new dimension is invalid. It has to be between 0 and {}.'.format(example_data.ndim)) # prepare empty output volume output_data = scipy.zeros([len(args.inputs)] + list(example_data.shape), dtype=example_data.dtype) # add first image to output volume output_data[0] = example_data # load input images and add to output volume for idx, image in enumerate(args.inputs[1:]): image_data, _ = load(image) if not args.ignore and image_data.dtype != example_data.dtype: raise ArgumentError('The dtype {} of image {} differs from the one of the first image {}, which is {}.'.format(image_data.dtype, image, args.inputs[0], example_data.dtype)) if image_data.shape != example_data.shape: raise ArgumentError('The shape {} of image {} differs from the one of the first image {}, which is {}.'.format(image_data.shape, image, args.inputs[0], example_data.shape)) output_data[idx + 1] = image_data # move new dimension to the end or to target position for dim in range(output_data.ndim - 1): if dim >= args.position: break output_data = scipy.swapaxes(output_data, dim, dim + 1) # set pixel spacing if not 1 == args.spacing: spacing = list(header.get_pixel_spacing(example_header)) spacing = tuple(spacing[:args.position] + [args.spacing] + spacing[args.position:]) # !TODO: Find a way to enable this also for PyDicom and ITK images if __is_header_nibabel(example_header): __update_header_from_array_nibabel(example_header, output_data) header.set_pixel_spacing(example_header, spacing) else: raise ArgumentError("Sorry. Setting the voxel spacing of the new dimension only works with NIfTI images. See the description of this program for more details.") # save created volume save(output_data, args.output, example_header, args.force) logger.info("Successfully terminated.") def getArguments(parser): "Provides additional validation of the arguments collected by argparse." return parser.parse_args() def getParser(): "Creates and returns the argparse parser object." parser = argparse.ArgumentParser(description=__description__, formatter_class=RawTextHelpFormatter) parser.add_argument('output', help='Target volume.') parser.add_argument('inputs', nargs='+', help='Source volumes of same shape and dtype.') parser.add_argument('-s', dest='spacing', type=float, default=1, help='The voxel spacing of the newly created dimension. Default is 1.') parser.add_argument('-p', dest='position', type=int, default=0, help='The position where to put the new dimension starting from 0. Standard behaviour is to place it in the first position.') parser.add_argument('-i', dest='ignore', action='store_true', help='Ignore if the images datatypes differ.') parser.add_argument('-v', dest='verbose', action='store_true', help='Display more information.') parser.add_argument('-d', dest='debug', action='store_true', help='Display debug information.') parser.add_argument('-f', dest='force', action='store_true', help='Silently override existing output images.') return parser if __name__ == "__main__": main()
gpl-3.0
brandonrobertz/Austin-Traffic-Scraper
config.inc.php
317
<? # ADD SQL INFORMATION HERE $serv = ""; $user = ""; $pass = ""; $db = ""; # Your host, this will be set as the referrer on the request $refhost = ""; # Your Google Maps API key goes here define("KEY", ""); # google maps host ... you shouldn't have to mess with this define("MAPS_HOST", "maps.google.com"); ?>
gpl-3.0
themiwi/freefoam-debian
src/OSspecific/POSIX/signals/sigQuitImpl.H
2534
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class Foam::sigQuitImpl Description Signal handler for QUIT interupt. The standard interupt handler is overridden to ensure that the runningJob file is removed. This is the platform specific opaque implementation for class sigQuit. See Also Foam::JobInfo SourceFiles sigQuitImpl.C \*---------------------------------------------------------------------------*/ #ifndef sigQuitImpl_H #define sigQuitImpl_H #include <OpenFOAM/OSspecific.H> #include <signal.h> // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { /*---------------------------------------------------------------------------*\ Class sigQuitImpl Declaration \*---------------------------------------------------------------------------*/ class sigQuitImpl { // Private data //- Saved old signal trapping setting static struct sigaction oldAction_; // Private Member Functions static void sigQuitHandler(int); public: // Constructors sigQuitImpl(); // Destructor ~sigQuitImpl(); // Member functions void set(const bool verbose); }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif // ************************ vim: set sw=4 sts=4 et: ************************ //
gpl-3.0
PlamenHP/Softuni
C# Web Basics/Asynchronous Programming - Lab/Even Numbers Thread/Program.cs
1069
using System; using System.Linq; using System.Threading; namespace Even_Numbers_Thread { public class Program { public static void Main() { int[] nums = Console.ReadLine() .Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries) .Select(int.Parse) .ToArray(); int start = nums[0]; int end = nums[1]; Thread evens = new Thread(() => { PrintEvenNumbers(start, end); }); evens.Start(); evens.Join(); Console.WriteLine("Thread finished work"); } public static void PrintEvenNumbers(int start, int end) { if (start>end) { return; } for (int i = start; i <= end; i++) { if (i%2==0) { Console.WriteLine(i); } } } } }
gpl-3.0
wbhicks/predict-folders
src/main/java/idc/IDC.java
1973
package idc; import java.io.Serializable; import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.lang3.builder.ReflectionToStringBuilder; /** * identifiable data container */ public /*abstract*/ class IDC implements Serializable /*, Cloneable*/ { private static final long serialVersionUID = 42L; /** * Has this IDC changed outside the DB? (On the client side, Hibernate does not apply.) */ public enum DirtyFlag { // implicitly static /** * Default, unchanged */ CLEAN, /** * New (user-supplied) data */ NEW, /** * Existing data but modified */ MODIFIED, /** * Existing data but marked for deletion */ DELETED } public DirtyFlag dirtyFlag = DirtyFlag.CLEAN; public static final long INVALID_UUID = -1; // TODO rename "blank"? private long uuid = INVALID_UUID; /** * instead of actually deleting records from the DB. * * If it's both non-public and inherited, we'd need to improve our * reflection code to reach it. */ public boolean active = true; public IDC() { } public IDC(IDC orig) { if (null != orig) { try { BeanUtils.copyProperties(this, orig); } catch (Exception e) { } } } public boolean hasValidUuid() { return INVALID_UUID != getUuid(); } public void invalidateUuid() { setUuid(INVALID_UUID); } public String toString() { return ReflectionToStringBuilder.toString(this); } public long getUuid() { return uuid; } public void setUuid(long uuid) { this.uuid = uuid; } public boolean getActive() { return active; } public void setActive(boolean active) { this.active = active; } public String getLabel() { return "label:" + uuid; } }
gpl-3.0
jimcunderwood/MissionPlanner
Log/LogDownloadMavLink.cs
13574
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Reflection; using System.Text; using System.Windows.Forms; using System.IO.Ports; using System.IO; using System.Text.RegularExpressions; using KMLib; using KMLib.Feature; using KMLib.Geometry; using Core.Geometry; using ICSharpCode.SharpZipLib.Zip; using ICSharpCode.SharpZipLib.Checksums; using ICSharpCode.SharpZipLib.Core; using log4net; using MissionPlanner.Comms; using MissionPlanner.Utilities; namespace MissionPlanner.Log { public partial class LogDownloadMavLink : Form { private static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); serialstatus status = serialstatus.Connecting; int currentlog = 0; string logfile = ""; int receivedbytes = 0; //List<Model> orientation = new List<Model>(); Object thisLock = new Object(); DateTime start = DateTime.Now; enum serialstatus { Connecting, Createfile, Closefile, Reading, Waiting, Done } public LogDownloadMavLink() { InitializeComponent(); ThemeManager.ApplyThemeTo(this); MissionPlanner.Utilities.Tracking.AddPage(this.GetType().ToString(), this.Text); } private void Log_Load(object sender, EventArgs e) { if (!MainV2.comPort.BaseStream.IsOpen) { this.Close(); CustomMessageBox.Show("Please Connect"); return; } try { var list = MainV2.comPort.GetLogList(); foreach (var item in list) { genchkcombo(item.id); TXT_seriallog.AppendText(item.id + " " + new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddSeconds(item.time_utc).ToLocalTime() + " est size: " + item.size +"\n"); } } catch { CustomMessageBox.Show("Cannot get log list.","Error"); this.Close(); } status = serialstatus.Done; } void genchkcombo(int logcount) { MethodInvoker m = delegate() { //CHK_logs.Items.Clear(); //for (int a = 1; a <= logcount; a++) if (!CHK_logs.Items.Contains(logcount)) { CHK_logs.Items.Add(logcount); } }; try { BeginInvoke(m); } catch { } } void updateDisplay() { if (this.IsDisposed) return; if (start.Second != DateTime.Now.Second) { this.BeginInvoke((System.Windows.Forms.MethodInvoker)delegate() { try { TXT_status.Text = status.ToString() + " " + receivedbytes; } catch { } }); start = DateTime.Now; } } private void BUT_DLall_Click(object sender, EventArgs e) { if (status == serialstatus.Done) { if (CHK_logs.Items.Count == 0) { CustomMessageBox.Show("Nothing to download"); return; } System.Threading.Thread t11 = new System.Threading.Thread(delegate() { downloadthread(int.Parse(CHK_logs.Items[0].ToString()), int.Parse(CHK_logs.Items[CHK_logs.Items.Count - 1].ToString())); }); t11.Name = "Log Download All thread"; t11.Start(); } } string GetLog(ushort no) { MainV2.comPort.Progress += comPort_Progress; status = serialstatus.Reading; // get df log from mav var ms = MainV2.comPort.GetLog(no); status = serialstatus.Done; updateDisplay(); MainV2.comPort.Progress -= comPort_Progress; // set log fn byte[] hbpacket = MainV2.comPort.getHeartBeat(); MAVLink.mavlink_heartbeat_t hb = (MAVLink.mavlink_heartbeat_t)MainV2.comPort.DebugPacket(hbpacket); logfile = MainV2.LogDir + Path.DirectorySeparatorChar + MainV2.comPort.MAV.aptype.ToString() + Path.DirectorySeparatorChar + hbpacket[3] + Path.DirectorySeparatorChar + DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss") + " " + no + ".bin"; // make log dir Directory.CreateDirectory(Path.GetDirectoryName(logfile)); // save memorystream to file using (BinaryWriter bw = new BinaryWriter(File.OpenWrite(logfile))) { bw.Write(ms.ToArray()); } // read binary log to assci log var temp1 = Log.BinaryLog.ReadLog(logfile); // delete binary log file //File.Delete(logfile); logfile = logfile + ".log"; // write assci log using (StreamWriter sw = new StreamWriter(logfile)) { foreach (string line in temp1) { sw.Write(line); } sw.Close(); } // get gps time of assci log DateTime logtime = DFLog.GetFirstGpsTime(logfile); // rename log is we have a valid gps time if (logtime != DateTime.MinValue) { string newlogfilename = MainV2.LogDir + Path.DirectorySeparatorChar + MainV2.comPort.MAV.aptype.ToString() + Path.DirectorySeparatorChar + hbpacket[3] + Path.DirectorySeparatorChar + logtime.ToString("yyyy-MM-dd HH-mm-ss") + ".log"; try { File.Move(logfile, newlogfilename); // rename bin as well File.Move(logfile.Replace(".log", ""), newlogfilename.Replace(".log", ".bin")); logfile = newlogfilename; } catch { CustomMessageBox.Show("Failed to rename file " + logfile + "\nto " + newlogfilename, "Error"); } } return logfile; } void comPort_Progress(int progress, string status) { receivedbytes = progress; updateDisplay(); } void CreateLog(string logfile) { TextReader tr = new StreamReader(logfile); // this.Invoke((System.Windows.Forms.MethodInvoker)delegate() { TXT_seriallog.AppendText("Creating KML for " + logfile + "\n"); }); LogOutput lo = new LogOutput(); while (tr.Peek() != -1) { lo.processLine(tr.ReadLine()); } tr.Close(); try { lo.writeKML(logfile + ".kml"); } catch { } // usualy invalid lat long error status = serialstatus.Done; updateDisplay(); } private void downloadthread(int startlognum, int endlognum) { try { for (int a = startlognum; a <= endlognum; a++) { currentlog = a; var logname = GetLog((ushort)a); CreateLog(logname); } status = serialstatus.Done; updateDisplay(); Console.Beep(); } catch (Exception ex) { CustomMessageBox.Show(ex.Message, "Error in log " + currentlog); } } private void downloadsinglethread() { try { for (int i = 0; i < CHK_logs.CheckedItems.Count; ++i) { int a = (int)CHK_logs.CheckedItems[i]; { currentlog = a; var logname = GetLog((ushort)a); CreateLog(logname); } } status = serialstatus.Done; updateDisplay(); Console.Beep(); } catch (Exception ex) { CustomMessageBox.Show(ex.Message, "Error in log " + currentlog); } } private void BUT_DLthese_Click(object sender, EventArgs e) { if (status == serialstatus.Done) { System.Threading.Thread t11 = new System.Threading.Thread(delegate() { downloadsinglethread(); }); t11.Name = "Log download single thread"; t11.Start(); } } private void BUT_clearlogs_Click(object sender, EventArgs e) { try { MainV2.comPort.EraseLog(); TXT_seriallog.AppendText("!!Allow 30-90 seconds for erase\n"); status = serialstatus.Done; updateDisplay(); CHK_logs.Items.Clear(); } catch (Exception ex) { CustomMessageBox.Show(ex.Message, "Error"); } } private void BUT_redokml_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.Filter = "*.log|*.log"; openFileDialog1.FilterIndex = 2; openFileDialog1.RestoreDirectory = true; openFileDialog1.Multiselect = true; try { openFileDialog1.InitialDirectory = MainV2.LogDir + Path.DirectorySeparatorChar; } catch { } // incase dir doesnt exist if (openFileDialog1.ShowDialog() == DialogResult.OK) { foreach (string logfile in openFileDialog1.FileNames) { TXT_seriallog.AppendText("\n\nProcessing " + logfile + "\n"); this.Refresh(); LogOutput lo = new LogOutput(); try { TextReader tr = new StreamReader(logfile); while (tr.Peek() != -1) { lo.processLine(tr.ReadLine()); } tr.Close(); } catch (Exception ex) { CustomMessageBox.Show("Error processing file. Make sure the file is not in use.\n" + ex.ToString()); } lo.writeKML(logfile + ".kml"); TXT_seriallog.AppendText("Done\n"); } } } private void BUT_firstperson_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.Filter = "*.log|*.log"; openFileDialog1.FilterIndex = 2; openFileDialog1.RestoreDirectory = true; openFileDialog1.Multiselect = true; try { openFileDialog1.InitialDirectory = MainV2.LogDir + Path.DirectorySeparatorChar; } catch { } // incase dir doesnt exist if (openFileDialog1.ShowDialog() == DialogResult.OK) { foreach (string logfile in openFileDialog1.FileNames) { TXT_seriallog.AppendText("\n\nProcessing " + logfile + "\n"); this.Refresh(); LogOutput lo = new LogOutput(); try { TextReader tr = new StreamReader(logfile); while (tr.Peek() != -1) { lo.processLine(tr.ReadLine()); } tr.Close(); } catch (Exception ex) { CustomMessageBox.Show("Error processing log. Is it still downloading? " + ex.Message); continue; } lo.writeKMLFirstPerson(logfile + "-fp.kml"); TXT_seriallog.AppendText("Done\n"); } } } private void BUT_bintolog_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "Binary Log|*.bin"; ofd.ShowDialog(); if (File.Exists(ofd.FileName)) { var log = BinaryLog.ReadLog(ofd.FileName); SaveFileDialog sfd = new SaveFileDialog(); sfd.Filter = "log|*.log"; DialogResult res = sfd.ShowDialog(); if (res == System.Windows.Forms.DialogResult.OK) { StreamWriter sw = new StreamWriter(sfd.OpenFile()); foreach (string line in log) { sw.Write(line); } sw.Close(); } } } } }
gpl-3.0
gamebytes/pioneer
src/Ship-AI.cpp
15064
#include "libs.h" #include "Ship.h" #include "ShipAICmd.h" #include "Pi.h" #include "Player.h" #include "perlin.h" #include "Frame.h" #include "Planet.h" #include "SpaceStation.h" #include "Space.h" #include "LuaConstants.h" #include "KeyBindings.h" void Ship::AIModelCoordsMatchAngVel(vector3d desiredAngVel, double softness) { const ShipType &stype = GetShipType(); double angAccel = stype.angThrust / GetAngularInertia(); const double softTimeStep = Pi::game->GetTimeStep() * softness; matrix4x4d rot; GetRotMatrix(rot); vector3d angVel = desiredAngVel - rot.InverseOf() * GetAngVelocity(); vector3d thrust; for (int axis=0; axis<3; axis++) { if (angAccel * softTimeStep >= fabs(angVel[axis])) { thrust[axis] = angVel[axis] / (softTimeStep * angAccel); } else { thrust[axis] = (angVel[axis] > 0.0 ? 1.0 : -1.0); } } SetAngThrusterState(thrust); } void Ship::AIModelCoordsMatchSpeedRelTo(const vector3d v, const Ship *other) { matrix4x4d m; GetRotMatrix(m); vector3d relToVel = m.InverseOf() * other->GetVelocity() + v; AIAccelToModelRelativeVelocity(relToVel); } // Try to reach this model-relative velocity. // (0,0,-100) would mean going 100m/s forward. void Ship::AIAccelToModelRelativeVelocity(const vector3d v) { // OK. For rotating frames linked to space stations we want to set // speed relative to non-rotating frame (so we apply Frame::GetStasisVelocityAtPosition. // For rotating frames linked to planets we want to set velocity relative to // surface, so we do not apply Frame::GetStasisVelocityAtPosition vector3d relVel = GetVelocity(); if (GetFrame()->IsStationRotFrame()) { relVel -= GetFrame()->GetStasisVelocityAtPosition(GetPosition()); } matrix4x4d m; GetRotMatrix(m); vector3d difVel = v - (relVel * m); // required change in velocity vector3d maxThrust = GetMaxThrust(difVel); vector3d maxFrameAccel = maxThrust * Pi::game->GetTimeStep() / GetMass(); SetThrusterState(0, difVel.x / maxFrameAccel.x); SetThrusterState(1, difVel.y / maxFrameAccel.y); SetThrusterState(2, difVel.z / maxFrameAccel.z); // use clamping } // returns true if command is complete bool Ship::AITimeStep(float timeStep) { // allow the launch thruster thing to happen if (m_launchLockTimeout > 0.0) return false; if (!m_curAICmd) { if (this == Pi::player) return true; // just in case the AI left it on ClearThrusterState(); for (int i=0; i<ShipType::GUNMOUNT_MAX; i++) SetGunState(i,0); return true; } if (m_curAICmd->TimeStepUpdate()) { AIClearInstructions(); // ClearThrusterState(); // otherwise it does one timestep at 10k and gravity is fatal Pi::luaOnAICompleted->Queue(this, LuaConstants::GetConstantString(Pi::luaManager->GetLuaState(), "ShipAIError", AIMessage())); return true; } else return false; } void Ship::AIClearInstructions() { if (!m_curAICmd) return; delete m_curAICmd; // rely on destructor to kill children m_curAICmd = 0; } void Ship::AIGetStatusText(char *str) { if (!m_curAICmd) strcpy(str, "AI inactive"); else m_curAICmd->GetStatusText(str); } Frame *Ship::AIGetRiskFrame() { if (!m_curAICmd) return 0; else return m_curAICmd->GetRiskFrame(); } void Ship::AIKamikaze(Body *target) { AIClearInstructions(); m_curAICmd = new AICmdKamikaze(this, target); } void Ship::AIKill(Ship *target) { AIClearInstructions(); m_curAICmd = new AICmdKill(this, target); } /* void Ship::AIJourney(SystemBodyPath &dest) { AIClearInstructions(); // m_curAICmd = new AICmdJourney(this, dest); } */ void Ship::AIFlyTo(Body *target) { AIClearInstructions(); m_curAICmd = new AICmdFlyTo(this, target); } void Ship::AIDock(SpaceStation *target) { AIClearInstructions(); m_curAICmd = new AICmdDock(this, target); } void Ship::AIOrbit(Body *target, double alt) { AIClearInstructions(); m_curAICmd = new AICmdFlyAround(this, target, alt); } void Ship::AIHoldPosition() { AIClearInstructions(); m_curAICmd = new AICmdHoldPosition(this); } // Because of issues when reducing timestep, must do parts of this as if 1x accel // final frame has too high velocity to correct if timestep is reduced // fix is too slow in the terminal stages: // if (endvel <= vel) { endvel = vel; ivel = dist / Pi::game->GetTimeStep(); } // last frame discrete correction // ivel = std::min(ivel, endvel + 0.5*acc/PHYSICS_HZ); // unknown next timestep discrete overshoot correction // yeah ok, this doesn't work // sometimes endvel is too low to catch moving objects // worked around with half-accel hack in dynamicbody & pi.cpp double calc_ivel(double dist, double vel, double acc) { bool inv = false; if (dist < 0) { dist = -dist; vel = -vel; inv = true; } double ivel = 0.9 * sqrt(vel*vel + 2.0 * acc * dist); // fudge hardly necessary double endvel = ivel - (acc * Pi::game->GetTimeStep()); if (endvel <= 0.0) ivel = dist / Pi::game->GetTimeStep(); // last frame discrete correction else ivel = (ivel + endvel) * 0.5; // discrete overshoot correction // else ivel = endvel + 0.5*acc/PHYSICS_HZ; // unknown next timestep discrete overshoot correction return (inv) ? -ivel : ivel; } // vel is desired velocity in ship's frame // returns true if this can be attained in a single timestep // todo: check space station rotating frame case bool Ship::AIMatchVel(const vector3d &vel) { matrix4x4d rot; GetRotMatrix(rot); vector3d diffvel = (vel - GetVelocityRelTo(GetFrame())) * rot; // convert to object space return AIChangeVelBy(diffvel); } // diffvel is required change in velocity in object space // returns true if this can be done in a single timestep bool Ship::AIChangeVelBy(const vector3d &diffvel) { // counter external forces unless we're in an orbital station rotating frame matrix4x4d rot; GetRotMatrix(rot); vector3d diffvel2 = GetExternalForce() * Pi::game->GetTimeStep() / GetMass(); if (GetFrame()->IsStationRotFrame()) diffvel2 = diffvel; else diffvel2 = diffvel - diffvel2 * rot; vector3d maxThrust = GetMaxThrust(diffvel2); vector3d maxFrameAccel = maxThrust * Pi::game->GetTimeStep() / GetMass(); vector3d thrust(diffvel2.x / maxFrameAccel.x, diffvel2.y / maxFrameAccel.y, diffvel2.z / maxFrameAccel.z); SetThrusterState(thrust); // use clamping if (thrust.x*thrust.x > 1.0 || thrust.y*thrust.y > 1.0 || thrust.z*thrust.z > 1.0) return false; return true; } // relpos and relvel are position and velocity of ship relative to target in ship's frame // targspeed is in direction of motion, must be positive // returns difference in closing speed from ideal, or zero if it thinks it's at the target double Ship::AIMatchPosVel(const vector3d &relpos, const vector3d &relvel, double targspeed, const vector3d &maxthrust) { matrix4x4d rot; GetRotMatrix(rot); vector3d objpos = relpos * rot; vector3d reldir = objpos.NormalizedSafe(); vector3d endvel = targspeed * reldir; double invmass = 1.0 / GetMass(); // find ideal velocities at current time given reverse thrust level vector3d ivel; ivel.x = calc_ivel(objpos.x, endvel.x, maxthrust.x * invmass); ivel.y = calc_ivel(objpos.y, endvel.y, maxthrust.y * invmass); ivel.z = calc_ivel(objpos.z, endvel.z, maxthrust.z * invmass); vector3d objvel = relvel * rot; vector3d diffvel = ivel - objvel; // required change in velocity AIChangeVelBy(diffvel); return diffvel.Dot(reldir); } // reldir*targdist and relvel are pos and vel of ship relative to target in ship's frame // endspeed is in direction of motion, must be positive // maxdecel is maximum deceleration thrust bool Ship::AIMatchPosVel2(const vector3d &reldir, double targdist, const vector3d &relvel, double endspeed, double maxdecel) { matrix4x4d rot; GetRotMatrix(rot); double parspeed = relvel.Dot(reldir); double ivel = calc_ivel(targdist, endspeed, maxdecel); double diffspeed = ivel - parspeed; vector3d diffvel = diffspeed * reldir * rot; bool rval = false; // crunch diffvel by relative thruster power to get acceleration in right direction if (diffspeed > 0.0) { vector3d maxFA = GetMaxThrust(diffvel) * Pi::game->GetTimeStep() / GetMass(); if (abs(diffvel.x) > maxFA.x) diffvel *= maxFA.x / abs(diffvel.x); if (abs(diffvel.y) > maxFA.y) diffvel *= maxFA.y / abs(diffvel.y); // if (abs(diffvel.z) > maxFA.z) diffvel *= maxFA.z / abs(diffvel.z); if (maxFA.z < diffspeed) rval = true; } // add perpendicular velocity vector3d perpvel = relvel - parspeed*reldir; diffvel -= perpvel * rot; AIChangeVelBy(diffvel); return rval; // true if acceleration was capped } // Input in object space void Ship::AIMatchAngVelObjSpace(const vector3d &angvel) { double maxAccel = GetShipType().angThrust / GetAngularInertia(); double invFrameAccel = 1.0 / (maxAccel * Pi::game->GetTimeStep()); matrix4x4d rot; GetRotMatrix(rot); vector3d diff = angvel - GetAngVelocity() * rot; // find diff between current & desired angvel SetAngThrusterState(diff * invFrameAccel); } // just forces the orientation void Ship::AIFaceDirectionImmediate(const vector3d &dir) { vector3d zaxis = -dir; vector3d xaxis = vector3d(0.0,1.0,0.0).Cross(zaxis).Normalized(); vector3d yaxis = zaxis.Cross(xaxis).Normalized(); matrix4x4d wantOrient = matrix4x4d::MakeRotMatrix(xaxis, yaxis, zaxis).InverseOf(); SetRotMatrix(wantOrient); } // position in ship's frame vector3d Ship::AIGetNextFramePos() { vector3d thrusters = GetThrusterState(); vector3d maxThrust = GetMaxThrust(thrusters); vector3d thrust = vector3d(maxThrust.x*thrusters.x, maxThrust.y*thrusters.y, maxThrust.z*thrusters.z); matrix4x4d rot; GetRotMatrix(rot); vector3d vel = GetVelocity() + rot * thrust * Pi::game->GetTimeStep() / GetMass(); vector3d pos = GetPosition() + vel * Pi::game->GetTimeStep(); return pos; } // returns true if ship will be aligned at end of frame bool Ship::AIFaceOrient(const vector3d &dir, const vector3d &updir) { double timeStep = Pi::game->GetTimeStep(); double maxAccel = GetShipType().angThrust / GetAngularInertia(); // should probably be in stats anyway if (maxAccel <= 0.0) return 0.0; double frameAccel = maxAccel * timeStep; matrix4x4d rot; GetRotMatrix(rot); if (dir.Dot(vector3d(rot[8], rot[9], rot[10])) > -0.999999) { AIFaceDirection(dir); return false; } vector3d uphead = (updir * rot).Normalized(); // create desired object-space updir vector3d dav(0.0, 0.0, 0.0); // desired angular velocity double ang = 0.0; if (uphead.y < 0.999999) { ang = acos(Clamp(uphead.y, -1.0, 1.0)); // scalar angle from head to curhead double iangvel = sqrt(2.0 * maxAccel * ang); // ideal angvel at current time double frameEndAV = iangvel - frameAccel; if (frameEndAV <= 0.0) iangvel = ang / timeStep; // last frame discrete correction else iangvel = (iangvel + frameEndAV) * 0.5; // discrete overshoot correction dav.z = uphead.x > 0 ? -iangvel : iangvel; } vector3d cav = (GetAngVelocity() - GetFrame()->GetAngVelocity()) * rot; // current obj-rel angvel // vector3d cav = GetAngVelocity() * rot; // current obj-rel angvel vector3d diff = (dav - cav) / frameAccel; // find diff between current & desired angvel SetAngThrusterState(diff); return (diff.z*diff.z < 1.0); } // Input: direction in ship's frame, doesn't need to be normalized // Approximate positive angular velocity at match point // Applies thrust directly // old: returns whether it can reach that direction in this frame // returns angle to target double Ship::AIFaceDirection(const vector3d &dir, double av) { double timeStep = Pi::game->GetTimeStep(); double maxAccel = GetShipType().angThrust / GetAngularInertia(); // should probably be in stats anyway if (maxAccel <= 0.0) return 0.0; double frameAccel = maxAccel * timeStep; matrix4x4d rot; GetRotMatrix(rot); vector3d head = (dir * rot).Normalized(); // create desired object-space heading vector3d dav(0.0, 0.0, 0.0); // desired angular velocity double ang = 0.0; if (head.z > -0.99999999) { ang = acos (Clamp(-head.z, -1.0, 1.0)); // scalar angle from head to curhead double iangvel = av + sqrt (2.0 * maxAccel * ang); // ideal angvel at current time double frameEndAV = iangvel - frameAccel; if (frameEndAV <= 0.0) iangvel = ang / timeStep; // last frame discrete correction else iangvel = (iangvel + frameEndAV) * 0.5; // discrete overshoot correction // Normalize (head.x, head.y) to give desired angvel direction if (head.z > 0.999999) head.x = 1.0; double head2dnorm = 1.0 / sqrt(head.x*head.x + head.y*head.y); // NAN fix shouldn't be necessary if inputs are normalized dav.x = head.y * head2dnorm * iangvel; dav.y = -head.x * head2dnorm * iangvel; } vector3d cav = (GetAngVelocity() - GetFrame()->GetAngVelocity()) * rot; // current obj-rel angvel // vector3d cav = GetAngVelocity() * rot; // current obj-rel angvel vector3d diff = (dav - cav) / frameAccel; // find diff between current & desired angvel // If the player is pressing a roll key, don't override roll. // XXX this really shouldn't be here. a better way would be to have a // field in Ship describing the wanted angvel adjustment from input. the // baseclass version in Ship would always be 0. the version in Player // would be constructed from user input. that adjustment could then be // considered by this method when computing the required change if (IsType(Object::PLAYER) && (KeyBindings::rollLeft.IsActive() || KeyBindings::rollRight.IsActive())) diff.z = m_angThrusters.z; SetAngThrusterState(diff); return ang; } // returns direction in ship's frame from this ship to target lead position vector3d Ship::AIGetLeadDir(const Body *target, const vector3d& targaccel, int gunindex) { vector3d targpos = target->GetPositionRelTo(this); vector3d targvel = target->GetVelocityRelTo(this); // todo: should adjust targpos for gunmount offset int laser = Equip::types[m_equipment.Get(Equip::SLOT_LASER, gunindex)].tableIndex; double projspeed = Equip::lasers[laser].speed; // first attempt double projtime = targpos.Length() / projspeed; vector3d leadpos = targpos + targvel*projtime + 0.5*targaccel*projtime*projtime; // second pass projtime = leadpos.Length() / projspeed; leadpos = targpos + targvel*projtime + 0.5*targaccel*projtime*projtime; return leadpos.Normalized(); } // same inputs as matchposvel, returns approximate travel time instead // underestimates if targspeed isn't reachable double Ship::AITravelTime(const vector3d &reldir, double targdist, const vector3d &relvel, double targspeed, bool flip) { double speed = relvel.Dot(reldir); // speed >0 is towards double dist = targdist; double faccel = GetAccelFwd(); double raccel = flip ? faccel : GetAccelRev(); double time1, time2, time3; // time to reduce speed to zero: time1 = -speed / faccel; dist += 0.5 * time1 * -speed; // time to reduce speed to zero after target reached: time3 = -targspeed / raccel; dist += 0.5 * time3 * -targspeed; // now time to cover distance between zero-vel points // midpoint = intercept of two gradients double m = dist*raccel / (faccel+raccel); time2 = sqrt(2*m/faccel) + sqrt(2*(dist-m)/raccel); return time1+time2+time3; }
gpl-3.0
GeorgiyDemo/KIP
Course III/УП/Практики/Практика 16/program1_asm.cpp
1044
#include "stdafx.h" #include <ctime> #include <locale.h> #include <iomanip> #include <iostream> using namespace std; int main() { setlocale(LC_ALL, "rus"); const int n = 1000; int arr[n] = { 0 }; int i, sum; printf("Исходный массив:\n"); for (i = 0; i <n; i++) { arr[i] = rand() % 4 + 2; printf("%3d", arr[i]); } unsigned int start_time = clock(); _asm { mov eax, 0; начальное значение суммы mov ecx, 1000; счетчик цикла mov esi, 0; начальное значение индекса l : add eax, arr[esi]; eax = eax + arr[i] add esi, 4; следующий индекс loop l; цикл n раз mov sum, eax } unsigned int end_time = clock(); unsigned int search_time = end_time - start_time; // искомое время printf("\n sum= %d", sum); cout << " time= " << clock() / 1000.0; //микросекунды getchar(); }
gpl-3.0
mwveliz/siglas-mppp
lib/model/doctrine/project/Funcionarios/base/BaseFuncionarios_FamiliarDiscapacidad.class.php
6497
<?php // Connection Component Binding Doctrine_Manager::getInstance()->bindComponent('Funcionarios_FamiliarDiscapacidad', 'doctrine'); /** * BaseFuncionarios_FamiliarDiscapacidad * * This class has been auto-generated by the Doctrine ORM Framework * * @property integer $id * @property integer $familiar_id * @property integer $discapacidad_id * @property timestamp $f_validado * @property integer $id_validado * @property string $status * @property integer $id_update * @property string $ip_update * @property string $proteccion * @property Funcionarios_Familiar $Funcionarios_Familiar * @property Public_Discapacidad $Public_Discapacidad * * @method integer getId() Returns the current record's "id" value * @method integer getFamiliarId() Returns the current record's "familiar_id" value * @method integer getDiscapacidadId() Returns the current record's "discapacidad_id" value * @method timestamp getFValidado() Returns the current record's "f_validado" value * @method integer getIdValidado() Returns the current record's "id_validado" value * @method string getStatus() Returns the current record's "status" value * @method integer getIdUpdate() Returns the current record's "id_update" value * @method string getIpUpdate() Returns the current record's "ip_update" value * @method string getProteccion() Returns the current record's "proteccion" value * @method Funcionarios_Familiar getFuncionariosFamiliar() Returns the current record's "Funcionarios_Familiar" value * @method Public_Discapacidad getPublicDiscapacidad() Returns the current record's "Public_Discapacidad" value * @method Funcionarios_FamiliarDiscapacidad setId() Sets the current record's "id" value * @method Funcionarios_FamiliarDiscapacidad setFamiliarId() Sets the current record's "familiar_id" value * @method Funcionarios_FamiliarDiscapacidad setDiscapacidadId() Sets the current record's "discapacidad_id" value * @method Funcionarios_FamiliarDiscapacidad setFValidado() Sets the current record's "f_validado" value * @method Funcionarios_FamiliarDiscapacidad setIdValidado() Sets the current record's "id_validado" value * @method Funcionarios_FamiliarDiscapacidad setStatus() Sets the current record's "status" value * @method Funcionarios_FamiliarDiscapacidad setIdUpdate() Sets the current record's "id_update" value * @method Funcionarios_FamiliarDiscapacidad setIpUpdate() Sets the current record's "ip_update" value * @method Funcionarios_FamiliarDiscapacidad setProteccion() Sets the current record's "proteccion" value * @method Funcionarios_FamiliarDiscapacidad setFuncionariosFamiliar() Sets the current record's "Funcionarios_Familiar" value * @method Funcionarios_FamiliarDiscapacidad setPublicDiscapacidad() Sets the current record's "Public_Discapacidad" value * * @package siglas * @subpackage model * @author Livio Lopez * @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $ */ abstract class BaseFuncionarios_FamiliarDiscapacidad extends BaseDoctrineRecord { public function setTableDefinition() { $this->setTableName('funcionarios.familiar_discapacidad'); $this->hasColumn('id', 'integer', 4, array( 'type' => 'integer', 'fixed' => 0, 'unsigned' => false, 'primary' => true, 'sequence' => 'funcionarios.familiar_discapacidad_id', 'length' => 4, )); $this->hasColumn('familiar_id', 'integer', 4, array( 'type' => 'integer', 'fixed' => 0, 'unsigned' => false, 'notnull' => true, 'primary' => false, 'length' => 4, )); $this->hasColumn('discapacidad_id', 'integer', 4, array( 'type' => 'integer', 'fixed' => 0, 'unsigned' => false, 'notnull' => true, 'primary' => false, 'length' => 4, )); $this->hasColumn('f_validado', 'timestamp', 25, array( 'type' => 'timestamp', 'fixed' => 0, 'unsigned' => false, 'notnull' => false, 'primary' => false, 'length' => 25, )); $this->hasColumn('id_validado', 'integer', 4, array( 'type' => 'integer', 'fixed' => 0, 'unsigned' => false, 'notnull' => false, 'primary' => false, 'length' => 4, )); $this->hasColumn('status', 'string', 1, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'notnull' => true, 'primary' => false, 'length' => 1, )); $this->hasColumn('id_update', 'integer', 4, array( 'type' => 'integer', 'fixed' => 0, 'unsigned' => false, 'notnull' => true, 'primary' => false, 'length' => 4, )); $this->hasColumn('ip_update', 'string', 40, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'notnull' => true, 'primary' => false, 'length' => 40, )); $this->hasColumn('proteccion', 'string', null, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'notnull' => false, 'primary' => false, 'length' => '', )); } public function setUp() { parent::setUp(); $this->hasOne('Funcionarios_Familiar', array( 'local' => 'familiar_id', 'foreign' => 'id')); $this->hasOne('Public_Discapacidad', array( 'local' => 'discapacidad_id', 'foreign' => 'id')); $timestampable0 = new Doctrine_Template_Timestampable(); $this->actAs($timestampable0); } }
gpl-3.0
michiwieland/openairmalans-theme
wp-content/themes/openairmalans/assets/js/script.js
2155
$(function(){ /* * LITY LIGHTBOX * */ $(document).on('lity:ready', function(event, lightbox) { const lityContent = $(event.currentTarget.activeElement).find('.lity-content'); const title = !!lightbox.opener().data('title') ? lightbox.opener().data('title') : ""; const description = !!lightbox.opener().data('desc') ? lightbox.opener().data('desc') : ""; lityContent.prepend('<h1 class="lity-title">' + title + '</h1>'); lityContent.append('<p class="lity-descr">' + description + '</p>'); }); /* * ONE PAGE NAVIGATION * Default: scroll to anchor, if we are on the front page * Use http link, if we are on a detail page (e.g news) */ $('.nav-main-link').on('click', function(e){ e.preventDefault(); var link = $(this).attr('href'); var sectionSlug = link; // some links already link to an anchor if (sectionSlug.indexOf('#') === -1) { sectionSlug = '#' + getSlug(link); } if ( $(sectionSlug).length > 0 ) { // move to anchor $('html, body').animate({ scrollTop: $( sectionSlug ).offset().top - 30 }, 500); } else { // we are in a detail page var newURL = window.location.protocol + "//" + window.location.host + "/" + sectionSlug; window.location.replace(newURL); } }); function getSlug(fullLink) { var linkParts = fullLink.split('/'); return linkParts[linkParts.length - 2]; } /* * MOBILE MENU */ // toggle mobile menu $("#hamburger").click(function() { if ($(".main-nav").is(":visible")){ $(".main-nav").hide("fast"); } else { $(".main-nav").show("fast"); } }); // close mobile menu if user clicks anywhere $(document).click(function(e){ if (mobileMenuVisible() && !$(e.target).is("#hamburger")) { $(".main-nav").hide("fast"); } }); // maintain correct visibility while resizing $( window ).resize(function() { if (!isMobile()) { $(".main-nav").show(); } else { $(".main-nav").hide(); } }); function isMobile() { return $("#hamburger").is(":visible"); } function mobileMenuVisible() { return isMobile() && $(".main-nav").is(":visible"); } });
gpl-3.0
thunder033/RMWA
pulsar/app/flare/control-panel.directive.js
1916
/** * Created by gjrwcs on 9/15/2016. */ const MDT = require('../mallet/mallet.dependency-tree').MDT; (()=>{ 'use strict'; require('angular').module('pulsar.flare').directive('controlPanel', [ 'Flare', 'flare.const.Effects', MDT.Scheduler, 'media.Library', 'audio.Player', 'media.const.Type', controlPanel]); function controlPanel(Visualizer, Effects, MScheduler, MediaLibrary, AudioPlayer, MediaType){ return { restrict: 'E', replace: true, templateUrl: 'views/control-panel.html', link: function(scope){ scope.reverbEffects = []; scope.player = AudioPlayer; scope.visualizer = Visualizer; scope.effects = Effects; var noneOption = {name: 'None', id: 9999}; scope.reverbEffect = noneOption; // Get all of the reverb effects from the media library MediaLibrary.getAudioClips(MediaType.ReverbImpulse) .then(effects => { scope.reverbEffects = effects.asArray(); scope.reverbEffects.push(noneOption); }); /** * Enables the currently selected reverb effect */ scope.setReverbEffect = function(){ if(scope.reverbEffect.name === 'None'){ AudioPlayer.disableConvolverNode(); } else { var clipData = MediaLibrary.getAudioClip(scope.reverbEffect.name).clip; AudioPlayer.setConvolverImpulse(clipData); } }; MScheduler.schedule(()=>scope.$apply()); }, controller: 'ControlPanelCtrl' }; } })();
gpl-3.0
Ventrosky/python-scripts
network-recon/web-scan.py
2442
#!/usr/bin/python import sys, os, subprocess def nmapScriptsScan( ip, port, serv): print "[-] Starting nmap web script scan for " + ip + ":" + port nmapCmd = "nmap -sV -Pn -v -p "+port+" --script='(http* or ssl*) and not (broadcast or dos or external or http-slowloris* or fuzzer)' -oN reports/web-serv/"+ip+"_"+port+"_"+serv+"_nmap "+ip+ " >> reports/web-serv/"+ip+"_"+port+"_"+serv+"_nmapOutput.txt" subprocess.check_output(nmapCmd, shell=True) print "[-] Nmap web script scan completed for " + ip + ":" + port def niktoScan(ip, port, serv): print "[-] Starting Nikto Scan on " + ip + ":" + port niktoCmd = "nikto -host "+ip+" -p "+port+" -o reports/web-serv/"+ip+"_"+port+"_"+serv+"_nikto.txt -C all" subprocess.check_output(niktoCmd, shell=True) print "[-] Completed Nikto Scan on " + ip + ":" + port def dirBust(url, name, port): url = str(sys.argv[1]) name = str(sys.argv[2]) folders = ["/usr/share/dirb/wordlists", "/usr/share/dirb/wordlists/vulns"] found = [] print "[-] Starting dirb scan for " + url + ":" + port for folder in folders: for filename in os.listdir(folder): outFile = " -o " + "reports/web-serv/" + url + "_" + port + "_"+name+"_dirb_" + filename DIRBSCAN = "dirb "+url+" "+folder+"/"+filename+" "+outFile+" -S -r -w" try: results = subprocess.check_output(DIRBSCAN, shell=True) results_list = results.split("\n") for line in results_list: if "+" in line: if line not in found: found.append(line) except: pass try: if found[0] != "": print "[-] Dirb has found something for "+ url+":"+port outfile = "reports/web-serv/"+ip+"_"+port+"_"+name+"_dirbItems.txt" dirbf = open(outfile, "w") for item in found: dirbf.write(item+"\n") dirbf.close except: print "[-] Dirb didn't find items for "+ url+":"+port def main(): if len(sys.argv) != 4: print "Passed: ",sys.argv print "Usage: web-scan.py <targetUrl> <port> <serviceName>" sys.exit(0) ip = str(sys.argv[1]) port = str(sys.argv[2]) serv = str(sys.argv[3]) nmapScriptsScan( ip, port, serv) dirBust( ip, serv, port) #niktoScan( ip, port, serv) main()
gpl-3.0
LTBuses/LTB-android
app/src/main/java/org/frasermccrossan/ltc/HourMinute.java
3520
package org.frasermccrossan.ltc; import java.util.Calendar; import java.util.regex.Matcher; import java.util.regex.Pattern; /* a very simple time representation class since we don't really want the sophistication * of Calendar; really just acts as a return value of a regexp-parsed time */ public class HourMinute { public static final int AM = 0; public static final int PM = 2; public static final int NO_AMPM = -1; static final int DAY_MINUTES = 24 * 60; static final int HALF_DAY_MINUTES = DAY_MINUTES / 2; public int minsAfterMidnight; // absolute number of minutes after midnight /* this needs to match the following forms and extract the hour, minutes and am/pmage: * "12:04" * "12:04 [AP]" * :12:04:08 [AP]" */ static final Pattern TIME_PATTERN = Pattern.compile("(\\d{1,2}):(\\d{2})(:\\d{2})? ?([AP])?"); public int hour = -1; public int minute; public int am_pm = NO_AMPM; HourMinute(Calendar reference, String textTime) { Matcher m = TIME_PATTERN.matcher(textTime); if (m.find()) { hour=Integer.valueOf(m.group(1)); if (hour == 12) { hour = 0; } // makes calculations easier minute = Integer.valueOf(m.group(2)); String am_pm_s = m.group(4); if (am_pm_s != null) { am_pm_s = am_pm_s.toLowerCase(); if (am_pm_s.equals("p")) { am_pm = PM; hour += 12; // we fixed the hour values above, so 12 is zero } else { am_pm = AM; } } minsAfterMidnight = hour * 60 + minute; if (!hasAmPm()) { /* no am/pm indicator, assume it's within 12 hours of now and take a best guess, * then correct the hour value */ int ref12Hour = reference.get(Calendar.HOUR); // 12-hour hour of reference int refMinute = reference.get(Calendar.MINUTE); // minute of reference if (ref12Hour == 12) { ref12Hour = 0; } // easier calculation int refMinutes12 = ref12Hour * 60 + refMinute; int ref24hour = reference.get(Calendar.HOUR_OF_DAY); int refMinutes24 = ref24hour * 60 + refMinute; if (minsAfterMidnight >= refMinutes12) { /* the 12-hour time hour is greater than the reference 12-hour, assume it's * *after* the reference time in the same 12-hour segment */ minsAfterMidnight = refMinutes24 + (minsAfterMidnight - refMinutes12); } else { /* otherwise, the 12-hour time is less than the reference, so it's * in the "other" 12 hour segment */ if (refMinutes24 >= HALF_DAY_MINUTES) { // reference is second half of day, so time we seek is after midnight, in the early hours // we need do nothing } else { // reference is first half of day, so time we seek is afternoon minsAfterMidnight += HALF_DAY_MINUTES; } } hour = minsAfterMidnight / 60; minute = minsAfterMidnight % 60; } //Log.d("HourMinute", String.format("orig %s hour %d min %d", textTime, hour, minute)); } } public boolean isValid() { return hour >= 0; } public Boolean hasAmPm() { return am_pm != NO_AMPM; } int timeDiff(Calendar reference) { if (isValid()) { /* the minsAfterMidnight value here should now be correct whether we had * an AM/PM time or not, so the calculation is simple */ int refMinsAfterMidnight = reference.get(Calendar.HOUR_OF_DAY) * 60 + reference.get(Calendar.MINUTE); int diff = minsAfterMidnight - refMinsAfterMidnight; if (diff >= 0) { return diff; } else { return DAY_MINUTES + diff; } } else { return Prediction.VERY_FAR_AWAY; } } }
gpl-3.0
heloelhdez/AgendaNuevaEra
src/java/modelo/Usuario.java
651
package modelo; public class Usuario { int id; private String nombre; private String contraseña; public int getID() { return id; } public void setID(int id) { this.id = id; } public String getNombre() { return nombre; } public void setNombre(String nombre) { this.nombre = nombre; } public String getContrasena() { return contraseña; } public void setContraseña(String contrasena) { this.contraseña = contraseña; } public Usuario(int id,String nombre, String contrasena){ this.id=id; this.nombre = nombre; this.contraseña = contrasena; } }
gpl-3.0
HoodDigital/Hood
projects/Hood.Core/ViewModels/ContactFormModel.cs
4290
using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using Hood.Core; using Hood.Extensions; using Hood.Interfaces; using Hood.Models; using SendGrid.Helpers.Mail; namespace Hood.ViewModels { public class ContactFormModel : SpamPreventionModel, IEmailSendable { public EmailAddress From { get; set; } = null; public EmailAddress ReplyTo { get; set; } = null; [Required] [Display(Name = "Your name")] public string Name { get; set; } [Required] [EmailAddress] [Display(Name = "E-mail Address")] public string Email { get; set; } [Display(Name = "Phone Number")] public string PhoneNumber { get; set; } [Required] [Display(Name = "Enquiry")] public string Enquiry { get; set; } public string Message { get; set; } public string Subject { get; set; } public EmailAddress To { get { return new EmailAddress(Email, Name); } } public bool ShowValidationMessage { get; set; } public bool ShowValidationIndividualMessages { get; set; } public string AdminNotificationTitle { get; set; } public string AdminNotificationSubject { get; set; } public string AdminNotificationMessage { get; set; } public string NotificationTitle { get; set; } public string NotificationPreHeader { get; private set; } public string NotificationSubject { get; set; } public string NotificationMessage { get; set; } public bool SendToRecipient { get; set; } public List<EmailAddress> NotifyEmails { get; set; } public string NotifyRole { get; set; } public ContactFormModel() { } public ContactFormModel(bool showValidationMessage, bool showValidationIndividualMessages) { ShowValidationMessage = showValidationMessage; ShowValidationIndividualMessages = showValidationIndividualMessages; } public MailObject WriteToMailObject(MailObject message) { var contactSettings = Engine.Settings.Contact; message.PreHeader = NotificationTitle.IsSet() ? NotificationTitle.ReplaceSiteVariables() : contactSettings.Title.ReplaceSiteVariables(); message.Subject = NotificationSubject.IsSet() ? NotificationSubject.ReplaceSiteVariables() : contactSettings.Subject.ReplaceSiteVariables(); message.AddParagraph(NotificationMessage.IsSet() ? NotificationMessage.ReplaceSiteVariables() : contactSettings.Message.ReplaceSiteVariables()); message.AddParagraph("Name: <strong>" + Name + "</strong>"); message.AddParagraph("Email: <strong>" + Email + "</strong>"); message.AddParagraph("Phone: <strong>" + PhoneNumber + "</strong>"); message.AddParagraph("Subject: <strong>" + Subject + "</strong>"); message.AddParagraph("Enquiry:"); message.AddParagraph("<strong>" + Enquiry + "</strong>"); return message; } public MailObject WriteNotificationToMailObject(MailObject message) { var contactSettings = Engine.Settings.Contact; message.PreHeader = AdminNotificationTitle.IsSet() ? AdminNotificationTitle.ReplaceSiteVariables() : contactSettings.AdminNoficationTitle.ReplaceSiteVariables(); message.Subject = AdminNotificationSubject.IsSet() ? AdminNotificationSubject.ReplaceSiteVariables() : contactSettings.AdminNoficationSubject.ReplaceSiteVariables(); message.AddParagraph(AdminNotificationMessage.IsSet() ? AdminNotificationMessage.ReplaceSiteVariables() : contactSettings.AdminNoficationMessage.ReplaceSiteVariables()); message.AddParagraph("Name: <strong>" + Name + "</strong>"); message.AddParagraph("Email: <strong>" + Email + "</strong>"); message.AddParagraph("Phone: <strong>" + PhoneNumber + "</strong>"); message.AddParagraph("Subject: <strong>" + Subject + "</strong>"); message.AddParagraph("Enquiry:"); message.AddParagraph("<strong>" + Enquiry + "</strong>"); return message; } } }
gpl-3.0
ChipLeo/WowPacketParser
WowPacketParserModule.V5_4_1_17538/Parsers/CharacterHandler.cs
6518
using System; using WowPacketParser.Enums; using WowPacketParser.Misc; using WowPacketParser.Parsing; using WowPacketParser.Store; using WowPacketParser.Store.Objects; namespace WowPacketParserModule.V5_4_1_17538.Parsers { public static class CharacterHandler { [Parser(Opcode.CMSG_CHAR_DELETE)] public static void HandleClientCharDelete(Packet packet) { var playerGuid = new byte[8]; playerGuid[1] = packet.ReadBit(); playerGuid[4] = packet.ReadBit(); playerGuid[7] = packet.ReadBit(); playerGuid[5] = packet.ReadBit(); playerGuid[3] = packet.ReadBit(); playerGuid[2] = packet.ReadBit(); playerGuid[0] = packet.ReadBit(); playerGuid[6] = packet.ReadBit(); packet.ParseBitStream(playerGuid, 2, 0, 4, 1, 5, 3, 7, 6); var guid = new WowGuid64(BitConverter.ToUInt64(playerGuid, 0)); packet.WriteGuid("GUID", playerGuid); } [Parser(Opcode.SMSG_ENUM_CHARACTERS_RESULT)] public static void HandleCharEnum(Packet packet) { var count = packet.ReadBits("Char count", 16); var charGuids = new byte[count][]; var guildGuids = new byte[count][]; var firstLogins = new bool[count]; var nameLenghts = new uint[count]; for (int c = 0; c < count; ++c) { charGuids[c] = new byte[8]; guildGuids[c] = new byte[8]; guildGuids[c][3] = packet.ReadBit(); firstLogins[c] = packet.ReadBit(); charGuids[c][6] = packet.ReadBit(); guildGuids[c][1] = packet.ReadBit(); charGuids[c][1] = packet.ReadBit(); charGuids[c][5] = packet.ReadBit(); guildGuids[c][6] = packet.ReadBit(); charGuids[c][7] = packet.ReadBit(); charGuids[c][0] = packet.ReadBit(); guildGuids[c][5] = packet.ReadBit(); charGuids[c][2] = packet.ReadBit(); nameLenghts[c] = packet.ReadBits(6); charGuids[c][4] = packet.ReadBit(); guildGuids[c][4] = packet.ReadBit(); guildGuids[c][2] = packet.ReadBit(); charGuids[c][3] = packet.ReadBit(); guildGuids[c][0] = packet.ReadBit(); guildGuids[c][7] = packet.ReadBit(); } packet.ReadBit("Unk bit"); var count2 = packet.ReadBits("RIDBIT21", 21); packet.ResetBitReader(); for (int c = 0; c < count; ++c) { Vector3 pos = new Vector3(); packet.ReadByte("Skin", c); //v4+61 packet.ReadXORByte(charGuids[c], 2); packet.ReadXORByte(charGuids[c], 7); packet.ReadInt32("Pet Display ID", c); //v4+108 var name = packet.ReadWoWString("Name", (int)nameLenghts[c], c); // v4 + 8 for (int j = 0; j < 23; ++j) { packet.ReadInt32("Item DisplayID", c, j); packet.ReadInt32("Item EnchantID", c, j); packet.ReadByteE<InventoryType>("Item InventoryType", c, j); } packet.ReadXORByte(charGuids[c], 4); packet.ReadXORByte(charGuids[c], 6); var level = packet.ReadByte("Level", c); // v4+66 pos.Y = packet.ReadSingle("Position Y", c); // v4+80 pos.X = packet.ReadSingle("Position X", c); //v4+76 packet.ReadByte("Face", c); // v4+62 packet.ReadXORByte(guildGuids[c], 0); packet.ReadByte("List Order", c); //v4+57 var zone = packet.ReadUInt32<ZoneId>("Zone Id", c); packet.ReadXORByte(guildGuids[c], 7); packet.ReadInt32E<CharacterFlag>("CharacterFlag", c); var mapId = packet.ReadInt32<MapId>("Map Id", c); //v4+72 var race = packet.ReadByteE<Race>("Race", c); //v4+58 pos.Z = packet.ReadSingle("Position Z", c); //v4+84 packet.ReadXORByte(guildGuids[c], 1); packet.ReadByteE<Gender>("Gender", c); //v4+60 packet.ReadXORByte(charGuids[c], 3); packet.ReadByte("Hair Color", c); // v4+64 packet.ReadXORByte(guildGuids[c], 5); var klass = packet.ReadByteE<Class>("Class", c); // v4+59 packet.ReadXORByte(guildGuids[c], 2); packet.ReadXORByte(charGuids[c], 1); packet.ReadUInt32E<CustomizationFlag>("CustomizationFlag", c); //v4+100 packet.ReadByte("Facial Hair", c); // v4+65 packet.ReadXORByte(guildGuids[c], 6); packet.ReadXORByte(charGuids[c], 0); packet.ReadByte("Hair Style", c); // v4+63 packet.ReadXORByte(charGuids[c], 5); packet.ReadInt32("Pet Family", c); // v4+116 packet.ReadXORByte(guildGuids[c], 2); packet.ReadInt32("Pet Level", c); // v4+112 packet.ReadXORByte(guildGuids[c], 4); for (var i = 0; i < count2; ++i) { packet.ReadByte("unk2", i); packet.ReadUInt32("unk1", i); } var playerGuid = new WowGuid64(BitConverter.ToUInt64(charGuids[c], 0)); packet.WriteGuid("Character GUID", charGuids[c], c); packet.WriteGuid("Guild GUID", guildGuids[c], c); if (firstLogins[c]) { PlayerCreateInfo startPos = new PlayerCreateInfo { Race = race, Class = klass, Map = (uint)mapId, Zone = zone, Position = pos, Orientation = 0 }; Storage.StartPositions.Add(startPos, packet.TimeSpan); } var playerInfo = new Player { Race = race, Class = klass, Name = name, FirstLogin = firstLogins[c], Level = level, Type = ObjectType.Player }; if (Storage.Objects.ContainsKey(playerGuid)) Storage.Objects[playerGuid] = new Tuple<WoWObject, TimeSpan?>(playerInfo, packet.TimeSpan); else Storage.Objects.Add(playerGuid, playerInfo, packet.TimeSpan); StoreGetters.AddName(playerGuid, name); } } } }
gpl-3.0
danielpjr/ImageResize
ImageResize.php
19699
<?php /** * Class ImageResize * * Simple image resizing. * Supported image types are: JPG/JPEG, PNG, GIF. * You can control whether the image will be enlarged or not if it is smaller. * You can set whether or not the image is cropped to meet the new measurements. * By default it does not enlarge if it is smaller and does not trim, respecting the maximum measures. * * @author Daniel P. Jr <danielpjr80@gmail.com> * @license GPL * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 0.01 * * @example // Resize respecting sizes. * ImageResize::source( 'path/to/source/image.jpg' ) * ->size( 100, 100 ) * ->save( 'path/to/destination/image.jpg' ); * * // Resizes forcing sizes. * ImageResize::source( 'path/to/source/image.jpg' ) * ->size( 100, 100, true ) * ->save( 'path/to/destination/image.jpg' ); * * // Resizes forcing quality. * ImageResize::source( 'path/to/source/image.jpg' ) * ->size( 100, 100 ) * ->save( 'path/to/destination/image.jpg', 100 ); * * // Multiple resize of an image. * ImageResize::source( 'path/to/source/image.jpg' ) * ->size( 100, 100 )->save( 'path/to/destination/image1.jpg' ) * ->size( 450, 300 )->save( 'path/to/destination/image2.jpg' ) * ->size( 800, 600 )->save( 'path/to/destination/image3.jpg' ); * * // Multiple source image. * ImageResize::source( 'path/to/source/image1.jpg' ) * ->size( 100, 100 )->save( 'path/to/destination/image1.jpg' ) * ->source( 'path/to/source/image2.jpg' ) * ->size( 800, 600 )->save( 'path/to/destination/image3.jpg' ); * * // Resizes and remove source image. * ImageResize::source( 'path/to/source/image.jpg' ) * ->size( 100, 100 ) * ->save( 'path/to/destination/image.jpg' ); * ->clear(); */ class ImageResize { /** * Full or relative path source image * * @access private * @var string */ private $source = ''; /** * IMAGETYPE_XXX [ 1:GIF, 2:JPEG, 3:PNG ] * * @access private * @var int */ private $source_type = 0; /** * Full or relative path destination image. * * @access private * @var string */ private $dest = ''; private $maxWidth = 0; private $maxHeight = 0; /** * The pattern to search for validate supported image formats. * * @access private * @var string */ private $imageTypesPatern = '/(.jpe?g|.gif|.png)$/i'; /** * The pattern to search for validate image name and path. * * @access private * @var string */ private $imageNamePattern = '/[^a-zA-Z0-9\.\/\-_:]/'; /** * Holds eventual error plain message. * * @access public * @var array */ public $errors = array(); /** * Internal class variable that informs the need to crop the image. * * @access private * @var bool */ private $crop = false; /** * Internal class variable that informs the need to resize the image. * * @access private * @var bool */ private $resize = false; /** * It informs if the class should force the resizing and / or cropping of the image * to respect the new measures informed by the user. * * @access private * @var bool */ private $forceSize = false; /** * quality is optional, and ranges from 0 (worst quality, smaller file) * to 100 (best quality, biggest file). * The default is the default IJG quality value (about 75). * * @access private * @var int */ private $quality = 75; /** * Image resource identifier from imagecreatefrom{jpeg|gif|png}(). * * @access private * @var resource */ private $src_image = null; /** * Image resource identifier from imagecreatetruecolor(). * * @access private * @var resource */ private $dst_image = null; /** * Image resource identifier from imagecreatetruecolor(). * * @access private * @var resource */ private $dst_cropped = null; /** * Image resource identifier from $this->dst_image or $this->dst_cropped. * * @access private * @var resource */ private $dst_final = null; /** * X-coordinate of source point. * * Used only when there is a need to crop the image * * @access private * @var int */ private $src_x = 0; /** * Y-coordinate of source point. * * Used only when there is a need to crop the image * * @access private * @var int */ private $src_y = 0; /** * Destination width. * * @access private * @var int */ private $dst_w = 0; /** * Destination height. * * @access private * @var int */ private $dst_h = 0; /** * Source width. * * @access private * @var int */ private $src_w = 0; /** * Source height. * * @access private * @var int */ private $src_h = 0; /** * ImageResize constructor. * * @param string $source * * @access public */ public function __construct( $source = '') { set_error_handler( array($this, 'customErrorHandler') ); $this->size(); if( false == empty($source) ) { $source = preg_replace( $this->imageNamePattern , '' , $source ); if( false == preg_match( $this->imageTypesPatern , $source ) ) { $this->errors[] = "Source: [{$source}] is not a valid type."; return $this; } clearstatcache(); if( false == is_file( $source ) ) { $this->errors[] = "Source: [{$source}] is not a file or does not have a valid name."; return $this; } clearstatcache(); if( false == is_readable( $source ) ) { $this->errors[] = "Source: [{$source}] can not be read."; return $this; } list($this->src_w , $this->src_h , $source_type) = getimagesize( $source ); if( !$this->src_w || !$this->src_h ) { $this->errors[] = "Width and Height of source are invalid: Width[{$this->src_w}], Height[{$this->src_h}]."; $this->src_w = $this->src_h = 0; return $this; } $source_type = intval( $source_type ); switch( $source_type ) { case 1: $source_type_equals_extension = preg_match( '/(\.gif)$/i', $source ); break; case 2: $source_type_equals_extension = preg_match( '/(\.jpe?g)$/i', $source ); break; case 3: $source_type_equals_extension = preg_match( '/(\.png)$/i', $source ); break; default: $source_type_equals_extension = false; break; } if( false == $source_type_equals_extension ) { $this->errors[] = "IMAGETYPE_XXX: [{$source_type}] invalid."; $this->src_w = $this->src_h = 0; return $this; } $this->source_type = $source_type; $this->source = $source; } return $this; }// __construct() /** * It defines the measures of the new image and whether these measures must be respected. * * @param int $maxWidth * @param int $maxHeight * @param bool $forceSize * * @access public * @return $this */ public function size( $maxWidth = 0 , $maxHeight = 0, $forceSize = false ) { $maxWidth = intval( $maxWidth ); $maxHeight = intval( $maxHeight ); $this->maxWidth = ( $maxWidth ) ? $maxWidth : 1200; $this->maxHeight = ( $maxHeight ) ? $maxHeight : 800; $this->forceSize = $forceSize; return $this; } /** * Validate the source image and get your measurements. * * @param string $source * * @access public * @return $this */ public static function source( $source = '' ) { return new ImageResize( $source ); }// source() /** * Calculate the new measures. * * Defines whether to resize and or trim. * * @access private * @return $this */ private function calculate() { // Do not resize and or crop. if( $this->maxWidth > $this->src_w || $this->maxHeight > $this->src_h ) { if( false == $this->forceSize ) { $this->resize = false; return $this; } } $this->resize = true; $this->dst_w = $this->maxWidth; $this->dst_h = intval( $this->src_h * ($this->maxWidth / $this->src_w) ); if( ($this->dst_h < $this->maxHeight && $this->forceSize) || ($this->dst_h > $this->maxHeight && false == $this->forceSize) ) { $this->dst_h = $this->maxHeight; $this->dst_w = intval( $this->src_w * ($this->maxHeight / $this->src_h) ); } $this->crop = ( $this->dst_w > $this->maxWidth || $this->dst_h > $this->maxHeight ); if( $this->crop ) { // Define X and Y positions where copying of the already resized image will begin. $this->src_x = intval( ($this->dst_w - $this->maxWidth) / 2 ); $this->src_x = ($this->src_x > 0) ? $this->src_x : 0; $this->src_y = intval( ($this->dst_h - $this->maxHeight) / 2 ); $this->src_y = ($this->src_y > 0) ? $this->src_y : 0; } }// calculate() /** * Apply Transparency on PNG and GIF images. * * @link https://github.com/maxim/smart_resize_image * * @param $final_image * @param $source_image */ private function transparencyApply( &$final_image, &$source_image ) { if( in_array($this->source_type,array(1,3)) ) { $transparency = imagecolortransparent( $source_image ); $palletsize = imagecolorstotal( $source_image ); if( $transparency >= 0 && $transparency < $palletsize ) { $transparent_color = imagecolorsforindex( $source_image , $transparency ); $transparency = imagecolorallocate( $final_image , $transparent_color['red'] , $transparent_color['green'] , $transparent_color['blue'] ); imagefill( $final_image , 0 , 0 , $transparency ); imagecolortransparent( $final_image , $transparency ); } elseif( $this->source_type == 3 ) { imagealphablending( $final_image , false ); $color = imagecolorallocatealpha( $final_image , 0 , 0 , 0 , 127 ); imagefill( $final_image , 0 , 0 , $color ); imagesavealpha( $final_image , true ); } } } /** * Create final image. * * Define image quality. * * Validate any image extensions. * * @param string $dest * @param null $quality * * @access public * @return $this * * @todo Validate path if it exists. */ public function save( $dest = '', $quality = null ) { $this->quality = ($quality) ? $quality : ( ($this->source_type==3) ? 100 : $this->quality ); $this->dest = preg_replace( $this->imageNamePattern, '', $dest ); $extOrigem = strtolower( pathinfo( $this->source, PATHINFO_EXTENSION ) ); $extDest = pathinfo( $this->dest, PATHINFO_EXTENSION ); if( $extOrigem != $extDest ) { if( preg_match('/^(jpe?g)$/', $extOrigem) && false == preg_match('/^(jpe?g)$/', $extDest) ) { $this->errors[] = "Destination: [{$this-> dest}] is not the same type as Origin: [{$this->source}]."; return $this; } } if( false == preg_match( $this->imageTypesPatern, $this->dest ) ) { $this->errors[] = "Destination: [{$this->dest} ]not a valid type."; return $this; } $this->calculate(); if( $this->resize ) { switch( $extOrigem ) { case 'gif': $this->src_image = imagecreatefromgif( $this->source ); break; case 'jpeg': case 'jpg': $this->src_image = imagecreatefromjpeg( $this->source ); break; case 'png': $this->src_image = imagecreatefrompng( $this->source ); break; } if( false == $this->src_image ) { $this->errors[] = "Could not create from Source: [{$this->source}]."; return $this; } $this->dst_image = imagecreatetruecolor( $this->dst_w, $this->dst_h ); if( false == $this->dst_image ) { $this->errors[] = 'Imagetruecolor failed for resized image.'; return $this; } $this->transparencyApply( $this->dst_image, $this->src_image ); if( false == imagecopyresampled ( $this->dst_image , $this->src_image , 0, 0, 0, 0 , $this->dst_w , $this->dst_h , $this->src_w , $this->src_h ) ) { $this->errors[] = 'imagecopyresampled failed for resized image.'; return $this; } $this->dst_final = $this->dst_image; if( $this->crop ) { $this->dst_cropped = imagecreatetruecolor( $this->maxWidth, $this->maxHeight ); if( false == $this->dst_cropped ) { $this->errors[] = 'Imagetruecolor failed for cropped image.'; return $this; } $this->transparencyApply( $this->dst_cropped, $this->dst_image ); if( false == imagecopyresampled( $this->dst_cropped, $this->dst_image, 0, 0, $this->src_x, $this->src_y, $this->maxWidth, $this->maxHeight, $this->maxWidth, $this->maxHeight) ) { $this->errors[] = 'imagecopyresampled failed for cropped image.'; return $this; } $this->dst_final = $this->dst_cropped; } switch( $extDest ) { case 'gif': imagegif( $this->dst_final , $this->dest ); break; case 'jpeg': case 'jpg': imagejpeg( $this->dst_final , $this->dest, $this->quality ); break; case 'png': $this->quality = intval(( 9 * $this->quality ) / 100 ); imagepng( $this->dst_final , $this->dest, $this->quality ); break; } } else { // Do not resize, just create a copy of the original image. @copy( $this->source , $this->dest ); } usleep( 100000 ); clearstatcache(); if( false == is_file($this->dest) ) { $this->errors[] = "Unable to save destination: [{$this->dest}]."; } return $this; }// save() /** * Deletes the source image. * * Only if source is different from destination. * * @access public * @return $this */ public function clear() { if( false == empty($this->source) && false == empty($this->dest) && ( $this->source != $this->dest ) ) { @unlink( $this->source ); } return $this; } /** * Custom error handler. * * @param $errno * @param $errstr * @param $errfile * @param $errline * * @access public */ public function customErrorHandler( $errno , $errstr , $errfile , $errline ) { //TODO: } /** * Clear the resources. * * @access public */ public function __destruct() { imagedestroy( $this->dst_final ); imagedestroy( $this->dst_image ); imagedestroy( $this->dst_cropped ); } }
gpl-3.0
Altaxo/Altaxo
Altaxo/Base/Geometry/PolygonClosedD2D.cs
3699
#region Copyright ///////////////////////////////////////////////////////////////////////////// // Altaxo: a data processing and data plotting program // Copyright (C) 2002-2015 Dr. Dirk Lellinger // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // ///////////////////////////////////////////////////////////////////////////// #endregion Copyright #nullable enable using System; using System.Collections.Generic; using System.Linq; using System.Text; using Altaxo.Graph; namespace Altaxo.Geometry { /// <summary> /// Implementation of a closed polygon in 2D space. /// </summary> public class PolygonClosedD2D { protected PointD2D[] _points; protected HashSet<PointD2D> _sharpPoints; protected bool? _isHole; /// <summary> /// Gets or sets the parent of this polygon. /// </summary> /// <value> /// The parent. /// </value> public PolygonClosedD2D? Parent { get; set; } public PolygonClosedD2D(PointD2D[] points, HashSet<PointD2D> sharpPoints) { _points = points; _sharpPoints = sharpPoints; } public PolygonClosedD2D(PolygonClosedD2D template, double scale) { _points = template._points.Select(p => new PointD2D(p.X * scale, p.Y * scale)).ToArray(); _sharpPoints = new HashSet<PointD2D>(template._sharpPoints.Select(p => new PointD2D(p.X * scale, p.Y * scale))); } /// <summary> /// Constructs a new closed polygon from the provided points. It is assumed that no point is sharp. /// </summary> /// <param name="points">The points that construct the polygon.</param> /// <returns>The closed polygon.</returns> public static PolygonClosedD2D FromPoints(IEnumerable<PointD2D> points) { return new PolygonClosedD2D(points.ToArray(), new HashSet<PointD2D>()); } /// <summary> /// Gets the points that form the closed polygon. /// </summary> /// <value> /// The points. /// </value> public PointD2D[] Points { get { return _points; } } /// <summary> /// Gets the points of the polygon which are sharp points. Points of the polygon which are not in this set are considered to be soft points. /// </summary> /// <value> /// The sharp points. /// </value> public HashSet<PointD2D> SharpPoints { get { return _sharpPoints; } } /// <summary> /// Gets or sets a value indicating whether this polygon is a hole. In this case it belongs to another, outer, polygon. /// </summary> /// <value> /// <c>true</c> if this instance is a hole; otherwise, <c>false</c>. /// </value> /// <exception cref="System.NotImplementedException"></exception> public bool IsHole { get { if (!_isHole.HasValue) { throw new NotImplementedException(); //return PolygonHelper.GetPolygonArea(_points) > 0; } else { return _isHole.Value; } } set { _isHole = value; } } } }
gpl-3.0
webSPELL/webSPELL
guestbook.php
10219
<?php /* ########################################################################## # # # Version 4 / / / # # -----------__---/__---__------__----__---/---/- # # | /| / /___) / ) (_ ` / ) /___) / / # # _|/_|/__(___ _(___/_(__)___/___/_(___ _/___/___ # # Free Content / Management System # # / # # # # # # Copyright 2005-2011 by webspell.org # # # # visit webSPELL.org, webspell.info to get webSPELL for free # # - Script runs under the GNU GENERAL PUBLIC LICENSE # # - It's NOT allowed to remove this copyright-tag # # -- http://www.fsf.org/licensing/licenses/gpl.html # # # # Code based on WebSPELL Clanpackage (Michael Gruber - webspell.at), # # Far Development by Development Team - webspell.org # # # # visit webspell.org # # # ########################################################################## */ if(isset($_GET['action'])) $action = $_GET['action']; else $action=''; if(isset($_POST['save'])) { include("_mysql.php"); include("_settings.php"); include("_functions.php"); $_language->read_module('guestbook'); $date = time(); $run=0; if($userID) { $name = mysql_real_escape_string(getnickname($userID)); if(getemailhide($userID)) $email=''; else $email = getemail($userID); $url = gethomepage($userID); $icq = geticq($userID); $run = 1; } else { $name = $_POST['gbname']; $email = $_POST['gbemail']; $url = $_POST['gburl']; $icq = $_POST['icq']; $CAPCLASS = new Captcha; if($CAPCLASS->check_captcha($_POST['captcha'], $_POST['captcha_hash'])){ $run=1; } } if($run) { if(mb_strlen($_POST['message'])){ safe_query("INSERT INTO ".PREFIX."guestbook ( date, name, email, hp, icq, ip, comment ) VALUES ( '".$date."', '".$name."', '".$email."', '".$url."', '".$icq."', '".$GLOBALS['ip']."', '".$_POST['message']."' );"); if($gb_info) { $ergebnis=safe_query("SELECT userID FROM ".PREFIX."user_groups WHERE feedback='1'"); while($ds=mysql_fetch_array($ergebnis)) { $touser[]=$ds['userID']; } $message = str_replace('%insertid%', 'id_'.mysql_insert_id(), mysql_real_escape_string($_language->module['pmtext_newentry'])); foreach($touser as $id) { sendmessage($id,mysql_real_escape_string($_language->module['pmsubject_newentry']),$message); } } header("Location: index.php?site=guestbook"); } else { header("Location: index.php?site=guestbook&action=add&error=message"); } } else { header("Location: index.php?site=guestbook&action=add&error=captcha"); } } elseif(isset($_GET['delete'])) { include("_mysql.php"); include("_settings.php"); include("_functions.php"); $_language->read_module('guestbook'); if(!isfeedbackadmin($userID)) die($_language->module['no_access']); if(isset($_POST['gbID'])){ foreach($_POST['gbID'] as $id) { safe_query("DELETE FROM ".PREFIX."guestbook WHERE gbID='$id'"); } } header("Location: index.php?site=guestbook"); } elseif(isset($_POST['savecomment'])) { include("_mysql.php"); include("_settings.php"); include("_functions.php"); $_language->read_module('guestbook'); if(!isfeedbackadmin($userID)) die($_language->module['no_access']); safe_query("UPDATE ".PREFIX."guestbook SET admincomment='".$_POST['message']."' WHERE gbID='".$_POST['guestbookID']."' "); header("Location: index.php?site=guestbook"); } elseif($action == 'comment' AND is_numeric($_GET['guestbookID'])) { $_language->read_module('guestbook'); $_language->read_module('bbcode', true); if(!isfeedbackadmin($userID)) die($_language->module['no_access']); $ergebnis = safe_query("SELECT admincomment FROM ".PREFIX."guestbook WHERE gbID='".$_GET['guestbookID']."'"); $bg1 = BG_1; $ds = mysql_fetch_array($ergebnis); $admincomment = getinput($ds['admincomment']); eval ("\$title_guestbook = \"".gettemplate("title_guestbook")."\";"); echo $title_guestbook; eval ("\$addbbcode = \"".gettemplate("addbbcode")."\";"); eval ("\$guestbook_comment = \"".gettemplate("guestbook_comment")."\";"); echo $guestbook_comment; } elseif($action == 'add') { $_language->read_module('guestbook'); $_language->read_module('bbcode', true); $message=''; if(isset($_GET['messageID'])) { if(is_numeric($_GET['messageID'])) { $ds=mysql_fetch_array(safe_query("SELECT comment, name FROM `".PREFIX."guestbook` WHERE gbID='".$_GET['messageID']."'")); $message='[quote='.$ds['name'].']'.getinput($ds['comment']).'[/quote]'; } } eval ("\$addbbcode = \"".gettemplate("addbbcode")."\";"); $bg1 = BG_1; if(isset($_GET['error'])){ if($_GET['error'] == "captcha") $error = $_language->module['error_captcha']; else $error = $_language->module['enter_a_message']; } else{ $error = null; } if($loggedin) { eval ("\$guestbook_loggedin = \"".gettemplate("guestbook_loggedin")."\";"); echo $guestbook_loggedin; } else { $CAPCLASS = new Captcha; $captcha = $CAPCLASS->create_captcha(); $hash = $CAPCLASS->get_hash(); $CAPCLASS->clear_oldcaptcha(); eval ("\$guestbook_notloggedin = \"".gettemplate("guestbook_notloggedin")."\";"); echo $guestbook_notloggedin; } } else { $_language->read_module('guestbook'); eval ("\$title_guestbook = \"".gettemplate("title_guestbook")."\";"); echo $title_guestbook; $gesamt = mysql_num_rows(safe_query("SELECT gbID FROM ".PREFIX."guestbook")); if(isset($_GET['page'])) $page = (int)$_GET['page']; else $page = 1; $type="DESC"; if(isset($_GET['type'])){ if(($_GET['type']=='ASC') || ($_GET['type']=='DESC')) $type=$_GET['type']; } $pages=ceil($gesamt/$maxguestbook); if($pages>1) $page_link = makepagelink("index.php?site=guestbook&amp;type=$type", $page, $pages); else $page_link=''; if ($page == "1") { $ergebnis = safe_query("SELECT * FROM ".PREFIX."guestbook ORDER BY date $type LIMIT 0,$maxguestbook"); if($type=="DESC") $n=$gesamt; else $n=1; } else { $start=$page*$maxguestbook-$maxguestbook; $ergebnis = safe_query("SELECT * FROM ".PREFIX."guestbook ORDER BY date $type LIMIT $start,$maxguestbook"); if($type == "DESC") $n = $gesamt-($page-1)*$maxguestbook; else $n = ($page-1)*$maxguestbook+1; } if($type=="ASC") $sorter='<a href="index.php?site=guestbook&amp;page='.$page.'&amp;type=DESC">'.$_language->module['sort'].'</a> <img src="images/icons/asc.gif" width="9" height="7" border="0" alt="Sort DESC" />&nbsp;&nbsp;&nbsp;'; else $sorter='<a href="index.php?site=guestbook&amp;page='.$page.'&amp;type=ASC">'.$_language->module['sort'].'</a> <img src="images/icons/desc.gif" width="9" height="7" border="0" alt="Sort ASC" />&nbsp;&nbsp;&nbsp;'; eval ("\$guestbook_head = \"".gettemplate("guestbook_head")."\";"); echo $guestbook_head; while($ds = mysql_fetch_array($ergebnis)) { $n%2 ? $bg1=BG_1 : $bg1=BG_2; $date = date("d.m.Y - H:i", $ds['date']); if(validate_email($ds['email'])) $email = '<a href="mailto:'.mail_protect($ds['email']).'"><img src="images/icons/email.gif" border="0" width="15" height="11" alt="email" /></a>'; else $email=''; if(validate_url($ds['hp'])) $hp='<a href="'.$ds['hp'].'" target="_blank"><img src="images/icons/hp.gif" border="0" width="14" height="14" alt="homepage" /></a>'; else $hp=''; $sem = '/[0-9]{6,11}/si'; $icq_number = str_replace('-','',$ds['icq']); if(preg_match($sem, $ds['icq'])) $icq = '<a href="http://www.icq.com/people/about_me.php?uin='.$icq_number.'" target="_blank"><img src="http://online.mirabilis.com/scripts/online.dll?icq='.$ds['icq'].'&amp;img=5" border="0" alt="icq" /></a>'; else $icq=""; $guestbookID = 'id_'.$ds['gbID']; $name = strip_tags($ds['name']); $message = cleartext($ds['comment']); $message = toggle($message,$ds['gbID']); unset($admincomment); if($ds['admincomment'] != "") { $admincomment = '<hr /> <small><b>'.$_language->module['admin_comment'].':</b><br />'.cleartext($ds['admincomment']).'</small>'; } else $admincomment = ''; $actions=''; $ip='logged'; $quote='<a href="index.php?site=guestbook&amp;action=add&amp;messageID='.$ds['gbID'].'"><img src="images/icons/quote.gif" border="0" alt="quote" /></a>'; if(isfeedbackadmin($userID)) { $actions=' <a href="index.php?site=guestbook&amp;action=comment&amp;guestbookID='.$ds['gbID'].'"><img src="images/icons/admincomment.gif" border="0" alt="Admincomment" /></a> <input class="input" type="checkbox" name="gbID[]" value="'.$ds['gbID'].'" />'; $ip=$ds['ip']; } eval ("\$guestbook = \"".gettemplate("guestbook")."\";"); echo $guestbook; if($type=="DESC") $n--; else $n++; } if(isfeedbackadmin($userID)) $submit='<input class="input" type="checkbox" name="ALL" value="ALL" onclick="SelectAll(this.form);" /> '.$_language->module['select_all'].' <input type="submit" value="'.$_language->module['delete_selected'].'" />'; else $submit=''; eval ("\$guestbook_foot = \"".gettemplate("guestbook_foot")."\";"); echo $guestbook_foot; } ?>
gpl-3.0
OliverVoggenreiter/SuperBiclustering
SuperBiclustering/src/algorithms/bronkerbosch/RestrictedBronKerboschBipartiteV2.java
14618
/* SuperBiclustering - A biclustering algorithm designed to * handle sparse and noisy input. * Copyright (C) 2014 Oliver Voggenreiter * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program. If not, see * <http://www.gnu.org/licenses/>. */ package algorithms.bronkerbosch; import java.util.ArrayList; import java.util.BitSet; import java.util.List; import datatype.bicluster.Bicluster; import datatype.bicluster.BitSetBicluster; import datatype.matrix.BinaryMatrix; /** * Bron-Kerbosch algorithm V2 adapted for bipartite graphs. */ public class RestrictedBronKerboschBipartiteV2 implements BronKerboschBipartite { private static final BitSet EMPTY_BITSET = new BitSet(); // The number of rows and columns that are left in the // preprocessed 2D matrix protected int numRows; protected int numCols; // Preprocessed adjacency matrix protected BinaryMatrix inputMatrix; protected int minRows; // minimum nbr of rows in a bicluster protected int minCols; // minimum nbr of cols in a bicluster // if false, only the number of biclusters is kept. private boolean saveBiclusters = false; // Mapping of the indices from the reduced 2D matrix to the // initial 2D matrix protected int[] rowMapId; protected int[] colMapId; // The variable keeps track of the number of row(cols) nodes // currently in the set R protected int cntRowsInClique = 0; protected int cntColsInClique = 0; // The arrays grow dynamically and represent set R for rows and // respectively columns. private List<Integer> compsubRows = new ArrayList<Integer>(); private List<Integer> compsubCols = new ArrayList<Integer>(); protected List<Bicluster> biclusters = new ArrayList<Bicluster>(); protected long numBiclusters = 0; // total count of the number of // biclusters // maximal count of biclusters to report; actually a number // slightly smaller than maxBiclusters may be reported; // however the condition numBiclusters > maxBiclusters can be // used to determine that the algorithm was interrupted due to // the // maxBiclusters limit private long maxBiclusters; private int maxLevel; public RestrictedBronKerboschBipartiteV2(int maxLevel) { this.maxLevel = maxLevel; } @Override public List<Bicluster> findBiclusters( BinaryMatrix connectivityMatrix) { return findBiclusters(connectivityMatrix, EMPTY_BITSET, EMPTY_BITSET); } @Override public List<Bicluster> findBiclusters( BinaryMatrix connectivityMatrix, BitSet requiredRows, BitSet requiredCols) { boolean validInput = init(connectivityMatrix, requiredRows, requiredCols); if (validInput) { findMaxCliques(); } return biclusters; } private boolean init(BinaryMatrix connectivityMatrix, BitSet requiredRows, BitSet requiredCols) { if (connectivityMatrix == null) { throw new IllegalArgumentException( "connectivityMatrix must not be null"); } if (minRows <= 0 || minRows > connectivityMatrix.getNumRows()) { throw new IllegalArgumentException( "invalid minRows value"); } if (minCols <= 0 || minCols > connectivityMatrix.getNumColumns()) { throw new IllegalArgumentException( "invalid minCols value"); } this.rowMapId = new int[connectivityMatrix.getNumRows()]; this.colMapId = new int[connectivityMatrix.getNumColumns()]; biclusters = new ArrayList<Bicluster>(); numBiclusters = 0; this.inputMatrix = AdjacencyMatrixPreprocessor.reduce( connectivityMatrix, minRows, minCols, requiredRows, requiredCols, rowMapId, colMapId); if (inputMatrix != null) { numRows = inputMatrix.getNumRows(); numCols = inputMatrix.getNumColumns(); } return inputMatrix != null; } protected void findMaxCliques() { Nodes rowsData = new Nodes(NodeType.ROW, numRows); Nodes colsData = new Nodes(NodeType.COL, numCols); bkv2(rowsData, colsData, 0); } /** * Main recursive call of algorithm. Prerequisite: there are more * candidate nodes in rows or columns (not necessarily in both) */ private long bkv2(Nodes rowsData, Nodes colsData, int level) { // abort algorithm when maximal number of biclusters is // exceeded if (maxBiclusters > 0 && numBiclusters > maxBiclusters) { return 0; } long biclustersFound = 0; Pivot pivot = new Pivot(); // minDisconnections can not be greater than // MAXDISCONNECTIONS // In constructor: /* * bk.minDisconnections = MAXDISCONNECTIONS; // 30000 * bk.selectedNode = -1; bk.pivot = -1; bk.node = 0; * bk.selType = null; bk.pivotType = null; */ if (colsData.candidatesEnd > colsData.notEnd && rowsData.candidatesEnd > rowsData.notEnd) { // look if pivot can be row pivot.findPivot(rowsData, colsData, inputMatrix); // look if pivot can be column pivot.findPivot(colsData, rowsData, inputMatrix); } else if (colsData.candidatesEnd <= colsData.notEnd) { // if columns have no candidates, and rows have // candidates choose pivot from rows only pivot.findPivot(rowsData, colsData, inputMatrix); } else if (rowsData.candidatesEnd <= rowsData.notEnd) { pivot.findPivot(colsData, rowsData, inputMatrix); } int selectedNode = pivot.selectedNode; int node; if (pivot.pivotFromP == true) { if (pivot.selType.equals(NodeType.ROW)) { biclustersFound += extendSelection(rowsData, colsData, selectedNode, level + 1); } else { biclustersFound += extendSelection(colsData, rowsData, selectedNode, level + 1); } } if (pivot.pivotType.equals(NodeType.ROW)) { for (node = pivot.minDisconnections; node >= 1; node--) { for (selectedNode = colsData.notEnd; selectedNode < colsData.candidatesEnd && inputMatrix.get(pivot.pivot, colsData.nodes[selectedNode]); selectedNode++) { ; } biclustersFound += extendSelection(colsData, rowsData, selectedNode, level + 1); } } else { for (node = pivot.minDisconnections; node >= 1; node--) { for (selectedNode = rowsData.notEnd; selectedNode < rowsData.candidatesEnd && inputMatrix.get( rowsData.nodes[selectedNode], pivot.pivot); selectedNode++) { ; } biclustersFound += extendSelection(rowsData, colsData, selectedNode, level + 1); } } return biclustersFound; } /** * This method is called only if we still have elements in * setCheckDisconnections. Ouput: The method updates the * BKIndices structure which contains bk.minnod = minimum number * of disconnections bk.selectedNode = index of the selected * node; bk.pivot = index of the selected node; bk.node = 0 or 1; * The node is 0 if the pivot is from X, or 1 otherwise. */ protected void selectPivot(Nodes setPossiblePivots, Nodes setCheckDisconnections, Pivot pivot) { int count; int pos = 0; int p; boolean pivotIsRow = false; if (setPossiblePivots.nodeType.equals(NodeType.ROW)) { pivotIsRow = true; } // iterate over X u P in rows for (int i = 0; i < setPossiblePivots.candidatesEnd && pivot.minDisconnections != 0; i++) { p = setPossiblePivots.nodes[i]; count = 0; // find the disconections in P cols for (int j = setCheckDisconnections.notEnd; j < setCheckDisconnections.candidatesEnd && count < pivot.minDisconnections; j++) { // if it is a row if (pivotIsRow) { if (inputMatrix.get(p, setCheckDisconnections.nodes[j]) == false) { count++; pos = j; } } else { if (inputMatrix.get( setCheckDisconnections.nodes[j], p) == false) { count++; pos = j; } } } if (count < pivot.minDisconnections) { pivot.pivot = p; pivot.minDisconnections = count; pivot.pivotType = setPossiblePivots.nodeType; if (i < setPossiblePivots.notEnd) { pivot.selectedNode = pos; pivot.selType = setCheckDisconnections.nodeType; pivot.pivotFromP = false; } else { pivot.selectedNode = i; pivot.pivotFromP = true; pivot.selType = setPossiblePivots.nodeType; ; } } } } /** * The selected node is from the set selectedSet and it will be * added to the X set. The X,P sets are updated for both rows and * columns. */ protected long extendSelection(Nodes selectedSet, Nodes checkSet, int s, int level) { long biclustersFound = 0; int p = selectedSet.nodes[s]; selectedSet.nodes[s] = selectedSet.nodes[selectedSet.notEnd]; int sel = selectedSet.nodes[selectedSet.notEnd] = p; // update the new indices boolean selectionIsRow = false; if (selectedSet.nodeType.equals(NodeType.ROW)) selectionIsRow = true; int[] newCheck = new int[checkSet.candidatesEnd]; int newNotEndCheck = 0; int newCandidateEndCheck = 0; // Update X and P for the checkSet switch (selectedSet.nodeType) { case ROW: // intersect X with neighbors of the selected node for (int i = 0; i < checkSet.notEnd; i++) { if (inputMatrix.get(sel, checkSet.nodes[i])) newCheck[newNotEndCheck++] = checkSet.nodes[i]; } newCandidateEndCheck = newNotEndCheck; // intersect P with neighbors of the selected node for (int i = checkSet.notEnd; i < checkSet.candidatesEnd; i++) { if (inputMatrix.get(sel, checkSet.nodes[i])) newCheck[newCandidateEndCheck++] = checkSet.nodes[i]; } break; case COL: // similar as above, but for columns for (int i = 0; i < checkSet.notEnd; i++) { if (inputMatrix.get(checkSet.nodes[i], sel)) newCheck[newNotEndCheck++] = checkSet.nodes[i]; } newCandidateEndCheck = newNotEndCheck; for (int i = checkSet.notEnd; i < checkSet.candidatesEnd; i++) { if (inputMatrix.get(checkSet.nodes[i], sel)) newCheck[newCandidateEndCheck++] = checkSet.nodes[i]; } break; default: break; } int newNotEndSelected = selectedSet.notEnd; int newCandidateEndSelected = 0; if (selectedSet.candidatesEnd > 0) newCandidateEndSelected = selectedSet.candidatesEnd - 1; boolean hasOtherNodes = false; int totRows = -1; int totCols = -1; switch (selectedSet.nodeType) { case ROW: if (saveBiclusters) compsubRows.add(sel); cntRowsInClique++; hasOtherNodes = cntColsInClique > 0; totRows = newCandidateEndSelected - newNotEndSelected + cntRowsInClique; totCols = newCandidateEndCheck - newNotEndCheck + cntColsInClique; break; case COL: if (saveBiclusters) compsubCols.add(sel); cntColsInClique++; hasOtherNodes = cntRowsInClique > 0; totRows = newCandidateEndCheck - newNotEndCheck + cntRowsInClique; totCols = newCandidateEndSelected - newNotEndSelected + cntColsInClique; break; default: break; } if (totRows >= minRows && totCols >= minCols) { if (((level > maxLevel) || (newCandidateEndSelected == 0 && newCandidateEndCheck == 0) || (newCandidateEndSelected == 0 && newNotEndCheck == 0) || (newCandidateEndCheck == 0 && newNotEndSelected == 0))) { numBiclusters++; biclustersFound++; if (saveBiclusters) { Bicluster bc = new BitSetBicluster(); for (int i = 0; i < compsubRows.size(); ++i) bc.addRow(rowMapId[compsubRows.get(i)]); for (int i = 0; i < compsubCols.size(); ++i) bc.addColumn(colMapId[compsubCols.get(i)]); if (selectionIsRow) { // add all rows connected with the rest for (int i = newNotEndSelected + 1; i <= newCandidateEndSelected; ++i) { bc.addRow(rowMapId[selectedSet.nodes[i]]); } for (int i = newNotEndCheck; i < newCandidateEndCheck; ++i) { bc.addColumn(colMapId[newCheck[i]]); } } else { for (int i = newNotEndSelected + 1; i <= newCandidateEndSelected; ++i) { bc.addColumn(colMapId[selectedSet.nodes[i]]); } for (int i = newNotEndCheck; i < newCandidateEndCheck; ++i) { bc.addRow(rowMapId[newCheck[i]]); } } biclusters.add(bc); } } else { boolean hasCandidatesPivot = (newNotEndSelected < newCandidateEndSelected); boolean hasCandidatesCheck = (newNotEndCheck < newCandidateEndCheck); if ((hasCandidatesPivot && hasCandidatesCheck) || // we have candidates in rows and cols (hasCandidatesPivot && !hasCandidatesCheck && hasOtherNodes && newNotEndSelected == 0) || (hasCandidatesCheck && !hasCandidatesPivot && newNotEndCheck == 0)) { int[] newSelected = new int[selectedSet.candidatesEnd]; // Update X and P for the set which contains the // selected node. // The selected node is eliminated from X and P, // the rest of the elements are left unchanged. System.arraycopy(selectedSet.nodes, 0, newSelected, 0, selectedSet.notEnd); if (selectedSet.candidatesEnd != 0) { System.arraycopy(selectedSet.nodes, selectedSet.notEnd + 1, newSelected, selectedSet.notEnd, newCandidateEndSelected - newNotEndSelected); } Nodes newselected = new Nodes(selectedSet.nodeType, newSelected, newCandidateEndSelected, newNotEndSelected); Nodes newcheck = new Nodes(checkSet.nodeType, newCheck, newCandidateEndCheck, newNotEndCheck); if (selectedSet.nodeType.equals(NodeType.ROW)) { biclustersFound += bkv2(newselected, newcheck, level + 1); } else { biclustersFound += bkv2(newcheck, newselected, level + 1); } } } } switch (selectedSet.nodeType) { case ROW: if (saveBiclusters) compsubRows.remove(compsubRows.size() - 1); cntRowsInClique--; break; case COL: if (saveBiclusters) compsubCols.remove(compsubCols.size() - 1); cntColsInClique--; break; default: break; } selectedSet.notEnd++; return biclustersFound; } @Override public void setMinRows(int minRows) { this.minRows = minRows; } @Override public void setMinColumns(int minColumns) { this.minCols = minColumns; } @Override public void setMaxBiclusters(int maxBiclusters) { this.maxBiclusters = maxBiclusters; } }
gpl-3.0
semperfiwebdesign/simplemap
classes/ft-ps-client.php
27363
<?php /** * FullThrottle Premium Support Client * Curious? Send me an email and you can beta it for me (glenn@fullthrottledevelopment.com) */ if ( ! class_exists( 'FT_Premium_Support_Client' ) ) { class FT_Premium_Support_Client { var $server_url; var $product_id; var $plugin_support_page_ids; var $confirming_request; var $receiving_sso; var $learn_more_link; var $ps_status = false; var $sso_status = false; var $paypal_button = false; var $site_url; var $plugin_basename = false; var $plugin_slug = false; function __construct( $config = array() ) { // Constructor fires on admin page loads // Populate properties $this->server_url = isset( $config['server_url'] ) ? $config['server_url'] : false; $this->product_id = isset( $config['product_id'] ) ? $config['product_id'] : false; $this->plugin_support_page_ids = isset( $config['plugin_support_page_ids'] ) ? $config['plugin_support_page_ids'] : false; $this->plugin_basename = isset( $config['plugin_basename'] ) ? $config['plugin_basename'] : false; $this->plugin_slug = isset( $config['plugin_slug'] ) ? $config['plugin_slug'] : false; $this->learn_more_link = isset( $config['learn_more_link'] ) ? $config['learn_more_link'] : false; $this->confirming_request = isset( $_GET['ft-ps-confirm-request'] ) ? $_GET['ft-ps-confirm-request'] : false; $this->receiving_sso = isset( $_POST['ft-ps-receiving-sso'] ) ? $_POST['ft-ps-receiving-sso'] : false; $this->site_url = site_url(); // Register actions add_action( 'admin_head', array( &$this, 'init' ) ); add_action( 'init', array( &$this, 'check_premium_upgrades' ) ); } // Checks for premium upgrades function check_premium_upgrades() { // Build key $exp_option_key = '_ftpssu_' . md5( 'ftpssue-' . $this->product_id . '-' . sanitize_title_with_dashes( $this->site_url ) . '-' . sanitize_title_with_dashes( $this->server_url ) ); // Check server for auto update? if ( $expires = get_option( $exp_option_key ) ) { if ( $expires > strtotime( 'now' ) ) { $ft_ps_client_auto_update = new FT_Premium_Support_PluginUpdate_Checker( $this->server_url . '?ft-pss-upgrade-request=1&ft-pss-upgrade-request-product-id=' . $this->product_id . '&ft-pss-upgrade-request-site=' . $this->site_url . '&exp=' . $expires, $this->plugin_basename, $this->plugin_slug, 1 ); } else { delete_option( 'external_updates-' . $this->plugin_slug ); } } } // Inits the client if we're on the support page or receiving a request from the server function init() { global $current_screen; // Return false if we don't have initial config settings and this isn't a request from the host server if ( ( ! $this->server_url || ! $this->product_id || ! isset( $this->plugin_support_page_ids ) ) && ( ! $this->confirming_request || ! $this->receiving_sso ) ) { return; } // Fire in the hole! if ( $this->receiving_sso ) { $this->receive_sso(); } elseif ( $this->confirming_request ) { $this->confirm_request(); } elseif ( in_array( $current_screen->id, $this->plugin_support_page_ids ) ) { $this->init_premium_support(); } } // This function inits premium support process function init_premium_support() { global $current_user; wp_get_current_user(); // Check for premium support, sso, and paypal button transients $status_key = md5( 'ft_premium_support_' . $this->product_id . '_' . sanitize_title_with_dashes( $this->site_url ) . '_' . sanitize_title_with_dashes( $this->server_url ) ); $sso_key = md5( 'ft_premium_sso_' . $current_user->ID . '_' . $this->product_id . '_' . sanitize_title_with_dashes( $this->site_url ) . '_' . sanitize_title_with_dashes( $this->server_url ) ); $paypal_button_key = md5( 'ft_premium_signup_' . $this->product_id . '_' . sanitize_title_with_dashes( $this->site_url ) . '_' . sanitize_title_with_dashes( $this->server_url ) ); $exp_option_key = '_ftpssu_' . md5( 'ftpssue-' . $this->product_id . '-' . sanitize_title_with_dashes( $this->site_url ) . '-' . sanitize_title_with_dashes( $this->server_url ) ); // If we haven't set the status in the last 24 hours, or we haven't set a SSO for the current user in the last 3 hours, do it now. if ( false === ( $ps_status = get_transient( $status_key ) ) || false === ( $sso_status = get_transient( $sso_key ) ) ) { $body['ft-ps-status-request'] = true; $body['site'] = urlencode( $this->site_url ); $body['user'] = $current_user->ID; $body['product'] = $this->product_id; $body['email'] = urlencode( $current_user->user_email ); $body['nicename'] = urlencode( $current_user->user_nicename ); // Ping server for response if ( $request = wp_remote_post( $this->server_url, array( 'body' => $body, 'timeout' => 20 ) ) ) { if ( ! is_wp_error( $request ) && isset( $request['response']['code'] ) && 200 == $request['response']['code'] ) { // Response found a server, lets see if it hit a script we recognize $response = json_decode( $request['body'] ); // Set the paypal button if ( ! empty( $response->paypal_button->args ) && ! empty( $response->paypal_button->base ) ) { $this->paypal_button = add_query_arg( get_object_vars( $response->paypal_button->args ), $response->paypal_button->base ); } // Set the expired flag $this->support_expired = isset( $response->support_expired ) ? $response->support_expired : false; // Do we have a premium status? if ( isset( $response->support_status ) && $response->support_status ) { // We have a premium support license for this domain / product combination. Set the transient and property set_transient( $status_key, $response->support_status, 60 * 60 * 24 ); //set_transient( $status_key, $response->support_status, 60 ); $this->ps_status = $response->support_status; // Did we get a user sso back as well? Set the property if we did if ( isset( $response->user_sso ) && '' != $response->user_sso ) { set_transient( $sso_key, $response->user_sso, 60 * 60 * 2.9 ); //set_transient( $sso_key, $response->user_sso, 60 ); $this->sso_status = $response->user_sso; } // Set an auto update option with expiration date if ( isset( $response->support_status->exp_date ) && ! empty( $response->support_status->exp_date ) ) { update_option( $exp_option_key, $response->support_status->exp_date ); // Check server for auto update? if ( $this->ps_status ) { delete_option( 'external_updates-' . $this->plugin_slug ); $ft_ps_client_auto_update = new FT_Premium_Support_PluginUpdate_Checker( $this->server_url . '?ft-pss-premium-request=1&ft-pss-upgrade-request-product-id=' . $this->product_id . '&ft-pss-upgrade-request-site=' . $this->site_url . '&exp=' . $response->support_status->exp_date, SIMPLEMAP_PATH, $this->plugin_slug, 1 ); } } } else { // No premium support so lets delete the keys delete_option( 'external_updates-' . $this->plugin_slug ); delete_option( $exp_option_key ); } } } } else { // Transients exist, therefore permission exists, set properties $this->ps_status = $ps_status; $this->sso_status = $sso_status; } // Check server for auto update? if ( $this->ps_status ) { $ft_ps_client_auto_update = new FT_Premium_Support_PluginUpdate_Checker( $this->server_url . '?ft-pss-upgrade-request=1&ft-pss-upgrade-request-product-id=' . $this->product_id . '&ft-pss-upgrade-request-site=' . $this->site_url, $this->plugin_basename, 'simplemap', 1 ); } // Maybe Nag Renewal $this->maybe_trigger_renewal_nag(); } function maybe_trigger_renewal_nag() { // Has support expired? if ( ! empty( $this->support_expired ) && ! is_object( $this->support_expired ) ) { //add_action( 'admin_notices', array( $this, 'support_expired' ) ); return; } if ( ! empty( $this->ps_status->exp_date ) ) { $onemonthout = $this->ps_status->exp_date - 2628000; // If we are within a month of expiration date if ( $onemonthout <= strtotime( 'now' ) ) { //add_action( 'admin_notices', array( $this, 'renew_soon' ) ); } } } function support_expired() { $link = $this->paypal_button ? esc_url( $this->paypal_button ) : 'http://simplemap-plugin.com'; echo "<div class='update-nag'>" . sprintf( __( "<strong style='color:red;'>Your license for SimpleMap has expired!</strong><br />You need to renew your license now for continued support and upgrades: <a href='%s' target='_blank'>Renew my license now</a>." ), $link ) . '</div>'; } function renew_soon() { $link = $this->paypal_button ? esc_url( $this->paypal_button ) : 'http://simplemap-plugin.com'; echo "<div class='update-nag'>" . sprintf( __( "<strong style='color:red;'>SimpleMap is expiring soon!</strong><br />You will need to renew your license for continued support and upgrades: <a href='%s' target='_blank'>Renew my license now</a>." ), $link ) . '</div>'; } } } if ( ! class_exists( 'FT_Premium_Support_PluginUpdate_Checker' ) ) : /** * A custom plugin update checker. * * @author Janis Elsts * @copyright 2010 * @version 1.0 * @access public */ class FT_Premium_Support_PluginUpdate_Checker { var $metadataUrl = ''; //The URL of the plugin's metadata file. var $pluginFile = ''; //Plugin filename relative to the plugins directory. var $slug = ''; //Plugin slug. var $checkPeriod = 12; //How often to check for updates (in hours). var $optionName = ''; //Where to store the update info. /** * Class constructor. * * @param string $metadataUrl The URL of the plugin's metadata file. * @param string $pluginFile Fully qualified path to the main plugin file. * @param string $slug The plugin's 'slug'. If not specified, the filename part of $pluginFile sans '.php' will be used as the slug. * @param integer $checkPeriod How often to check for updates (in hours). Defaults to checking every 12 hours. Set to 0 to disable automatic update checks. * @param string $optionName Where to store book-keeping info about update checks. Defaults to 'external_updates-$slug'. * * @return void */ function __construct( $metadataUrl, $pluginFile, $slug = '', $checkPeriod = 12, $optionName = '' ) { $this->metadataUrl = $metadataUrl; $this->pluginFile = $pluginFile; $this->checkPeriod = $checkPeriod; $this->slug = $slug; //If no slug is specified, use the name of the main plugin file as the slug. //For example, 'my-cool-plugin/cool-plugin.php' becomes 'cool-plugin'. if ( empty( $this->slug ) ) { $this->slug = basename( $this->pluginFile, '.php' ); } if ( empty( $this->optionName ) ) { $this->optionName = 'external_updates-' . $this->slug; } if ( '' == $optionName ) { $this->optionName = 'external_updates-' . $this->slug; } else { $this->optionName = $optionName; } $this->installHooks(); } /** * Install the hooks required to run periodic update checks and inject update info * into WP data structures. * * @return void */ function installHooks() { //Override requests for plugin information add_filter( 'plugins_api', array( &$this, 'injectInfo' ), 10, 3 ); //Insert our update info into the update array maintained by WP add_filter( 'site_transient_update_plugins', array( &$this, 'injectUpdate' ) ); //WP 3.0+ add_filter( 'transient_update_plugins', array( &$this, 'injectUpdate' ) ); //WP 2.8+ //Set up the periodic update checks $cronHook = 'check_plugin_updates-' . $this->slug; if ( $this->checkPeriod > 0 ) { //Trigger the check via Cron add_filter( 'cron_schedules', array( &$this, '_addCustomSchedule' ) ); if ( ! defined( 'WP_INSTALLING' ) && ! wp_next_scheduled( $cronHook ) ) { $scheduleName = 'every' . $this->checkPeriod . 'hours'; wp_schedule_event( time(), $scheduleName, $cronHook ); } add_action( $cronHook, array( &$this, 'checkForUpdates' ) ); //In case Cron is disabled or unreliable, we also manually trigger //the periodic checks while the user is browsing the Dashboard. add_action( 'admin_init', array( &$this, 'maybeCheckForUpdates' ) ); } else { //Periodic checks are disabled. wp_clear_scheduled_hook( $cronHook ); } } /** * Add our custom schedule to the array of Cron schedules used by WP. * * @param array $schedules * * @return array */ function _addCustomSchedule( $schedules ) { if ( $this->checkPeriod && ( $this->checkPeriod > 0 ) ) { $scheduleName = 'every' . $this->checkPeriod . 'hours'; $schedules[ $scheduleName ] = array( 'interval' => $this->checkPeriod * 3600, 'display' => sprintf( 'Every %d hours', $this->checkPeriod ), ); } return $schedules; } /** * Retrieve plugin info from the configured API endpoint. * * @uses wp_remote_get() * * @param array $queryArgs Additional query arguments to append to the request. Optional. * * @return PluginInfo */ function requestInfo( $queryArgs = array() ) { //Query args to append to the URL. Plugins can add their own by using a filter callback (see addQueryArgFilter()). $queryArgs['installed_version'] = $this->getInstalledVersion(); $queryArgs = apply_filters( 'puc_request_info_query_args-' . $this->slug, $queryArgs ); //Various options for the wp_remote_get() call. Plugins can filter these, too. $options = array( 'timeout' => 10, //seconds 'headers' => array( 'Accept' => 'application/json', ), ); $options = apply_filters( 'puc_request_info_options-' . $this->slug, $options ); //The plugin info should be at 'http://your-api.com/url/here/$slug/info.json' $url = $this->metadataUrl; if ( ! empty( $queryArgs ) ) { $url = add_query_arg( $queryArgs, $url ); } $result = wp_remote_get( $url, $options ); //Try to parse the response $ft_premium_support_plugin_info = null; if ( ! is_wp_error( $result ) && isset( $result['response']['code'] ) && ( $result['response']['code'] == 200 ) && ! empty( $result['body'] ) ) { $ft_premium_support_plugin_info = FT_Premium_Support_PluginInfo::fromJson( $result['body'] ); } $ft_premium_support_plugin_info = apply_filters( 'puc_request_info_result-' . $this->slug, $ft_premium_support_plugin_info, $result ); return $ft_premium_support_plugin_info; } /** * Retrieve the latest update (if any) from the configured API endpoint. * * @uses PluginUpdateChecker::requestInfo() * * @return PluginUpdate An instance of PluginUpdate, or NULL when no updates are available. */ function requestUpdate() { //For the sake of simplicity, this function just calls requestInfo() //and transforms the result accordingly. $ft_premium_support_plugin_info = $this->requestInfo( array( 'checking_for_updates' => '1' ) ); if ( $ft_premium_support_plugin_info == null ) { return null; } return FT_Premium_Support_PluginUpdate::fromPluginInfo( $ft_premium_support_plugin_info ); } /** * Get the currently installed version of the plugin. * * @return string Version number. */ function getInstalledVersion() { if ( ! function_exists( 'get_plugins' ) ) { require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); } $allPlugins = get_plugins(); if ( array_key_exists( $this->pluginFile, $allPlugins ) && array_key_exists( 'Version', $allPlugins[ $this->pluginFile ] ) ) { return $allPlugins[ $this->pluginFile ]['Version']; } else { return ''; } //This should never happen. } /** * Check for plugin updates. * The results are stored in the DB option specified in $optionName. * * @return void */ function checkForUpdates() { $state = get_option( $this->optionName ); if ( empty( $state ) ) { $state = new stdClass; $state->lastCheck = 0; $state->checkedVersion = ''; $state->update = null; } $state->lastCheck = time(); $state->checkedVersion = $this->getInstalledVersion(); update_option( $this->optionName, $state ); //Save before checking in case something goes wrong $state->update = $this->requestUpdate(); update_option( $this->optionName, $state ); } /** * Check for updates only if the configured check interval has already elapsed. * * @return void */ function maybeCheckForUpdates() { if ( empty( $this->checkPeriod ) ) { return; } $state = get_option( $this->optionName ); $shouldCheck = empty( $state ) || ! isset( $state->lastCheck ) || ( ( time() - $state->lastCheck ) >= $this->checkPeriod * 3600 ); if ( $shouldCheck ) { $this->checkForUpdates(); } } /** * Intercept plugins_api() calls that request information about our plugin and * use the configured API endpoint to satisfy them. * * @see plugins_api() * * @param mixed $result * @param string $action * @param array|object $args * * @return mixed */ function injectInfo( $result, $action = null, $args = null ) { $relevant = ( $action == 'plugin_information' ) && isset( $args->slug ) && ( $args->slug == $this->slug ); if ( ! $relevant ) { return $result; } $ft_premium_support_plugin_info = $this->requestInfo(); if ( $ft_premium_support_plugin_info ) { return $ft_premium_support_plugin_info->toWpFormat(); } return $result; } /** * Insert the latest update (if any) into the update list maintained by WP. * * @param array $updates Update list. * * @return array Modified update list. */ function injectUpdate( $updates ) { $state = get_option( $this->optionName ); //Is there an update to insert? if ( ! empty( $state ) && isset( $state->update ) && ! empty( $state->update ) ) { //Only insert updates that are actually newer than the currently installed version. if ( version_compare( $state->update->version, $this->getInstalledVersion(), '>' ) ) { $updates->response[ $this->pluginFile ] = $state->update->toWpFormat(); } } return $updates; } /** * Register a callback for filtering query arguments. * * The callback function should take one argument - an associative array of query arguments. * It should return a modified array of query arguments. * * @uses add_filter() This method is a convenience wrapper for add_filter(). * * @param callback $callback * * @return void */ function addQueryArgFilter( $callback ) { add_filter( 'puc_request_info_query_args-' . $this->slug, $callback ); } /** * Register a callback for filtering arguments passed to wp_remote_get(). * * The callback function should take one argument - an associative array of arguments - * and return a modified array or arguments. See the WP documentation on wp_remote_get() * for details on what arguments are available and how they work. * * @uses add_filter() This method is a convenience wrapper for add_filter(). * * @param callback $callback * * @return void */ function addHttpRequestArgFilter( $callback ) { add_filter( 'puc_request_info_options-' . $this->slug, $callback ); } /** * Register a callback for filtering the plugin info retrieved from the external API. * * The callback function should take two arguments. If the plugin info was retrieved * successfully, the first argument passed will be an instance of PluginInfo. Otherwise, * it will be NULL. The second argument will be the corresponding return value of * wp_remote_get (see WP docs for details). * * The callback function should return a new or modified instance of PluginInfo or NULL. * * @uses add_filter() This method is a convenience wrapper for add_filter(). * * @param callback $callback * * @return void */ function addResultFilter( $callback ) { add_filter( 'puc_request_info_result-' . $this->slug, $callback, 10, 2 ); } } endif; if ( ! class_exists( 'FT_Premium_Support_PluginInfo' ) ) : /** * A container class for holding and transforming various plugin metadata. * * @author Janis Elsts * @copyright 2010 * @version 1.0 * @access public */ class FT_Premium_Support_PluginInfo { //Most fields map directly to the contents of the plugin's info.json file. //See the relevant docs for a description of their meaning. var $name; var $slug; var $version; var $homepage; var $sections; var $download_url; var $author; var $author_homepage; var $requires; var $tested; var $upgrade_notice; var $rating; var $num_ratings; var $downloaded; var $last_updated; var $id = 0; //The native WP.org API returns numeric plugin IDs, but they're not used for anything. /** * Create a new instance of PluginInfo from JSON-encoded plugin info * returned by an external update API. * * @param string $json Valid JSON string representing plugin info. * * @return PluginInfo New instance of PluginInfo, or NULL on error. */ function fromJson( $json ) { $apiResponse = json_decode( $json ); if ( empty( $apiResponse ) || ! is_object( $apiResponse ) ) { return null; } //Very, very basic validation. $valid = isset( $apiResponse->name ) && ! empty( $apiResponse->name ) && isset( $apiResponse->version ) && ! empty( $apiResponse->version ); if ( ! $valid ) { return null; } $info = new FT_Premium_Support_PluginInfo(); foreach ( get_object_vars( $apiResponse ) as $key => $value ) { $info->$key = $value; } return $info; } /** * Transform plugin info into the format used by the native WordPress.org API * * @return object */ function toWpFormat() { $info = new stdClass; //The custom update API is built so that many fields have the same name and format //as those returned by the native WordPress.org API. These can be assigned directly. $sameFormat = array( 'name', 'slug', 'version', 'requires', 'tested', 'rating', 'upgrade_notice', 'num_ratings', 'downloaded', 'homepage', 'last_updated', ); foreach ( $sameFormat as $field ) { if ( isset( $this->$field ) ) { $info->$field = $this->$field; } } //Other fields need to be renamed and/or transformed. $info->download_link = $this->download_url; if ( ! empty( $this->author_homepage ) ) { $info->author = sprintf( '<a href="%s">%s</a>', $this->author_homepage, $this->author ); } else { $info->author = $this->author; } if ( is_object( $this->sections ) ) { $info->sections = get_object_vars( $this->sections ); } elseif ( is_array( $this->sections ) ) { $info->sections = $this->sections; } else { $info->sections = array( 'description' => '' ); } return $info; } } endif; if ( ! class_exists( 'FT_Premium_Support_PluginUpdate' ) ): /** * A simple container class for holding information about an available update. * * @author Janis Elsts * @copyright 2010 * @version 1.0 * @access public */ class FT_Premium_Support_PluginUpdate { var $id = 0; var $slug; var $version; var $homepage; var $download_url; var $upgrade_notice; /** * Create a new instance of PluginUpdate from its JSON-encoded representation. * * @param string $json * * @return PluginUpdate */ function fromJson( $json ) { //Since update-related information is simply a subset of the full plugin info, //we can parse the update JSON as if it was a plugin info string, then copy over //the parts that we care about. $ft_premium_support_plugin_info = FT_Premium_Support_PluginInfo::fromJson( $json ); if ( $ft_premium_support_plugin_info != null ) { return FT_Premium_Support_PluginUpdate::fromPluginInfo( $ft_premium_support_plugin_info ); } else { return null; } } /** * Create a new instance of PluginUpdate based on an instance of PluginInfo. * Basically, this just copies a subset of fields from one object to another. * * @param PluginInfo $info * * @return PluginUpdate */ function fromPluginInfo( $info ) { $update = new FT_Premium_Support_PluginUpdate(); $copyFields = array( 'id', 'slug', 'version', 'homepage', 'download_url', 'upgrade_notice' ); foreach ( $copyFields as $field ) { $update->$field = $info->$field; } return $update; } /** * Transform the update into the format used by WordPress native plugin API. * * @return object */ function toWpFormat() { $update = new stdClass; $update->id = $this->id; $update->slug = $this->slug; $update->new_version = $this->version; $update->url = $this->homepage; $update->package = $this->download_url; if ( ! empty( $this->upgrade_notice ) ) { $update->upgrade_notice = $this->upgrade_notice; } return $update; } } endif; /** * Checks for premium support */ function url_has_ftps_for_item( &$ps_object ) { if ( is_object( $ps_object ) && $ps_object->ps_status ) { return true; } return false; } /** * Return paypal button */ function get_ftps_paypal_button( &$ps_object ) { if ( is_object( $ps_object ) && isset( $ps_object->paypal_button ) ) { return $ps_object->paypal_button; } return false; } /** * Return learn more link */ function get_ftps_learn_more_link( &$ps_object ) { if ( is_object( $ps_object ) && isset( $ps_object->learn_more_link ) ) { return $ps_object->learn_more_link; } return false; } /** * Return SSO key */ function get_ftps_sso_key( &$ps_object ) { if ( is_object( $ps_object ) && isset( $ps_object->sso_status ) ) { return $ps_object->sso_status; } return false; } /** * Return this site URL that has premium support */ function get_ftps_site( &$ps_object ) { if ( is_object( $ps_object ) && isset( $ps_object->ps_status->site ) ) { return $ps_object->ps_status->site; } return false; } /** * Return purchase date */ function get_ftps_purchase_date( &$ps_object ) { if ( is_object( $ps_object ) && isset( $ps_object->ps_status->purchase_date ) ) { return $ps_object->ps_status->purchase_date; } return false; } /** * Return expiration date */ function get_ftps_exp_date( &$ps_object ) { if ( is_object( $ps_object ) && isset( $ps_object->ps_status->exp_date ) ) { return $ps_object->ps_status->exp_date; } return false; } /** * Return email of person who purchased premium support */ function get_ftps_email( &$ps_object ) { if ( is_object( $ps_object ) && isset( $ps_object->ps_status->email ) ) { return $ps_object->ps_status->email; } return false; } /** * Return name of person who purchased premium support */ function get_ftps_name( &$ps_object ) { if ( is_object( $ps_object ) && isset( $ps_object->ps_status->name ) ) { return $ps_object->ps_status->name; } return false; }
gpl-3.0
Propheis/diasim
src/csli/util/nlp/VerbNetHandler.java
1690
/******************************************************************************* * Copyright (c) 2004, 2005 The Board of Trustees of Stanford University. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU General Public License * which is available at http://www.gnu.org/licenses/gpl.txt. *******************************************************************************/ package csli.util.nlp; import java.io.File; import org.apache.xerces.parsers.DOMParser; import verbnet.API.VNclass; import verbnet.API.VNframes; import verbnet.API.VNmembers; import verbnet.API.VerbNet; public class VerbNetHandler { public static void main(String[] argv) { // Initialize the static VerbNet object with the path to the verbnet // files and with the parser it should use. VerbNet.setPath(new File("c:\\verbnet\\v1.5")); VerbNet.setParser(new DOMParser()); VNclass[] vnclasses = VerbNet.getAllVNclasses(); for (int i = 0; i < vnclasses.length; i++) { VNclass vnclass = vnclasses[i]; VNmembers members = vnclass.getMembers(); System.out.println(vnclass.getID() + " has " + members.size() + " members: "); for (int j = 0; j < members.size(); j++) { System.out.println(" " + members.get(j).toString()); } VNframes frames = vnclass.getFrames(); System.out.println(" and " + frames.size() + " frames: "); for (int j = 0; j < frames.size(); j++) { System.out.println(" " + frames.get(j).toString()); } } } }
gpl-3.0
rhz/conan
contrib/aracne/Matrix.cpp
7387
// // // Copyright (C) 2003 Columbia Genome Center // All Rights Reserved. // // Matrix.cc -- Create a matrix. // vi: set ts=4 // // $Id: Matrix.cpp,v 1.2 2005/10/04 18:24:12 kw2110 Exp $ // #include <fstream> #include <iostream> #include <sstream> #include <string> #include <vector> #include <cstdlib> #include <algorithm> #include "Matrix.h" #ifdef __BCPLUSPLUS__ // For Borland Compiler #include <stlport/hash_map> using namespace std; #else #ifdef __GNUC__ // For GNU gcc compiler #if __GNUC__ < 3 #include <hash_map.h> #define HASH_MAP hash_map using namespace std; #elif __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 #include <unordered_map> #define HASH_MAP unordered_map #else #include <ext/hash_map> #define HASH_MAP hash_map #if __GNUC_MINOR__ == 0 using namespace std; // GCC 3.0 #else using namespace __gnu_cxx; // GCC 3.1 and later #endif #endif #endif #endif namespace aracne { using namespace std; typedef HASH_MAP< int, Node >::const_iterator const_line_iterator; // // reads an adjacency matrix from an input stream // void Matrix::read(Microarray_Set & data, Parameter & p) throw(std::runtime_error) { ifstream in(p.adjfile.c_str()); if(!in.good()) { cerr << "Bad File!" << endl; throw(std::runtime_error("Problem with reading the file: "+p.adjfile+".")); } read(in, data, p); } void Matrix::read(std::istream& in, Microarray_Set & data, Parameter & p) throw(std::runtime_error) { string line; string label; string value; getline( in, line ); // by pass the lines starting with ">" while (strncmp(line.c_str(), ">", 1) == 0) { getline(in, line); } while ( in.good() ) { istringstream sin( line ); getline( sin, label, '\t' ); int geneId1 = data.getProbeId( label ); if (geneId1 == -1) { throw(runtime_error("Cannot find marker: "+label+" in the ADJ file!")); } data.Get_Marker( geneId1 ).Enable(); // Add enough entries to the vector of hashes to store data for geneId1 while ( int(size()) <= geneId1 ) push_back( HASH_MAP < int, Node > () ); getline( sin, label, '\t' ); while ( sin.good() ) { getline( sin, value, '\t' ); double mi = atof( value.c_str() ); if ( mi >= p.threshold ) { int geneId2 = data.getProbeId( label ); if (geneId2 == -1) { throw(runtime_error("Cannot find marker: "+label+" in the ADJ file!")); } // Add enough entries to the vector of hashes to store data for geneId2 while ( int(size()) <= geneId2 ) { push_back( HASH_MAP < int, Node > () ); } Node & n = ( * this ) [geneId1] [geneId2]; n.Set_Mutualinfo( mi ); } getline( sin, label, '\t' ); } getline( in, line ); } } bool Matrix::hasNode( int i, int j ) { size_t ii = max( i, j ); size_t jj = min( i, j ); if ( ii == jj ) return ( false ); if ( size() <= ii ) return ( false ); HASH_MAP < int, Node > & m = ( * this ) [i]; if ( m.find( j ) == m.end() ) return ( false ); return ( true ); } void Matrix::write( Microarray_Set & data, vector < int > ids, Parameter & p, bool writeFull ) { if ( writeFull ) { std::fstream output( p.outfile.c_str(), std::ios::out ); cout << "Writing matrix: " << p.outfile << endl; output << "> Input file " << p.infile << endl; output << "> ADJ file " << p.adjfile << endl; output << "> Output file " << p.outfile << endl; output << "> Algorithm " << p.algorithm << endl; output << "> Kernel width " << p.sigma << endl; output << "> No. bins " << p.miSteps << endl; output << "> MI threshold " << p.threshold << endl; output << "> MI P-value " << p.pvalue << endl; output << "> DPI tolerance " << p.eps << endl; output << "> Correction " << p.correction << endl; output << "> Subnetwork file " << p.subnetfile << endl; output << "> Hub probe " << p.hub << endl; output << "> Control probe " << p.controlId << endl; output << "> Condition " << p.condition << endl; output << "> Percentage " << p.percent << endl; output << "> TF annotation " << p.annotfile << endl; output << "> Filter mean " << p.mean << endl; output << "> Filter CV " << p.cv << endl; write( output, data, ids ); output.flush(); output.close(); } } // // writes an adjacency matrix to an output stream. The format is // void Matrix::write( ostream & out, Microarray_Set & data, vector < int > ids ) { if (ids.empty()) { for ( size_t i = 0; i < size(); i++ ) { writeGeneLine( out, data, i ); } out.flush(); } else { for ( size_t i = 0; i < ids.size(); i++ ) { writeGeneLine( out, data, ids[i] ); } } } // // Write a line in the matrix to an output file. // void Matrix::writeGeneLine( ostream & out, Microarray_Set & data, int Id ) { HASH_MAP < int, Node > & m = ( * this ) [Id]; Marker & marker = data.Get_Marker( Id ); const string & label = marker.Get_Accnum(); if ( ( m.size() == 0 ) && ( !writeEmptyGenes || ( !marker.Enabled() && !marker.Is_Control() ) ) ) return; out << label; vector < int > sorted_keys; for ( const_line_iterator it = m.begin(); it != m.end(); ++it ) { sorted_keys.push_back( it->first ); } sort( sorted_keys.begin(), sorted_keys.end() ); vector < int >::const_iterator viter; for ( viter = sorted_keys.begin(); viter != sorted_keys.end(); ++viter ) { int Gene_Id = * viter; const Node & node = m[* viter]; if ( writeTriangular && Gene_Id <= Id ) continue; Marker & m = data.Get_Marker(Gene_Id); const string & affyid = m.Get_Accnum(); if ( writeReduced ) { out << '\t' << affyid; if ( node.Get_Intermediate() >= 0 ) cout << '.' << node.Get_Intermediate(); out << '\t' << node.Get_Mutualinfo(); } else { if ( node.Get_Intermediate() >= 0 ) continue; double mi = node.Get_Mutualinfo(); out << '\t' << affyid << "\t" << mi; } } out << endl; } void Matrix::writeGeneList( Microarray_Set & data, std::string name, int probeId ) { std::string filename = name + ".adj"; std::fstream output( filename.c_str(), std::ios::out ); cout << "Writing gene list: "<< filename << endl; HASH_MAP < int, Node > & m = ( * this ) [probeId]; Marker & marker = data.Get_Marker( probeId ); if ( ( m.size() == 0 ) && ( !writeEmptyGenes || ( !marker.Enabled() && !marker.Is_Control() ) ) ) { return; } HASH_MAP < int, Node >::const_iterator it = m.begin(); while ( it != m.end() ) { Node const & n = it->second; int j = it->first; if ( j != probeId ) { output << j << "\t" << data.Get_Marker( j ).Get_Accnum() << "\t" << n.Get_Mutualinfo() << endl; } it++; } output.flush(); output.close(); } } // aracne
gpl-3.0
projectestac/alexandria
html/langpacks/ru/datafield_poodll.php
1817
<?php // This file is part of Moodle - https://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <https://www.gnu.org/licenses/>. /** * Strings for component 'datafield_poodll', language 'ru', version '3.11'. * * @package datafield_poodll * @category string * @copyright 1999 Martin Dougiamas and contributors * @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); $string['backimageurl'] = 'Адрес (URL) фонового изображения электронной доски'; $string['backimageurl_desc'] = 'Не обязательно. Оставьте пустым, если настройка не требуется.'; $string['clicktoplay'] = 'Нажмите для проигрывания'; $string['fieldtypelabel'] = 'PoodLL'; $string['maxbytes'] = 'Наибольший размер внедряемого файла (байт)'; $string['maxbytes_desc'] = 'Если установлено значение 0, то, по умолчанию, размер не будет ограничен'; $string['namepoodll'] = 'PoodLL'; $string['pluginname'] = 'PoodLL'; $string['poodll'] = 'PoodLL'; $string['responsetype'] = 'Виджет PoodLL (тип ответа)';
gpl-3.0