• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP phpQuery类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: createSpots

 function createSpots()
 {
     // TODO :: Some caching ??
     $this->pq = $pq = new phpQuery();
     $this->dom = $dom = $pq->newDocument($this->owner->template->template_source);
     if (!$this->owner instanceof \Frontend) {
         $pq->pq($dom)->attr('xepan-page-content', 'true');
         $pq->pq($dom)->addClass('xepan-page-content');
     }
     foreach ($dom['.xepan-component'] as $d) {
         $d = $pq->pq($d);
         if (!$d->hasClass('xepan-serverside-component')) {
             continue;
         }
         $i = $this->spots++;
         $inner_html = $d->html();
         $with_spot = '{' . $this->owner->template->name . '_' . $i . '}' . $inner_html . '{/}';
         $d->html($with_spot);
     }
     $content = $this->updateBaseHrefForTemplates();
     $content = str_replace('<!--xEpan-ATK-Header-Start', '', $content);
     $content = str_replace('xEpan-ATK-Header-End-->', '', $content);
     $this->owner->template->loadTemplateFromString($content);
     $this->owner->template->trySet($this->app->page . '_active', 'active');
 }
开发者ID:xepan,项目名称:cms,代码行数:25,代码来源:ServerSideComponentManager.php


示例2: init

 function init()
 {
     parent::init();
     if (!$this->api->auth->isLoggedIn()) {
         $this->js()->univ()->errorMessage('You Are Not Logged In')->execute();
     }
     if ($_POST['length'] != strlen($_POST['body_html'])) {
         $this->js()->univ()->successMessage('Length send ' . $_POST['length'] . " AND Length calculated again is " . strlen($_POST['body_html']))->execute();
     }
     if ($_POST['crc32'] != sprintf("%u", crc32($_POST['body_html']))) {
         $this->js()->univ()->successMessage('CRC send ' . $_POST['crc32'] . " AND CRC calculated again is " . sprintf("%u", crc32($_POST['body_html'])))->execute();
     }
     try {
         $content = $_POST['body_html'];
         include_once getcwd() . '/lib/phpQuery.php';
         $pq = new \phpQuery();
         $doc =& $pq->newDocument(trim($content));
         // include_once getcwd().'/lib/phpQuery.php';
         // $doc = \phpQuery::newDocument( $content );
         $server = $doc['[data-is-serverside-component=true]'];
         foreach ($doc['[data-is-serverside-component=true]'] as $ssc) {
             $pq->pq($ssc)->html("")->append($html);
         }
         $content = $doc->htmlOuter();
         $this->api->current_page['content'] = urldecode(trim($content));
         $this->api->current_page['body_attributes'] = urldecode($_POST['body_attributes']);
         $this->api->exec_plugins('epan-page-before-save', $this->api->current_page);
         $this->api->current_page->save();
         $this->api->exec_plugins('epan-page-after-save', $this->api->current_page);
         if ($_POST['take_snapshot'] == 'Y') {
             // $this->api->exec_plugins('epan-page-before-snapshot',$this->api->current_page);
             $new_version = $this->api->current_page->ref('EpanPageSnapshots');
             $new_version['title'] = $this->api->current_page['title'];
             $new_version['keywords'] = $this->api->current_page['keywords'];
             $new_version['description'] = $this->api->current_page['description'];
             $new_version['body_attributes'] = $this->api->current_page['body_attributes'];
             $new_version['content'] = $this->api->current_page['content'];
             $new_version->save();
             // $this->api->exec_plugins('epan-page-after-snapshot',$this->api->current_page);
         }
     } catch (Exception_StopInit $e) {
     } catch (Exception $e) {
         throw $e;
         $this->js()->univ()->errorMessage('Error... Could not save your page ' . $e->getMEssage())->excute();
         exit;
     }
     echo "saved";
     exit;
 }
开发者ID:xepan,项目名称:xepan,代码行数:49,代码来源:save.php


