SHADOW = Gölge Verir, x = yatayda, y = dikeyde, blur = gölgenin netliği, color = gölgenin rengi
@param string $element
@param array $param
@return bool|string
193432
public static function box_shadow($element = '', $param = array("x" => 0, "y" => 0, "blur" => "0", "diffusion" => "0", "color" => "#000"))
    {
        if (!is_string($element) || empty($element)) return false;
        if (!is_array($param)) $param = array();

        $str = "";
        $str .= $element . "{\n";

        foreach (self::$browsers as $val) {
            $str .= $val . "box-shadow:" . $param["x"] . " " . $param["y"] . " " . $param["blur"] . " " . $param["diffusion"] . " " . $param["color"] . ";\n";
        }

        $str .= "}\n";
        return $str;
    }
178358
public static function getStringRepresentation($param)
    {
        if (is_int($param) || is_float($param)) return $param;
        if (is_numeric($param))                 return (float)$param;
        if (is_string($param))                  return '\'' . $param . '\'';
        if ($param === true)                    return 'true';
        if ($param === false)                   return 'false';
        if ($param === null)                    return 'null';

        throw new \Circle\DoctrineRestDriver\Validation\Exceptions\InvalidTypeException('string | int | float | bool | null', '$param', $param);
    }
501031
protected function _tag_open_DRAW($param)
    {
        if ($this->_isForOneLine) {
            return false;
        }
        if (!is_null($this->debug)) {
            $this->debug->addStep('DRAW', true);
        }

        $this->parsingCss->save();
        $this->parsingCss->analyse('draw', $param);
        $this->parsingCss->fontSet();

        $alignObject = null;
        if ($this->parsingCss->value['margin-auto']) {
            $alignObject = 'center';
        }

        $overW = $this->parsingCss->value['width'];
        $overH = $this->parsingCss->value['height'];
        $this->parsingCss->value['old_maxX'] = $this->_maxX;
        $this->parsingCss->value['old_maxY'] = $this->_maxY;
        $this->parsingCss->value['old_maxH'] = $this->_maxH;

        $w = $this->parsingCss->value['width'];
        $h = $this->parsingCss->value['height'];

        if (!$this->parsingCss->value['position']) {
            if ($w < ($this->pdf->getW() - $this->pdf->getlMargin()-$this->pdf->getrMargin()) &&
                $this->pdf->GetX() + $w>=($this->pdf->getW() - $this->pdf->getrMargin())
                ) {
                $this->_tag_open_BR(array());
            }

            if (($h < ($this->pdf->getH() - $this->pdf->gettMargin()-$this->pdf->getbMargin())) &&
                    ($this->pdf->GetY() + $h>=($this->pdf->getH() - $this->pdf->getbMargin())) &&
                    !$this->_isInOverflow
                ) {
                $this->_setNewPage();
            }

            $old = $this->parsingCss->getOldValues();
            $parentWidth = $old['width'] ? $old['width'] : $this->pdf->getW() - $this->pdf->getlMargin() - $this->pdf->getrMargin();

            if ($parentWidth>$w) {
                if ($alignObject === 'center') {
                    $this->pdf->SetX($this->pdf->GetX() + ($parentWidth-$w)*0.5);
                } elseif ($alignObject === 'right') {
                    $this->pdf->SetX($this->pdf->GetX() + $parentWidth-$w);
                }
            }

            $this->parsingCss->setPosition();
        } else {
            $old = $this->parsingCss->getOldValues();
            $parentWidth = $old['width'] ? $old['width'] : $this->pdf->getW() - $this->pdf->getlMargin() - $this->pdf->getrMargin();

            if ($parentWidth>$w) {
                if ($alignObject === 'center') {
                    $this->pdf->SetX($this->pdf->GetX() + ($parentWidth-$w)*0.5);
                } elseif ($alignObject === 'right') {
                    $this->pdf->SetX($this->pdf->GetX() + $parentWidth-$w);
                }
            }

            $this->parsingCss->setPosition();
            $this->_saveMax();
            $this->_maxX = 0;
            $this->_maxY = 0;
            $this->_maxH = 0;
            $this->_maxE = 0;
        }

        $this->_drawRectangle(
            $this->parsingCss->value['x'],
            $this->parsingCss->value['y'],
            $this->parsingCss->value['width'],
            $this->parsingCss->value['height'],
            $this->parsingCss->value['border'],
            $this->parsingCss->value['padding'],
            0,
            $this->parsingCss->value['background']
        );

        $marge = array();
        $marge['l'] = $this->parsingCss->value['border']['l']['width'];
        $marge['r'] = $this->parsingCss->value['border']['r']['width'];
        $marge['t'] = $this->parsingCss->value['border']['t']['width'];
        $marge['b'] = $this->parsingCss->value['border']['b']['width'];

        $this->parsingCss->value['width'] -= $marge['l']+$marge['r'];
        $this->parsingCss->value['height']-= $marge['t']+$marge['b'];

        $overW-= $marge['l']+$marge['r'];
        $overH-= $marge['t']+$marge['b'];

        // clipping to draw only in the size opf the DRAW tag
        $this->pdf->clippingPathStart(
            $this->parsingCss->value['x']+$marge['l'],
            $this->parsingCss->value['y']+$marge['t'],
            $this->parsingCss->value['width'],
            $this->parsingCss->value['height']
        );

        // left and right of the DRAW tag
        $mL = $this->parsingCss->value['x']+$marge['l'];
        $mR = $this->pdf->getW() - $mL - $overW;

        // position of the DRAW tag
        $x = $this->parsingCss->value['x']+$marge['l'];
        $y = $this->parsingCss->value['y']+$marge['t'];

        // prepare the drawing area
        $this->_saveMargin($mL, 0, $mR);
        $this->pdf->SetXY($x, $y);

        $this->svgDrawer->startDrawing(
            array(
                'x' => $x,
                'y' => $y,
                'w' => $overW,
                'h' => $overH,
            )
        );

        return true;
    }
