当前位置: 首页>>代码示例>>PHP>>正文


PHP UniteFunctionsRev::convertStdClassToArray方法代码示例

本文整理汇总了PHP中UniteFunctionsRev::convertStdClassToArray方法的典型用法代码示例。如果您正苦于以下问题:PHP UniteFunctionsRev::convertStdClassToArray方法的具体用法?PHP UniteFunctionsRev::convertStdClassToArray怎么用?PHP UniteFunctionsRev::convertStdClassToArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UniteFunctionsRev的用法示例。


在下文中一共展示了UniteFunctionsRev::convertStdClassToArray方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: initByData

 /**
  * 
  * init slide by db record
  */
 public function initByData($record)
 {
     $this->id = $record["id"];
     $this->sliderID = $record["slider_id"];
     $this->slideOrder = $record["slide_order"];
     $params = $record["params"];
     $params = (array) json_decode($params);
     $layers = $record["layers"];
     $layers = (array) json_decode($layers);
     $layers = UniteFunctionsRev::convertStdClassToArray($layers);
     //set image path, file and url
     $this->imageUrl = UniteFunctionsRev::getVal($params, "image");
     UniteFunctionsRev::validateNotEmpty($this->imageUrl, "Image");
     $this->imageFilepath = UniteFunctionsWPRev::getImagePathFromURL($this->imageUrl);
     $realPath = UniteFunctionsWPRev::getPathContent() . $this->imageFilepath;
     if (file_exists($realPath) == false || is_file($realPath) == false) {
         $this->imageFilepath = "";
     }
     $this->imageFilename = basename($this->imageUrl);
     $this->params = $params;
     $this->arrLayers = $layers;
 }
开发者ID:ConceptHaus,项目名称:huasca,代码行数:26,代码来源:revslider_slide.class.php

