Edit File by line
/home/barbar84/www/wp-inclu.../SimplePi...
File: Caption.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* SimplePie
[2] Fix | Delete
*
[3] Fix | Delete
* A PHP-Based RSS and Atom Feed Framework.
[4] Fix | Delete
* Takes the hard work out of managing a complete RSS/Atom solution.
[5] Fix | Delete
*
[6] Fix | Delete
* Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
[7] Fix | Delete
* All rights reserved.
[8] Fix | Delete
*
[9] Fix | Delete
* Redistribution and use in source and binary forms, with or without modification, are
[10] Fix | Delete
* permitted provided that the following conditions are met:
[11] Fix | Delete
*
[12] Fix | Delete
* * Redistributions of source code must retain the above copyright notice, this list of
[13] Fix | Delete
* conditions and the following disclaimer.
[14] Fix | Delete
*
[15] Fix | Delete
* * Redistributions in binary form must reproduce the above copyright notice, this list
[16] Fix | Delete
* of conditions and the following disclaimer in the documentation and/or other materials
[17] Fix | Delete
* provided with the distribution.
[18] Fix | Delete
*
[19] Fix | Delete
* * Neither the name of the SimplePie Team nor the names of its contributors may be used
[20] Fix | Delete
* to endorse or promote products derived from this software without specific prior
[21] Fix | Delete
* written permission.
[22] Fix | Delete
*
[23] Fix | Delete
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
[24] Fix | Delete
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
[25] Fix | Delete
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
[26] Fix | Delete
* AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
[27] Fix | Delete
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
[28] Fix | Delete
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
[29] Fix | Delete
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
[30] Fix | Delete
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
[31] Fix | Delete
* POSSIBILITY OF SUCH DAMAGE.
[32] Fix | Delete
*
[33] Fix | Delete
* @package SimplePie
[34] Fix | Delete
* @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
[35] Fix | Delete
* @author Ryan Parman
[36] Fix | Delete
* @author Sam Sneddon
[37] Fix | Delete
* @author Ryan McCue
[38] Fix | Delete
* @link http://simplepie.org/ SimplePie
[39] Fix | Delete
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
[40] Fix | Delete
*/
[41] Fix | Delete
[42] Fix | Delete
[43] Fix | Delete
/**
[44] Fix | Delete
* Handles `<media:text>` captions as defined in Media RSS.
[45] Fix | Delete
*
[46] Fix | Delete
* Used by {@see SimplePie_Enclosure::get_caption()} and {@see SimplePie_Enclosure::get_captions()}
[47] Fix | Delete
*
[48] Fix | Delete
* This class can be overloaded with {@see SimplePie::set_caption_class()}
[49] Fix | Delete
*
[50] Fix | Delete
* @package SimplePie
[51] Fix | Delete
* @subpackage API
[52] Fix | Delete
*/
[53] Fix | Delete
class SimplePie_Caption
[54] Fix | Delete
{
[55] Fix | Delete
/**
[56] Fix | Delete
* Content type
[57] Fix | Delete
*
[58] Fix | Delete
* @var string
[59] Fix | Delete
* @see get_type()
[60] Fix | Delete
*/
[61] Fix | Delete
var $type;
[62] Fix | Delete
[63] Fix | Delete
/**
[64] Fix | Delete
* Language
[65] Fix | Delete
*
[66] Fix | Delete
* @var string
[67] Fix | Delete
* @see get_language()
[68] Fix | Delete
*/
[69] Fix | Delete
var $lang;
[70] Fix | Delete
[71] Fix | Delete
/**
[72] Fix | Delete
* Start time
[73] Fix | Delete
*
[74] Fix | Delete
* @var string
[75] Fix | Delete
* @see get_starttime()
[76] Fix | Delete
*/
[77] Fix | Delete
var $startTime;
[78] Fix | Delete
[79] Fix | Delete
/**
[80] Fix | Delete
* End time
[81] Fix | Delete
*
[82] Fix | Delete
* @var string
[83] Fix | Delete
* @see get_endtime()
[84] Fix | Delete
*/
[85] Fix | Delete
var $endTime;
[86] Fix | Delete
[87] Fix | Delete
/**
[88] Fix | Delete
* Caption text
[89] Fix | Delete
*
[90] Fix | Delete
* @var string
[91] Fix | Delete
* @see get_text()
[92] Fix | Delete
*/
[93] Fix | Delete
var $text;
[94] Fix | Delete
[95] Fix | Delete
/**
[96] Fix | Delete
* Constructor, used to input the data
[97] Fix | Delete
*
[98] Fix | Delete
* For documentation on all the parameters, see the corresponding
[99] Fix | Delete
* properties and their accessors
[100] Fix | Delete
*/
[101] Fix | Delete
public function __construct($type = null, $lang = null, $startTime = null, $endTime = null, $text = null)
[102] Fix | Delete
{
[103] Fix | Delete
$this->type = $type;
[104] Fix | Delete
$this->lang = $lang;
[105] Fix | Delete
$this->startTime = $startTime;
[106] Fix | Delete
$this->endTime = $endTime;
[107] Fix | Delete
$this->text = $text;
[108] Fix | Delete
}
[109] Fix | Delete
[110] Fix | Delete
/**
[111] Fix | Delete
* String-ified version
[112] Fix | Delete
*
[113] Fix | Delete
* @return string
[114] Fix | Delete
*/
[115] Fix | Delete
public function __toString()
[116] Fix | Delete
{
[117] Fix | Delete
// There is no $this->data here
[118] Fix | Delete
return md5(serialize($this));
[119] Fix | Delete
}
[120] Fix | Delete
[121] Fix | Delete
/**
[122] Fix | Delete
* Get the end time
[123] Fix | Delete
*
[124] Fix | Delete
* @return string|null Time in the format 'hh:mm:ss.SSS'
[125] Fix | Delete
*/
[126] Fix | Delete
public function get_endtime()
[127] Fix | Delete
{
[128] Fix | Delete
if ($this->endTime !== null)
[129] Fix | Delete
{
[130] Fix | Delete
return $this->endTime;
[131] Fix | Delete
}
[132] Fix | Delete
[133] Fix | Delete
return null;
[134] Fix | Delete
}
[135] Fix | Delete
[136] Fix | Delete
/**
[137] Fix | Delete
* Get the language
[138] Fix | Delete
*
[139] Fix | Delete
* @link http://tools.ietf.org/html/rfc3066
[140] Fix | Delete
* @return string|null Language code as per RFC 3066
[141] Fix | Delete
*/
[142] Fix | Delete
public function get_language()
[143] Fix | Delete
{
[144] Fix | Delete
if ($this->lang !== null)
[145] Fix | Delete
{
[146] Fix | Delete
return $this->lang;
[147] Fix | Delete
}
[148] Fix | Delete
[149] Fix | Delete
return null;
[150] Fix | Delete
}
[151] Fix | Delete
[152] Fix | Delete
/**
[153] Fix | Delete
* Get the start time
[154] Fix | Delete
*
[155] Fix | Delete
* @return string|null Time in the format 'hh:mm:ss.SSS'
[156] Fix | Delete
*/
[157] Fix | Delete
public function get_starttime()
[158] Fix | Delete
{
[159] Fix | Delete
if ($this->startTime !== null)
[160] Fix | Delete
{
[161] Fix | Delete
return $this->startTime;
[162] Fix | Delete
}
[163] Fix | Delete
[164] Fix | Delete
return null;
[165] Fix | Delete
}
[166] Fix | Delete
[167] Fix | Delete
/**
[168] Fix | Delete
* Get the text of the caption
[169] Fix | Delete
*
[170] Fix | Delete
* @return string|null
[171] Fix | Delete
*/
[172] Fix | Delete
public function get_text()
[173] Fix | Delete
{
[174] Fix | Delete
if ($this->text !== null)
[175] Fix | Delete
{
[176] Fix | Delete
return $this->text;
[177] Fix | Delete
}
[178] Fix | Delete
[179] Fix | Delete
return null;
[180] Fix | Delete
}
[181] Fix | Delete
[182] Fix | Delete
/**
[183] Fix | Delete
* Get the content type (not MIME type)
[184] Fix | Delete
*
[185] Fix | Delete
* @return string|null Either 'text' or 'html'
[186] Fix | Delete
*/
[187] Fix | Delete
public function get_type()
[188] Fix | Delete
{
[189] Fix | Delete
if ($this->type !== null)
[190] Fix | Delete
{
[191] Fix | Delete
return $this->type;
[192] Fix | Delete
}
[193] Fix | Delete
[194] Fix | Delete
return null;
[195] Fix | Delete
}
[196] Fix | Delete
}
[197] Fix | Delete
[198] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function