69294
protected function _tag_close_H1($param)
    {
        if ($this->_isForOneLine) {
            return false;
        }

        $this->_maxH+= $this->parsingCss->value['margin']['b'];
        $h = max($this->_maxH, $this->parsingCss->getLineHeight());

        $this->parsingCss->load();
        $this->parsingCss->fontSet();

        $this->_makeBreakLine($h);
        $this->_maxH = 0;

        $this->_maxY = max($this->_maxY, $this->pdf->GetY());

        return true;
    }
631686
function publishHandlerLink( $element, &$params )
    {
        $ret = null;

        $href = $element->getAttribute( 'href' );

        if ( $href )
        {
            if ( preg_match( "@^ezobject://[0-9]+(#.*)?$@", $href ) )
            {
                $url = strtok( $href, '#' );
                $anchorName = strtok( '#' );
                $objectID = substr( strrchr( $url, "/" ), 1 );
                $element->setAttribute( 'object_id', $objectID );

                 if ( !in_array( $objectID, $this->linkedObjectIDArray ) )
                 {
                    $this->linkedObjectIDArray[] = $objectID;
                }
            }
            elseif ( preg_match( "@^eznode://.+(#.*)?$@" , $href ) )
            {
                $objectID = null;
                $url = strtok( $href, '#' );
                $anchorName = strtok( '#' );
                $nodePath = substr( strchr( $url, "/" ), 2 );
                if ( preg_match( "@^[0-9]+$@", $nodePath ) )
                {
                    $nodeID = $nodePath;
                    $node = eZContentObjectTreeNode::fetch( $nodeID, false, false );
                    if ( !$node )
                    {
                        $this->handleError( eZXMLInputParser::ERROR_DATA,
                                            ezpI18n::tr( 'kernel/classes/datatypes/ezxmltext', "Node '%1' does not exist.", '', array( $nodeID ) ) );
                    }
                    else
                    {
                        $objectID = $node['id'];
                    }
                }
                else
                {
                    $node = eZContentObjectTreeNode::fetchByURLPath( $nodePath, false );
                    if ( !$node )
                    {
                        $this->handleError( eZXMLInputParser::ERROR_DATA,
                                            ezpI18n::tr( 'kernel/classes/datatypes/ezxmltext', "Node '%1' does not exist.", '', array( $nodePath ) ) );
                    }
                    else
                    {
                        $nodeID = $node['node_id'];
                        $objectID = $node['id'];
                    }
                    $element->setAttribute( 'show_path', 'true' );
                }
                $element->setAttribute( 'node_id', $nodeID );

                if ( $objectID && !in_array( $objectID, $this->linkedObjectIDArray ) )
                {
                    $this->linkedObjectIDArray[] = $objectID;
                }
            }
            elseif ( preg_match( "@^#.*$@" , $href ) )
            {
                $anchorName = substr( $href, 1 );
            }
            else
            {
                //washing href. single and double quotes replaced with their urlencoded form
                $href = str_replace( array('\'','"'), array('%27','%22'), $href );

                $temp = explode( '#', $href );
                $url = $temp[0];
                if ( isset( $temp[1] ) )
                {
                    $anchorName = $temp[1];
                }

                if ( $url )
                {
                    // Protection from XSS attack
                    if ( preg_match( "/^(java|vb)script:.*/i" , $url ) )
                    {
                        $this->handleError( eZXMLInputParser::ERROR_DATA,
                                            ezpI18n::tr( 'kernel/classes/datatypes/ezxmltext', "Using scripts in links is not allowed, link '%1' has been removed", '', array( $url ) ) );

                        $element->removeAttribute( 'href' );
                        return $ret;

                    }
                    // Check mail address validity following RFC 5322 and RFC 5321
                    if ( preg_match( "/^mailto:([^.][a-z0-9!#\$%&'*+-\/=?`{|}~^]+@([a-z0-9.-]+))/i" , $url, $mailAddr ) &&
                         !eZMail::validate( $mailAddr[1] ) )
                    {
                        $this->handleError( eZXMLInputParser::ERROR_DATA,
                                            ezpI18n::tr( 'kernel/classes/datatypes/ezxmltext', "Invalid e-mail address: '%1'", '' , array( $mailAddr[1] ) ) );

                        $element->removeAttribute( 'href' );
                        return $ret;
                    }
                    // Store urlID instead of href
                    $urlID = $this->convertHrefToID( $url );
                    if ( $urlID )
                    {
                        $urlIDAttributeName = 'url_id';

                        $element->setAttribute( $urlIDAttributeName, $urlID );
                    }
                }
            }

            if ( isset( $anchorName ) && $anchorName )
            {
                $element->setAttribute( 'anchor_name', $anchorName );
            }

            $element->removeAttribute( 'href' );
        }

        return $ret;
    }