示例3: hyphenate

 public static function hyphenate($strBuffer)
 {
     global $objPage;
     $arrSkipPages = \Config::get('hyphenator_skipPages');
     if (is_array($arrSkipPages) && in_array($objPage->id, $arrSkipPages)) {
         return $strBuffer;
     }
     $o = new \Org\Heigl\Hyphenator\Options();
     $o->setHyphen(\Config::get('hyphenator_hyphen'))->setDefaultLocale(static::getLocaleFromLanguage($objPage->language))->setRightMin(\Config::get('hyphenator_rightMin'))->setLeftMin(\Config::get('hyphenator_leftMin'))->setWordMin(\Config::get('hyphenator_wordMin'))->setFilters(\Config::get('hyphenator_filter'))->setQuality(\Config::get('hyphenator_quality'))->setTokenizers(\Config::get('hyphenator_tokenizers'));
     $h = new \Org\Heigl\Hyphenator\Hyphenator();
     $h->setOptions($o);
     $doc = \phpQuery::newDocumentHTML($strBuffer);
     foreach (pq('body')->find(\Config::get('hyphenator_tags')) as $n => $item) {
         $strText = pq($item)->html();
         // ignore html tags, otherwise &shy; will be added to links for example
         if ($strText != strip_tags($strText)) {
             continue;
         }
         $strText = str_replace('&shy;', '', $strText);
         // remove manual &shy; html entities before
         $strText = $h->hyphenate($strText);
         if (is_array($strText)) {
             $strText = current($strText);
         }
         pq($item)->html($strText);
     }
     return $doc->htmlOuter();
 }
开发者ID:heimrichhannot,项目名称:contao-hyphenator,代码行数:28,代码来源:Hyphenator.php


示例4: search_query

function search_query($kw)
{
    $wf = new Workflows();
    $url = 'http://www.bilibili.tv/search?keyword=' . urlencode($kw) . '&orderby=&formsubmit=';
    $content = $wf->request($url, array(CURLOPT_ENCODING => 1));
    $doc = phpQuery::newDocumentHTML($content);
    $list = $doc->find('li.l');
    $i = 0;
    foreach ($list as $item) {
        $link = pq($item)->children('a:first')->attr('href');
        if (strpos($link, 'http') !== 0) {
            $link = 'http://www.bilibili.tv' . $link;
        }
        $info = pq($item)->find('div.info > i');
        $author = pq($item)->find('a.upper:first')->text();
        $view = $info->eq(0)->text();
        $comment = $info->eq(1)->text();
        $bullet = $info->eq(2)->text();
        $save = $info->eq(3)->text();
        $date = $info->eq(4)->text();
        $subtitle = 'UP主:' . $author . ' 播放:' . $view . ' 评论:' . $comment . ' 弹幕:' . $bullet . ' 收藏:' . $save . ' 日期:' . $date;
        $wf->result($i, $link, pq($item)->find('div.t:first')->text(), $subtitle, 'icon.png', 'yes');
        $i++;
    }
    if (count($wf->results()) == 0) {
        $wf->result('0', $url, '在bilibili.tv中搜索', $kw, 'icon.png', 'yes');
    }
    return $wf->toxml();
}
开发者ID:Frinstio,项目名称:AlfredWorkflow.com,代码行数:29,代码来源:search.php


示例5: finish

 public function finish()
 {
     phpQuery::newDocumentFileHTML($this->downloadUrl, $this->charset);
     $nodeCount = pq("#list2")->count();
     $articleList = pq("#list2 tr");
     echo "Start\n";
     for ($i = 0; $i < $this->loop; $i++) {
         echo '=';
     }
     echo "\n";
     $i = 0;
     foreach ($articleList as $tr) {
         $i++;
         if ($i <= 1) {
             # Filter the first node which has no meaning.
             continue;
         }
         $className = $tr->nodeValue;
         # This class order and its name.
         $classNameCombine = explode(' ', $className);
         $j = 0;
         $this->content[$i - 1]['chapterName'] = '';
         foreach ($classNameCombine as $k => $v) {
             # Put all class order and its name into $this->content array.
             $v = trim($v);
             if (empty($v)) {
                 continue;
             }
             $j++;
             if ($j == 1) {
                 $this->content[$i - 1]['chapterId'] = $v;
             } else {
                 $this->content[$i - 1]['chapterName'] .= $v . " ";
             }
         }
         $child = pq("td", $tr)->html();
         $trueContent = explode(' ', $child);
         $linkString = '';
         foreach ($trueContent as $k => $v) {
             $v = trim($v);
             if (empty($v)) {
                 continue;
             }
             if ($v == "<a") {
                 $linkString = $v . ' ' . $trueContent[$k + 1];
                 break;
             }
         }
         $urls = explode("\"", $linkString);
         $this->content[$i - 1]['link'] = $urls[1];
         //            $name = explode("<", $urls[2]);
         //            $name = substr($name[0], 1);
         //            $this->content[$i-1]['name'] = $name;
     }
     var_dump($this->content);
     for ($i = 0; $i < $this->loop; $i++) {
         echo '=';
     }
     echo "\nFinished! \n";
 }
