當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。