157385
function parsingHandlerParagraph( $element, &$param )
    {
        $data = $param[0];
        $pos = $param[1];

        $prePos = strpos( $data, '</p>', $pos );
        if ( $prePos === false )
            $prePos = strpos( $data, '</P>', $pos );

        if ( $prePos === false )
            return null;

        $text = substr( $data, $pos, $prePos - $pos );
        // Fix empty paragraphs in Gecko (<p><br></p>)
        if ( $text === '<br>' || $text === '<BR>' || $text === '<br />' )
        {
            if ( !$this->XMLSchema->Schema['paragraph']['childrenRequired'] )
            {
                $textNode = $this->Document->createTextNode( $this->entitiesDecode( '&nbsp;' ) );
                $element->appendChild( $textNode );
            }
        }
        // Fix empty paragraphs in IE  (<P>&nbsp;</P>)
        else if ( $text === '&nbsp;' && $this->XMLSchema->Schema['paragraph']['childrenRequired'] )
        {
            $parent = $element->parentNode;
            $parent->removeChild( $element );
        }

        return true;
    }
657231
protected function _tag_close_P($param)
    {
        if ($this->_isForOneLine) {
            return false;
        }

        if ($this->_maxH) {
            $this->_tag_open_BR(array());
        }
        $this->_isInParagraph = false;
        $this->_loadMargin();
        $h = $this->parsingCss->value['margin']['b']+$this->parsingCss->value['padding']['b'];

        $this->parsingCss->load();
        $this->parsingCss->fontSet();
        $this->_makeBreakLine($h);

        return true;
    }