开发者ID:niceforbear,项目名称:ohyeah,代码行数:60,代码来源:Ohyeah.php


示例6: getAllSubCategories

function getAllSubCategories($filename)
{
    $categories = unserialize(file_get_contents($filename));
    echo "---- run getAllSubCategories() ----\n\r";
    foreach ($categories as $j => $category) {
        if ($category['childrens']) {
            foreach ($category['childrens'] as $k => $children) {
                echo "---- crawling childrens for {$children['name']} ----\n\r";
                $doc = phpQuery::newDocumentHTML(fetch('http://www.walmart.com' . $children['link']));
                phpQuery::selectDocument($doc);
                foreach (pq('.shop-by-category li') as $el) {
                    echo "---- " . pq($el)->find('a')->attr('href') . "} ----\n\r";
                    $childrens[] = array('name' => pq($el)->find('a')->data('name'), 'link' => pq($el)->find('a')->attr('href'));
                }
                $categories[$j]['childrens'][$k]['childrens'] = $childrens;
            }
        }
    }
    echo "---- creating deparment file ----\n\r";
    $file = fopen($filename, 'w+');
    echo "---- writing deparment file ----\n\r";
    fputs($file, serialize($categories));
    echo "---- closing deparment file ----\n\r";
    fclose($file);
}
开发者ID:josueaponte7,项目名称:necotienda_standalone,代码行数:25,代码来源:walmart-v-0.1.php


示例7: first_image

 public function first_image($htmldata)
 {
     $pq = phpQuery::newDocumentHTML($htmldata);
     $img = $pq->find('img:first');
     $src = $img->attr('src');
     return $src;
 }
开发者ID:seyz4all,项目名称:kuvuki,代码行数:7,代码来源:kuvscrapper.php


示例8: parse_archive

 public function parse_archive(Archive $archive)
 {
     if ($archive->cover_mode) {
         return [$this->get_image_by_cover($archive->cover)];
     }
     $result = curl($archive->url, curl_options($this->domain));
     $archivePQ = \phpQuery::newDocumentHTML($result['data']);
     $content = $archivePQ['#content'];
     $title = $content['.entry-title']->html();
     $imgs = $content['.entry-content']->html();
     if (preg_match_all('#' . $this->domain . 'wp-content/[^"]*#', $imgs, $matches)) {
         $archive->images = array_merge(array_unique($matches[0]));
     }
     if (!$archive->images) {
         $title = $content['.main-title']->html();
         $imgs = $content['.main-body']->html();
         if (preg_match_all('#<a[^>]+href="(' . $this->domain . 'wp-content/[^"]*)">#', $imgs, $matches)) {
             $archive->images = array_merge(array_unique($matches[1]));
         }
     }
     if (strtolower($this->charset) != strtolower($GLOBALS['app_config']['charset'])) {
         $archive->title = iconv(strtoupper($this->charset), strtoupper($GLOBALS['app_config']['charset']) . '//IGNORE', $title);
     }
     $archive->title = $title;
 }
开发者ID:shfeat,项目名称:php-image-spider,代码行数:25,代码来源:Atfield.php


示例9: find_product_url

 public function find_product_url($product_name)
 {
     $url = 'http://ek.ua/';
     $data = array('search_' => $product_name);
     $response = Request::factory($url)->query($data)->execute();
     //echo Debug::vars($response->body());
     //echo Debug::vars($response->headers());
     $response = $response->body();
     try {
         $doc = phpQuery::newDocument($response);
     } catch (Exception $ex) {
         $errors[] = $ex->getMessage();
         echo Debug::vars($errors);
     }
     if (!isset($errors)) {
         /* Нужно взять заголовок и найти в нем слово найдено */
         /*
          * что я заметил, удивительно но на разных машинах этот заголовои идет с разным классом
          * на данный момент этот класс oth
          */
         $str = $doc->find('h1.oth')->html();
         if (preg_match('/найдено/', $str)) {
             echo Debug::vars('алилуя !!!');
             die;
         }
         return $str;
     }
 }