示例2: updateSlideFromData

 /**
  * 
  * update slide from data
  * @param $data
  */
 public function updateSlideFromData($data, $slideSettings)
 {
     $slideID = UniteFunctionsRev::getVal($data, "slideid");
     $this->initByID($slideID);
     //treat params
     $params = UniteFunctionsRev::getVal($data, "params");
     $params = $this->normalizeParams($params);
     //modify the values according the settings
     $params = $slideSettings->setStoredValues($params);
     //preserve old data that not included in the given data
     $params = array_merge($this->params, $params);
     //treat layers
     $layers = UniteFunctionsRev::getVal($data, "layers");
     if (gettype($layers) == "string") {
         $layersStrip = stripslashes($layers);
         $layersDecoded = json_decode($layersStrip);
         if (empty($layersDecoded)) {
             $layersDecoded = json_decode($layers);
         }
         $layers = UniteFunctionsRev::convertStdClassToArray($layersDecoded);
     }
     if (empty($layers) || gettype($layers) != "array") {
         $layers = array();
     }
     $layers = $this->normalizeLayers($layers);
     $arrUpdate = array();
     $arrUpdate["layers"] = json_encode($layers);
     $arrUpdate["params"] = json_encode($params);
     $this->db->update(GlobalsRevSlider::$table_slides, $arrUpdate, array("id" => $this->id));
     RevOperations::updateDynamicCaptions();
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:36,代码来源:revslider_slide.class.php

示例3: modifySettingsData

 private function modifySettingsData($arrSettings)
 {
     foreach ($arrSettings as $key => $content) {
         switch (getType($content)) {
             case "string":
                 //replace the unicode line break (sometimes left after json)
                 $content = str_replace("u000a", "\n", $content);
                 $content = str_replace("u000d", "", $content);
                 break;
             case "object":
             case "array":
                 $content = UniteFunctionsRev::convertStdClassToArray($content);
                 break;
         }
         $arrSettings[$key] = $content;
     }
     return $arrSettings;
 }
开发者ID:evgrishin,项目名称:se1614,代码行数:18,代码来源:settings.class.php

示例4: filterOneSlide

 /**
  * 
  * filter the slides for one slide preview
  */
 private function filterOneSlide($slides)
 {
     $oneSlideID = $this->oneSlideData["slideid"];
     $oneSlideParams = UniteFunctionsRev::getVal($this->oneSlideData, "params");
     $oneSlideLayers = UniteFunctionsRev::getVal($this->oneSlideData, "layers");
     if (gettype($oneSlideParams) == "object") {
         $oneSlideParams = (array) $oneSlideParams;
     }
     if (gettype($oneSlideLayers) == "object") {
         $oneSlideLayers = (array) $oneSlideLayers;
     }
     if (!empty($oneSlideLayers)) {
         $oneSlideLayers = UniteFunctionsRev::convertStdClassToArray($oneSlideLayers);
     }
     $newSlides = array();
     foreach ($slides as $slide) {
         $slideID = $slide->getID();
         if ($slideID == $oneSlideID) {
             if (!empty($oneSlideParams)) {
                 $slide->setParams($oneSlideParams);
             }
             if (!empty($oneSlideLayers)) {
                 $slide->setLayers($oneSlideLayers);
             }
             $newSlides[] = $slide;
             //add 2 slides
             $newSlides[] = $slide;
         }
     }
     return $newSlides;
 }
开发者ID:jhener79,项目名称:vlakc,代码行数:35,代码来源:revslider_output.class.php

示例5: updateStaticSlideFromData

 /**
  *
  * update slide from data
  * @param $data
  */
 public function updateStaticSlideFromData($data)
 {
     $slideID = UniteFunctionsRev::getVal($data, "slideid");
     $this->initByStaticID($slideID);
     //treat layers
     $layers = UniteFunctionsRev::getVal($data, "layers");
     if (gettype($layers) == "string") {
         $layersStrip = stripslashes($layers);
         $layersDecoded = json_decode($layersStrip);
         if (empty($layersDecoded)) {
             $layersDecoded = json_decode($layers);
         }
         $layers = UniteFunctionsRev::convertStdClassToArray($layersDecoded);
     }
     if (empty($layers) || gettype($layers) != "array") {
         $layers = array();
     }
     $layers = $this->normalizeLayers($layers);
     $arrUpdate = array();
     $arrUpdate["layers"] = json_encode($layers);
     $this->db->update(GlobalsRevSlider::$table_static_slides, $arrUpdate, array("id" => $this->id));
     RevOperations::updateDynamicCaptions();
 }
开发者ID:TeamCodeStudio,项目名称:fpmoz,代码行数:28,代码来源:revslider_slide.class.php

示例6: updateSlideFromData

 /**
  * 
  * update slide from data
  * @param $data
  */
 public function updateSlideFromData($data)
 {
     $slideID = UniteFunctionsRev::getVal($data, "slideid");
     $this->initByID($slideID);
     //treat params
     $params = UniteFunctionsRev::getVal($data, "params");
     $params = $this->normalizeParams($params);
     //treat layers
     $layers = UniteFunctionsRev::getVal($data, "layers");
     if (gettype($layers) == "string") {
         $layers = stripslashes($layers);
         $layers = json_decode($layers);
         $layers = UniteFunctionsRev::convertStdClassToArray($layers);
     }
     if (empty($layers) || gettype($layers) != "array") {
         $layers = array();
     }
     $layers = $this->normalizeLayers($layers);
     $arrUpdate = array();
     $arrUpdate["layers"] = json_encode($layers);
     $arrUpdate["params"] = json_encode($params);
     $this->db->update(GlobalsRevSlider::$table_slides, $arrUpdate, array("id" => $this->id));
 }
开发者ID:nimishavyas,项目名称:proiti,代码行数:28,代码来源:revslider_slide.class.php

示例7: putCreativeLayer

    /**
     * 
     * put creative layer
     */
    private function putCreativeLayer($slide)
    {
        $layers = $slide["layers"];
        $layers = UniteFunctionsRev::convertStdClassToArray($layers);
        if (empty($layers)) {
            return false;
        }
        ?>
				<?php 
        foreach ($layers as $layer) {
            $type = UniteFunctionsRev::getVal($layer, "type", "text");
            $class = UniteFunctionsRev::getVal($layer, "style");
            $animation = UniteFunctionsRev::getVal($layer, "animation", "fade");
            //set output class:
            $outputClass = "tp-caption " . trim($class);
            $outputClass = trim($outputClass) . " ";
            $outputClass .= trim($animation);
            $left = UniteFunctionsRev::getVal($layer, "left", 0);
            $top = UniteFunctionsRev::getVal($layer, "top", 0);
            $speed = UniteFunctionsRev::getVal($layer, "speed", 300);
            $time = UniteFunctionsRev::getVal($layer, "time", 0);
            $easing = UniteFunctionsRev::getVal($layer, "easing", "easeOutExpo");
            $randomRotate = UniteFunctionsRev::getVal($layer, "random_rotation", "false");
            $randomRotate = UniteFunctionsRev::boolToStr($randomRotate);
            $text = UniteFunctionsRev::getVal($layer, "text");
            $htmlVideoAutoplay = "";
            //set html:
            //set html:
            $html = "";
            switch ($type) {
                default:
                case "text":
                    $html = $text;
                    break;
                case "image":
                    $urlImage = UniteFunctionsRev::getVal($layer, "image_url");
                    $html = '<img src="' . $urlImage . '" alt="' . $text . '">';
                    $imageLink = UniteFunctionsRev::getVal($layer, "link", "");
                    if (!empty($imageLink)) {
                        $openIn = UniteFunctionsRev::getVal($layer, "link_open_in", "same");
                        $target = "";
                        if ($openIn == "new") {
                            $target = ' target="_blank"';
                        }
                        $html = '<a href="' . $imageLink . '"' . $target . '>' . $html . '</a>';
                    }
                    break;
                case "video":
                    $videoType = trim(UniteFunctionsRev::getVal($layer, "video_type"));
                    $videoID = trim(UniteFunctionsRev::getVal($layer, "video_id"));
                    $videoWidth = trim(UniteFunctionsRev::getVal($layer, "video_width"));
                    $videoHeight = trim(UniteFunctionsRev::getVal($layer, "video_height"));
                    $linkYoutube = "http://www.youtube.com";
                    $linkVimeo = "http://player.vimeo.com";
                    if (JURI::getInstance()->isSSL() == true) {
                        $linkYoutube = "https://www.youtube.com";
                        $linkVimeo = "https://player.vimeo.com";
                    }
                    switch ($videoType) {
                        case "youtube":
                            $html = "<iframe src='{$linkYoutube}/embed/{$videoID}?hd=1&amp;wmode=opaque&amp;controls=1&amp;showinfo=0;rel=0' width='{$videoWidth}' height='{$videoHeight}' style='width:{$videoWidth}px;height:{$videoHeight}px;'></iframe>";
                            break;
                        case "vimeo":
                            $html = "<iframe src='{$linkVimeo}/video/{$videoID}?title=0&amp;byline=0&amp;portrait=0' width='{$videoWidth}' height='{$videoHeight}' style='width:{$videoWidth}px;height:{$videoHeight}px;'></iframe>";
                            break;
                        default:
                            UniteFunctionsRev::throwError("wrong video type: {$videoType}");
                            break;
                    }
                    $videoAutoplay = UniteFunctionsRev::getVal($layer, "video_autoplay");
                    if ($videoAutoplay == "true") {
                        $htmlVideoAutoplay = ' data-autoplay="true"';
                    }
                    break;
            }
            //handle end transitions:
            $endTime = trim(UniteFunctionsRev::getVal($layer, "endtime"));
            $htmlEnd = "";
            if (!empty($endTime)) {
                $htmlEnd = "data-end=\"{$endTime}\"";
                $endSpeed = trim(UniteFunctionsRev::getVal($layer, "endspeed"));
                if (!empty($endSpeed)) {
                    $htmlEnd .= " data-endspeed=\"{$endSpeed}\"";
                }
                $endEasing = trim(UniteFunctionsRev::getVal($layer, "endeasing"));
                if (!empty($endSpeed) && $endEasing != "nothing") {
                    $htmlEnd .= " data-endeasing=\"{$endEasing}\"";
                }
                //add animation to class
                $endAnimation = trim(UniteFunctionsRev::getVal($layer, "endanimation"));
                if (!empty($endAnimation) && $endAnimation != "auto") {
                    $outputClass .= " " . $endAnimation;
                }
            }
            //slide link
            $htmlLink = "";
//.........这里部分代码省略.........
开发者ID:DanyCan,项目名称:wisten.github.io,代码行数:101,代码来源:output.class.php

示例8: getCategoriesByIDs

 /**
  * 
  * get categories by id's
  */
 public static function getCategoriesByIDs($arrIDs, $strTax = null)
 {
     if (empty($arrIDs)) {
         return array();
     }
     if (is_string($arrIDs)) {
         $strIDs = $arrIDs;
     } else {
         $strIDs = implode(",", $arrIDs);
     }
     $args = array();
     $args["include"] = $strIDs;
     if (!empty($strTax)) {
         if (is_string($strTax)) {
             $strTax = explode(",", $strTax);
         }
         $args["taxonomy"] = $strTax;
     }
     $arrCats = get_categories($args);
     if (!empty($arrCats)) {
         $arrCats = UniteFunctionsRev::convertStdClassToArray($arrCats);
     }
     return $arrCats;
 }
开发者ID:jhonrsalcedo,项目名称:sitio,代码行数:28,代码来源:functions_wordpress.class.php

示例9: filterOneSlide

 /**
  * 
  * filter the slides for one slide preview
  */
 private function filterOneSlide($slides)
 {
     $oneSlideID = $this->oneSlideData["slideid"];
     $oneSlideParams = (array) $this->oneSlideData["params"];
     $oneSlideLayers = (array) $this->oneSlideData["layers"];
     $oneSlideLayers = UniteFunctionsRev::convertStdClassToArray($oneSlideLayers);
     $newSlides = array();
     foreach ($slides as $slide) {
         $slideID = $slide->getID();
         if ($slideID == $oneSlideID) {
             $slide->setParams($oneSlideParams);
             $slide->setLayers($oneSlideLayers);
             $newSlides[] = $slide;
             //add 2 slides
             $newSlides[] = $slide;
         }
     }
     return $newSlides;
 }
开发者ID:nimishavyas,项目名称:proiti,代码行数:23,代码来源:revslider_output.class.php

示例10: prepareLayersForOutput

 /**
  * 
  * get json layers, and return json layers
  * build layer image url's
  */
 private function prepareLayersForOutput($jsonLayers)
 {
     $jsonLayers = trim($jsonLayers);
     if (empty($jsonLayers)) {
         return $jsonLayers;
     }
     $arrLayers = json_decode($jsonLayers);
     $arrLayers = UniteFunctionsRev::convertStdClassToArray($arrLayers);
     foreach ($arrLayers as $key => $layer) {
         $layer = (array) $layer;
         if (isset($layer["image_url"])) {
             $arrLayers[$key]["image_url"] = UniteFunctionJoomlaRev::getImageUrl($layer["image_url"]);
         }
     }
     $jsonLayers = json_encode($arrLayers);
     return $jsonLayers;
 }
开发者ID:DanyCan,项目名称:wisten.github.io,代码行数:22,代码来源:view.html.php

示例11: fetchSql

 /**
  * 
  * fetch rows from sql query
  */
 public function fetchSql($query)
 {
     $this->jdb->setQuery($query);
     //$response = $this->jdb->execute();
     $this->checkForErrors("fetch");
     $rows = $this->jdb->loadObjectList();
     $rows = UniteFunctionsRev::convertStdClassToArray($rows);
     return $rows;
 }
开发者ID:WineWorld,项目名称:joomlatrialcmbg,代码行数:13,代码来源:db.class.php


注:本文中的UniteFunctionsRev::convertStdClassToArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。