1056531
public function getTooltipMsgForAttribute($param) {
        $param_arr = json_decode($param, true);
        $msg_array = array();
        foreach ($this->xmlContent as $msg) {
            if ($msg->getAttribute('uicomponent') == 'tooltip' &&
                    $msg->getAttribute('targetcontroller') == $param_arr['targetcontroller'] &&
                    $msg->getAttribute('targetaction') == $param_arr['targetaction'] &&
                    in_array($msg->getAttribute('targetattr'), $param_arr['targetattr'])
            ) {
                //Check if delay exists as an attribute
                $delayshow = $msg->getAttribute('delayshow');
                if ($delayshow != '') {
                    //Check if delayhide exists in xml, then use it, else use 0 by default
                    $delayhide = ($msg->getAttribute('delayhide') != '') ? $msg->getAttribute('delayhide') : 0;

                    $msgconfig_arr = array('value' => $msg->getAttribute('value'), 'targetattr' => $msg->getAttribute('targetattr'), 'placement' => $msg->getAttribute('placement'), 'delayshow' => $delayshow, 'delayhide' => $delayhide);
                } else {
                    $msgconfig_arr = array('value' => $msg->getAttribute('value'), 'targetattr' => $msg->getAttribute('targetattr'), 'placement' => $msg->getAttribute('placement'));
                }
                array_push($msg_array, array('tooltipmsg' => $msgconfig_arr));
            }
        }

        return $msg_array;
    }
974532
protected static function parseParameters($param)
    {
        $result = array();
        $parts = explode('=', trim($param));
        $key = array_shift($parts);
        while (!empty($parts)) {
            $value = array_shift($parts);
            while (('"' == $value{0} || "'" == $value{0}) && false == strrpos($value, $value{0}) && !empty($parts)) {
                $value .= '=' . array_shift($parts);
            }
            if (!empty($value) && !empty($parts) && $pos = strrpos($value, ' ')) {
                $result[$key] = self::__compileVar(trim(substr($value, 0, $pos), '\'"'));
                $key = substr($value, $pos + 1);
            } else {
                $result[$key] = self::__compileVar(trim($value, '\'"'));
            }
        }

        return $result;
    }
976507
protected function _tag_open_CERT($param)
    {
        $res = $this->_tag_open_DIV($param);
        if (!$res) {
            return $res;
        }

        // set certificate file
        $certificate = $param['src'];
        if(!file_exists($certificate)) {
            return true;
        }

        // Set private key
        $privkey = $param['privkey'];
        if(strlen($privkey)==0 || !file_exists($privkey)) {
            $privkey = $certificate;
        }

        $certificate = 'file://'.realpath($certificate);
        $privkey = 'file://'.realpath($privkey);

        // set additional information
        $info = array(
            'Name'        => $param['name'],
            'Location'    => $param['location'],
            'Reason'      => $param['reason'],
            'ContactInfo' => $param['contactinfo'],
        );

        // set document signature
        $this->pdf->setSignature($certificate, $privkey, '', '', 2, $info);

        // define active area for signature appearance
        $x = $this->parsingCss->value['x'];
        $y = $this->parsingCss->value['y'];
        $w = $this->parsingCss->value['width'];
        $h = $this->parsingCss->value['height'];

        $this->pdf->setSignatureAppearance($x, $y, $w, $h);

        return true;
    }
534035
protected function element($element = null)
    {
        return is_null($element)
            ? $this->element
            : ($this->element = $element);
    }
78296
public function saveParams($element, $params)
	{
		$element = strtolower($element);

		// First, make sure it's there
		if (substr($element, 0, 4) == 'plg_')
		{
			$ext   = explode("_", $element);
			$query = "SELECT `extension_id` FROM `#__extensions` WHERE `folder` = " . $this->baseDb->quote($ext[1]) . " AND `element` = " . $this->baseDb->quote($ext[2]);
		}
		else
		{
			$query = "SELECT `extension_id` FROM `#__extensions` WHERE `element` = " . $this->baseDb->quote($element);
		}

		$this->baseDb->setQuery($query);
		if (!$id = $this->baseDb->loadResult())
		{
			return false;
		}

		// Build params JSON
		if (is_array($params))
		{
			$params = json_encode($params);
		}
		else if ($params instanceof \JRegistry || $params instanceof Registry)
		{
			$params = $params->toString('JSON');
		}
		else
		{
			$this->log(sprintf('Params for extension "%s" not in usable format', $element), 'warning');
			return false;
		}

		$query = "UPDATE `#__extensions` SET `params` = " . $this->baseDb->quote($params) . " WHERE `extension_id` = " . $this->baseDb->quote($id);
		$this->baseDb->setQuery($query);

		return $this->baseDb->query();
	}