开发者ID:bruhanda,项目名称:parser,代码行数:28,代码来源:Parser.php


示例10: queryHTML

 /**
  * Query the response for a JQuery compatible CSS selector
  *
  * @link https://code.google.com/p/phpquery/wiki/Selectors
  * @param $selector string
  * @return phpQueryObject
  */
 public function queryHTML($selector)
 {
     if (is_null($this->pq)) {
         $this->pq = phpQuery::newDocument($this->content);
     }
     return $this->pq->find($selector);
 }
开发者ID:neosunchess,项目名称:dokuwiki,代码行数:14,代码来源:TestResponse.php


示例11: theContent

 function theContent($content)
 {
     $doc = phpQuery::newDocumentHTML($content);
     phpQuery::selectDocument($doc);
     foreach (pq('a') as $link) {
         $linkurl = pq($link)->attr('href');
         $linkHostname = $this->getUrlHostname($linkurl);
         if ($linkHostname != FALSE) {
             if (!in_array($linkHostname, $this->blockedDomains)) {
                 $linkHash = md5($linkurl);
                 $query = "SELECT * FROM {$this->tableBitlyExternal} WHERE id='{$linkHash}'LIMIT 1;";
                 $linkData = $this->db->get_row($query, ARRAY_A);
                 if (empty($linkData)) {
                     $bitly = new Bitly($this->bitlyUsername, $this->bitlyApikey);
                     $shortURL = $bitly->shorten($linkurl);
                     $shortURLData = get_object_vars($bitly->getData());
                     if (!empty($shortURLData)) {
                         $linkData = array('id' => $linkHash, 'url' => $linkurl, 'short_url' => $shortURLData['shortUrl'], 'hash' => $shortURLData['userHash'], 'created' => current_time('mysql'));
                         $this->db->insert($this->tableBitlyExternal, $linkData);
                     }
                 }
                 if (!empty($linkData)) {
                     pq($link)->attr('href', $linkData['short_url']);
                 }
             }
         }
     }
     return $doc->htmlOuter();
 }
开发者ID:hmimthiaz,项目名称:bitly-external,代码行数:29,代码来源:bitly-external.php


示例12: getLinkContent

 public function getLinkContent()
 {
     require_once './ThinkPHP/Library/Vendor/Collection/phpQuery.php';
     $link = op_t(I('post.url'));
     $content = get_content_by_url($link);
     $charset = preg_match("/<meta.+?charset=[^\\w]?([-\\w]+)/i", $content, $temp) ? strtolower($temp[1]) : "utf-8";
     \phpQuery::$defaultCharset = $charset;
     \phpQuery::newDocument($content);
     $title = pq("meta[name='title']")->attr('content');
     if (empty($title)) {
         $title = pq("title")->html();
     }
     $title = iconv($charset, "UTF-8", $title);
     $keywords = pq("meta[name='keywords'],meta[name='Keywords']")->attr('content');
     $description = pq("meta[name='description'],meta[name='Description']")->attr('content');
     $url = parse_url($link);
     $img = pq("img")->eq(0)->attr('src');
     if (is_bool(strpos($img, 'http://'))) {
         $img = 'http://' . $url['host'] . $img;
     }
     $title = text($title);
     $description = text($description);
     $keywords = text($keywords);
     $return['title'] = $title;
     $return['img'] = $img;
     $return['description'] = empty($description) ? $title : $description;
     $return['keywords'] = empty($keywords) ? $title : $keywords;
     exit(json_encode($return));
 }
开发者ID:ccccy,项目名称:wuanlife,代码行数:29,代码来源:LinkController.class.php


示例13: addclass

 public function addclass($html, $selector, $class)
 {
     require __DIR__ . '/phpQuery.php';
     $pq = \phpQuery::newDocument($html);
     $pq[$selector]->addClass($class);
     return new \Twig_Markup($pq, 'UTF-8');
 }
开发者ID:LeonB,项目名称:site,代码行数:7,代码来源:extension.php


