/** * Contains Translation_Entry class * * @version $Id: entry.php 718 2012-10-31 00:32:02Z nbachiyski $ * @package pomo * @subpackage entry */ if ( !class_exists( 'Translation_Entry' ) ): /** * Translation_Entry class encapsulates a translatable string */ class Translation_Entry { /** * Whether the entry contains a string and its plural form, default is false * * @var boolean */ var $is_plural = false; var $context = null; var $singular = null; var $plural = null; var $translations = array(); var $translator_comments = ''; var $extracted_comments = ''; var $references = array(); var $flags = array(); /** * @param array $args associative array, support following keys: * - singular (string) -- the string to translate, if omitted and empty entry will be created * - plural (string) -- the plural form of the string, setting this will set {@link $is_plural} to true * - translations (array) -- translations of the string and possibly -- its plural forms * - context (string) -- a string differentiating two equal strings used in different contexts * - translator_comments (string) -- comments left by translators * - extracted_comments (string) -- comments left by developers * - references (array) -- places in the code this strings is used, in relative_to_root_path/file.php:linenum form * - flags (array) -- flags like php-format */ function __construct( $args = array() ) { // if no singular -- empty object if (!isset($args['singular'])) { return; } // get member variable values from args hash foreach ($args as $varname => $value) { $this->$varname = $value; } if (isset($args['plural'])) $this->is_plural = true; if (!is_array($this->translations)) $this->translations = array(); if (!is_array($this->references)) $this->references = array(); if (!is_array($this->flags)) $this->flags = array(); } /** * PHP4 constructor. */ public function Translation_Entry( $args = array() ) { self::__construct( $args ); } /** * Generates a unique key for this entry * * @return string|bool the key or false if the entry is empty */ function key() { if (is_null($this->singular)) return false; // prepend context and EOT, like in MO files return is_null($this->context)? $this->singular : $this->context.chr(4).$this->singular; } /** * @param object $other */ function merge_with(&$other) { $this->flags = array_unique( array_merge( $this->flags, $other->flags ) ); $this->references = array_unique( array_merge( $this->references, $other->references ) ); if ( $this->extracted_comments != $other->extracted_comments ) { $this->extracted_comments .= $other->extracted_comments; } } } endif; * Defines the necessary constants and includes the necessary files for Thesis’ operation. * * Many WordPress customization tutorials suggest editing a theme’s functions.php file. With * Thesis, you should edit the included custom/custom_functions.php file if you wish * to make modifications. * * @package Thesis */ // Define directory constants define('THESIS_LIB', TEMPLATEPATH . '/lib'); define('THESIS_ADMIN', THESIS_LIB . '/admin'); define('THESIS_CLASSES', THESIS_LIB . '/classes'); define('THESIS_FUNCTIONS', THESIS_LIB . '/functions'); define('THESIS_CSS', THESIS_LIB . '/css'); define('THESIS_HTML', THESIS_LIB . '/html'); define('THESIS_SCRIPTS', THESIS_LIB . '/scripts'); define('THESIS_IMAGES', THESIS_LIB . '/images'); define('THESIS_CUSTOM', STYLESHEETPATH . '/custom'); // Define folder constants define('THESIS_CSS_FOLDER', get_bloginfo('template_url') . '/lib/css'); #wp define('THESIS_SCRIPTS_FOLDER', get_bloginfo('template_url') . '/lib/scripts'); #wp define('THESIS_IMAGES_FOLDER', get_bloginfo('template_url') . '/lib/images'); #wp if (file_exists(THESIS_CUSTOM)) { define('THESIS_CUSTOM_FOLDER', get_bloginfo('stylesheet_directory') . '/custom'); #wp define('THESIS_LAYOUT_CSS', THESIS_CUSTOM . '/layout.css'); define('THESIS_ROTATOR', THESIS_CUSTOM . '/rotator'); define('THESIS_ROTATOR_FOLDER', THESIS_CUSTOM_FOLDER . '/rotator'); } elseif (file_exists(TEMPLATEPATH . '/custom-sample')) { define('THESIS_SAMPLE_FOLDER', get_bloginfo('stylesheet_directory') . '/custom-sample'); #wp define('THESIS_LAYOUT_CSS', TEMPLATEPATH . '/custom-sample/layout.css'); define('THESIS_ROTATOR', TEMPLATEPATH . '/custom-sample/rotator'); define('THESIS_ROTATOR_FOLDER', THESIS_SAMPLE_FOLDER . '/rotator'); } // Load classes require_once(THESIS_CLASSES . '/comments.php'); require_once(THESIS_CLASSES . '/css.php'); require_once(THESIS_CLASSES . '/data.php'); require_once(THESIS_CLASSES . '/favicon.php'); require_once(THESIS_CLASSES . '/head.php'); require_once(THESIS_CLASSES . '/javascript.php'); require_once(THESIS_CLASSES . '/loop.php'); require_once(THESIS_CLASSES . '/options_design.php'); require_once(THESIS_CLASSES . '/options_page.php'); require_once(THESIS_CLASSES . '/options_site.php'); require_once(THESIS_CLASSES . '/options_terms.php'); // Admin stuff if (is_admin()) { #wp require_once(THESIS_ADMIN . '/file_editor.php'); require_once(THESIS_ADMIN . '/fonts.php'); require_once(THESIS_ADMIN . '/header_image.php'); require_once(THESIS_ADMIN . '/options_manager.php'); require_once(THESIS_ADMIN . '/options_post.php'); require_once(THESIS_ADMIN . '/admin.php'); } // Load template-based function files require_once(THESIS_FUNCTIONS . '/comments.php'); require_once(THESIS_FUNCTIONS . '/compatibility.php'); require_once(THESIS_FUNCTIONS . '/content.php'); require_once(THESIS_FUNCTIONS . '/document.php'); require_once(THESIS_FUNCTIONS . '/feature_box.php'); require_once(THESIS_FUNCTIONS . '/helpers.php'); require_once(THESIS_FUNCTIONS . '/multimedia_box.php'); require_once(THESIS_FUNCTIONS . '/nav_menu.php'); require_once(THESIS_FUNCTIONS . '/post_images.php'); require_once(THESIS_FUNCTIONS . '/teasers.php'); require_once(THESIS_FUNCTIONS . '/version.php'); require_once(THESIS_FUNCTIONS . '/widgets.php'); // Load HTML frameworks require_once(THESIS_HTML . '/content_box.php'); require_once(THESIS_HTML . '/footer.php'); require_once(THESIS_HTML . '/frameworks.php'); require_once(THESIS_HTML . '/header.php'); require_once(THESIS_HTML . '/hooks.php'); require_once(THESIS_HTML . '/sidebars.php'); require_once(THESIS_HTML . '/templates.php'); // Launch Thesis within WordPress require_once(THESIS_FUNCTIONS . '/launch.php'); // Include the user's custom_functions file, but only if it exists if (file_exists(THESIS_CUSTOM . '/custom_functions.php')) include_once(THESIS_CUSTOM . '/custom_functions.php');