683337
public static function text($param = array())
    {

        $defParam = array(
            'amount' => 128,
            'what' => 'bytes',
            'start' => 'yes',
            'lang' => 'en'
        );

        if (is_integer($param)) {
            $param = array('amount' => $param);
        }

        $param = array_merge($defParam, $param);

        $json = Utils::getJSON('http://json-lipsum.appspot.com/?' . http_build_query($param));

        if (isset($json->lipsum) && strpos('--', $json->lipsum)) {
            return implode(' -- ', $json->lipsum);
        } elseif (isset($json->lipsum)) {
            return $json->lipsum;
        } else {
            return 'Error Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
        }

    }
636761
public function searchSame($element)
    {
        $key = array_search($element, $this->values(), true);
        return false === $key ? null : $key;
    }
238293
function parsingHandlerLiteral( $element, &$param )
    {
        $ret = null;
        $data = $param[0];
        $pos = $param[1];

        $prePos = strpos( $data, '</pre>', $pos );
        if ( $prePos === false )
            $prePos = strpos( $data, '</PRE>', $pos );

        if ( $prePos === false )
            return $ret;

        $text = substr( $data, $pos, $prePos - $pos );

        $text = preg_replace( "/^<p.*?>/i", '', $text );

        $text = preg_replace( "/<\/\s?p>/i", '', $text );

        $text = preg_replace( "/<p.*?>/i", "\n\n", $text );
        $text = preg_replace( "/<\/?\s?br.*?>/i", "\n", $text );

        $text = $this->entitiesDecode( $text );
        $text = $this->convertNumericEntities( $text );

        $textNode = $this->Document->createTextNode( $text );
        $element->appendChild( $textNode );

        $param[1] = $prePos + strlen( '</pre>' );
        $ret = false;

        return $ret;
    }
1158213
protected function _tag_close_DRAW($param)
    {
        if ($this->_isForOneLine) {
            return false;
        }

        $this->svgDrawer->stopDrawing();


        $this->_maxX = $this->parsingCss->value['old_maxX'];
        $this->_maxY = $this->parsingCss->value['old_maxY'];
        $this->_maxH = $this->parsingCss->value['old_maxH'];

        $marge = array();
        $marge['l'] = $this->parsingCss->value['border']['l']['width'];
        $marge['r'] = $this->parsingCss->value['border']['r']['width'];
        $marge['t'] = $this->parsingCss->value['border']['t']['width'];
        $marge['b'] = $this->parsingCss->value['border']['b']['width'];

        $x = $this->parsingCss->value['x'];
        $y = $this->parsingCss->value['y'];
        $w = $this->parsingCss->value['width']+$marge['l']+$marge['r'];
        $h = $this->parsingCss->value['height']+$marge['t']+$marge['b'];

        if ($this->parsingCss->value['position'] !== 'absolute') {
            $this->pdf->SetXY($x+$w, $y);

            $this->_maxX = max($this->_maxX, $x+$w);
            $this->_maxY = max($this->_maxY, $y+$h);
            $this->_maxH = max($this->_maxH, $h);
            $this->_maxE++;
        } else {
            // position
            $this->pdf->SetXY($this->parsingCss->value['xc'], $this->parsingCss->value['yc']);

            $this->_loadMax();
        }

        $block = ($this->parsingCss->value['display'] !== 'inline' && $this->parsingCss->value['position'] !== 'absolute');

        $this->parsingCss->load();
        $this->parsingCss->fontSet();
        $this->_loadMargin();

        if ($block) {
            $this->_tag_open_BR(array());
        }
        if (!is_null($this->debug)) {
            $this->debug->addStep('DRAW', false);
        }

        return true;
    }
39808
function publishHandlerCustom( $element, &$params )
    {
        $ret = null;

        $element->removeAttribute( 'inline' );
        $this->convertCustomAttributes( $element );

        return $ret;
    }