示例14: ___render___

 /**
  * ___render___
  *
  * @method ___render___
  * @param {string} $content
  */
 protected function ___render___($content)
 {
     if ($content && is_string($content)) {
         if ($this->functions_for_render && (is_array($this->functions_for_render) || $this->functions_for_render instanceof ArrayObject)) {
             $before = $this->cache_read === true ? array() : array_filter((array) $this->functions_for_render, create_function('$v', 'return $v[\'after_cache\'] !== true;'));
             $after = array_filter((array) $this->functions_for_render, create_function('$v', 'return $v[\'after_cache\'] === true;'));
         } else {
             $before = $after = array();
         }
         if (0 < count($before) || 0 < count($after)) {
             $pq = phpQuery::newDocument($content);
             //before cache
             foreach ($before as $fn) {
                 $pq = call_user_func($fn, $pq);
             }
             if ($this->cache_file && !$this->cache_read) {
                 file_put_contents($this->cache_file, $pq);
             }
             //after cache
             foreach ($before as $fn) {
                 $pq = call_user_func($fn, $pq);
             }
             $content = $pq;
         } else {
             if ($this->cache_file) {
                 file_put_contents($this->cache_file, $content);
             }
         }
     }
     echo $content;
 }
开发者ID:nulil,项目名称:attophp,代码行数:37,代码来源:atto-static-site-wrapper-with-phpquery-dispatcher.php


示例15: go

    public function go()
    {
        require_once $_SERVER["DOCUMENT_ROOT"] . "/classes/XML.php";
        $xml = file_get_contents("http://alfabank.by/a-blog.xml");
        $rss = new \XML($xml);
        foreach ($rss->rss->channel->item as $it) {
            $dom = \phpQuery::newDocumentHTML($it->childByName("content:encoded"));
            $date = date_create($it->pubDate->getData());
            $arResult = array(
                "IBLOCK_ID" => self::ABLOG_IBLOCK_ID,
                "NAME" => $it->title->getData(),
                "DATE_ACTIVE_FROM" => date_format($date, 'd.m.Y'),
                "PREVIEW_TEXT" => $it->description->getData(),
                "PREVIEW_PICTURE" => \CFile::MakeFileArray($dom->find('img')->attr('src')),
                "DETAIL_TEXT" => $it->childByName("content:encoded"),
                "CODE" => \Ns\Bitrix\Helper::Create('iblock')->useVariant('text')->translite($it->title->getData()),
                "PROPERTY_VALUES" => array("ORIGINAL_LINK" => $it->link->getData())
            );
            $this->objElement->Add($arResult);
            if ($this->objElement->LAST_ERROR) {
                prentExpection($this->objElement->LAST_ERROR);
            }
        }

        return true;
	}
开发者ID:ASDAFF,项目名称:bitrix_tehnomir,代码行数:26,代码来源:ABlog.php


示例16: test_data

 public function test_data()
 {
     $this->prepareLookup();
     $this->preparePages();
     $access = AccessTable::byTableName('dropdowns', 'test1');
     $data = $access->getData();
     $this->assertEquals('["1","[\\"title1\\",\\"This is a title\\"]"]', $data[0]->getValue());
     $this->assertEquals('["1","title1"]', $data[1]->getValue());
     $this->assertEquals('John', $data[2]->getValue());
     $this->assertEquals('1', $data[0]->getRawValue());
     $this->assertEquals('1', $data[1]->getRawValue());
     $this->assertEquals('John', $data[2]->getRawValue());
     $this->assertEquals('This is a title', $data[0]->getDisplayValue());
     $this->assertEquals('title1', $data[1]->getDisplayValue());
     $this->assertEquals('John', $data[2]->getDisplayValue());
     $R = new \Doku_Renderer_xhtml();
     $data[0]->render($R, 'xhtml');
     $pq = \phpQuery::newDocument($R->doc);
     $this->assertEquals('This is a title', $pq->find('a')->text());
     $this->assertContains('title1', $pq->find('a')->attr('href'));
     $R = new \Doku_Renderer_xhtml();
     $data[1]->render($R, 'xhtml');
     $pq = \phpQuery::newDocument($R->doc);
     $this->assertEquals('title1', $pq->find('a')->text());
     $this->assertContains('title1', $pq->find('a')->attr('href'));
     $R = new \Doku_Renderer_xhtml();
     $data[2]->render($R, 'xhtml');
     $this->assertEquals('John', $R->doc);
 }
开发者ID:cosmocode,项目名称:dokuwiki-plugin-struct,代码行数:29,代码来源:Type_Dropdown.test.php


示例17: addBackendAdminMenu

 public function addBackendAdminMenu($strBuffer, $strTemplate)
 {
     if ($strTemplate != 'be_main' || !\BackendUser::getInstance()->isAdmin) {
         return $strBuffer;
     }
     // replace the scripts before processing -> https://code.google.com/archive/p/phpquery/issues/212
     $arrScripts = StringUtil::replaceScripts($strBuffer);
     $objDoc = \phpQuery::newDocumentHTML($arrScripts['content']);
     $objMenu = new BackendTemplate($this->strTemplate);
     $arrActions = array();
     $arrActiveActions = deserialize(\Config::get('backendAdminMenuActiveActions'), true);
     foreach (empty($arrActiveActions) ? array_keys(\Config::get('backendAdminMenuActions')) : $arrActiveActions as $strAction) {
         $arrActionData = $GLOBALS['TL_CONFIG']['backendAdminMenuActions'][$strAction];
         $objAction = new BackendTemplate($this->strEntryTemplate);
         $objAction->setData($arrActionData);
         // href = callback?
         if (is_array($arrActionData['href']) || is_callable($arrActionData['href'])) {
             $strClass = $arrActionData['href'][0];
             $strMethod = $arrActionData['href'][1];
             $objInstance = \Controller::importStatic($strClass);
             $objAction->href = $objInstance->{$strMethod}();
         }
         $objAction->class = $strAction;
         $arrActions[] = $objAction->parse();
     }
     $objMenu->actions = $arrActions;
     $objDoc['#tmenu']->prepend($objMenu->parse());
     $strBuffer = StringUtil::unreplaceScripts($objDoc->htmlOuter(), $arrScripts['scripts']);
     // avoid double escapings introduced by phpquery :-(
     $strBuffer = preg_replace('@&amp;([^;]{2,4};)@i', '&$1', $strBuffer);
     return $strBuffer;
 }
开发者ID:heimrichhannot,项目名称:contao-backend_admin_menu,代码行数:32,代码来源:BackendAdminMenu.php


示例18: start_el

 function start_el(&$output, $object, $depth = 0, $args = array(), $current_object_id = 0)
 {
     // append next menu element to $output
     parent::start_el($output, $object, $depth, $args, $current_object_id);
     // now let's add a custom form field
     if (!class_exists('phpQuery')) {
         // load phpQuery at the last moment, to minimise chance of conflicts (ok, it's probably a bit too defensive)
         require_once 'phpQuery-onefile.php';
     }
     $_doc = phpQuery::newDocumentHTML($output);
     $_li = phpQuery::pq('li.menu-item:last');
     // ":last" is important, because $output will contain all the menu elements before current element
     // if the last <li>'s id attribute doesn't match $item->ID something is very wrong, don't do anything
     // just a safety, should never happen...
     $menu_item_id = str_replace('menu-item-', '', $_li->attr('id'));
     if ($menu_item_id != $object->ID) {
         return;
     }
     // fetch previously saved meta for the post (menu_item is just a post type)
     $curr_bg = esc_attr(get_post_meta($menu_item_id, 'snpshpwp_menu_item_bg', TRUE));
     $curr_bg_pos = esc_attr(get_post_meta($menu_item_id, 'snpshpwp_menu_item_bg_pos', TRUE));
     $curr_upldr = '<span class="button media_upload_button" id="snpshpwp_upload_' . $menu_item_id . '">' . __('Upload', 'snpshpwp') . '</span>';
     // by means of phpQuery magic, inject a new input field
     $_li->find('a.item-delete')->before("\n\t\t\t\t\t<p class='snpshpwp_menu_item_bg description description-thin'>\n\t\t\t\t\t<label for='snpshpwp_menu_item_bg_{$menu_item_id}'>" . __('Background image', 'snpshpwp') . "<br/>\n\t\t\t\t\t<input type='text' value='{$curr_bg}' name='snpshpwp_menu_item_bg_{$menu_item_id}' /><br/>\n\t\t\t\t\t</label>\n\t\t\t\t\t{$curr_upldr}\n\t\t\t\t\t</p>\n\t\t\t\t\t<p class='snpshpwp_menu_item_bg_pos description description-thin'>\n\t\t\t\t\t<label for='snpshpwp_menu_item_bg_{$menu_item_id}'>" . __('Background orientation', 'snpshpwp') . "<br/>\n\t\t\t\t\t<select name='snpshpwp_menu_item_bg_pos_{$menu_item_id}'>\n\t\t\t\t\t\t<option value='left-landscape'" . ($curr_bg_pos == 'left-landscape' ? ' selected' : '') . ">" . __('Left Landscape', 'snpshpwp') . "</option>\n\t\t\t\t\t\t<option value='left-portraid'" . ($curr_bg_pos == 'left-portraid' ? ' selected' : '') . ">" . __('Left Portraid', 'snpshpwp') . "</option>\n\t\t\t\t\t\t<option value='right-landscape'" . ($curr_bg_pos == 'right-landscape' ? ' selected' : '') . ">" . __('Right Landscape', 'snpshpwp') . "</option>\n\t\t\t\t\t\t<option value='right-portraid'" . ($curr_bg_pos == 'right-portraid' ? ' selected' : '') . ">" . __('Right Portraid', 'snpshpwp') . "</option>\n\t\t\t\t\t\t<option value='pattern-repeat'" . ($curr_bg_pos == 'pattern-repeat' ? ' selected' : '') . ">" . __('Pattern', 'snpshpwp') . "</option>\n\t\t\t\t\t\t<option value='framed-full'" . ($curr_bg_pos == 'framed-full' ? ' selected' : '') . ">" . __('Framed', 'snpshpwp') . "</option>\n\t\t\t\t\t</select>\n\t\t\t\t\t</label>\n\t\t\t\t\t</p>\n\t\t\t\t\t");
     // swap the $output
     $output = $_doc->html();
 }
开发者ID:bergvogel,项目名称:stayuplate,代码行数:27,代码来源:snpshpwp-menu.php


示例19: testShowData

 function testShowData()
 {
     $handler = new Doku_Handler();
     $xhtml = new Doku_Renderer_xhtml();
     $plugin = new syntax_plugin_data_entry();
     $result = $plugin->handle($this->exampleEntry, 0, 10, $handler);
     $plugin->_showData($result, $xhtml);
     $doc = phpQuery::newDocument($xhtml->doc);
     $this->assertEquals(1, pq('div.inline.dataplugin_entry.projects', $doc)->length);
     $this->assertEquals(1, pq('dl dt.type')->length);
     $this->assertEquals(1, pq('dl dd.type')->length);
     $this->assertEquals(1, pq('dl dt.volume')->length);
     $this->assertEquals(1, pq('dl dd.volume')->length);
     $this->assertEquals(1, pq('dl dt.employee')->length);
     $this->assertEquals(1, pq('dl dd.employee')->length);
     $this->assertEquals(1, pq('dl dt.customer')->length);
     $this->assertEquals(1, pq('dl dd.customer')->length);
     $this->assertEquals(1, pq('dl dt.deadline')->length);
     $this->assertEquals(1, pq('dl dd.deadline')->length);
     $this->assertEquals(1, pq('dl dt.server')->length);
     $this->assertEquals(1, pq('dl dd.server')->length);
     $this->assertEquals(1, pq('dl dt.website')->length);
     $this->assertEquals(1, pq('dl dd.website')->length);
     $this->assertEquals(1, pq('dl dt.task')->length);
     $this->assertEquals(1, pq('dl dd.task')->length);
     $this->assertEquals(1, pq('dl dt.tests')->length);
     $this->assertEquals(1, pq('dl dd.tests')->length);
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:28,代码来源:syntax_plugin_data_entry.test.php


示例20: go

    public function go()
    {
        try
        {
            $this->checker = \Ns\Bitrix\Helper::Create('iblock')->useVariant('checker');
        }
        catch (\Exception $e)
        {
            prentExpection($e->getMessage());
        }
        foreach ($this->dom->find("table.fileinfo") as $table)
        {
            $this->arFields = array();
            $this->arFields["IBLOCK_ID"] = self::ALFADOCUMENTS_IBLOCK_ID;
            $table = \phpQuery::pq($table);
            $this->arFields["NAME"] = $table->find('a:eq(1)')->text();
            $this->arFields["PROPERTY_VALUES"]["LINK"] = $table->find('a:eq(1)')->attr("href");
            prent($this->arFields);
            $this->Add();

        }
        /**
         * Check and add element to infoblock Terminals
         */

        return true;
	}
开发者ID:ASDAFF,项目名称:bitrix_tehnomir,代码行数:27,代码来源:AlfaDocuments.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP phpThumb类代码示例发布时间:2022-05-23
下一篇:
PHP phpFreeChat类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap