<h5><a href="/mediathek/mediatheksuche103_broadcast-30.html">Nordmagazin</a></h5>
169732
@Override
    protected void addToList() {
        //<broadcast id="1391" site="ndrfernsehen">45 Min</broadcast>
        final String ADRESSE = "https://www.ndr.de/mediathek/sendungen_a-z/index.html";
        final String MUSTER_URL1 = "<li><a href=\"/mediathek/mediatheksuche105_broadcast-";
        listeThemen.clear();

        meldungStart();

        MSStringBuilder seite = new MSStringBuilder(Const.STRING_BUFFER_START_BUFFER);
        final GetUrl getUrlIo = new GetUrl(getWartenSeiteLaden());
        seite = getUrlIo.getUri(SENDERNAME, ADRESSE, StandardCharsets.UTF_8, 5 /* versuche */, seite, ""/* meldung */);
        int pos = 0;
        int pos1;
        int pos2;
        String url = "";
        String thema = "";
        while ((pos = seite.indexOf(MUSTER_URL1, pos)) != -1) {
            try {
                pos += MUSTER_URL1.length();
                pos1 = pos;
                if ((pos2 = seite.indexOf("\"", pos)) != -1) {
                    url = seite.substring(pos1, pos2);
                }
                pos1 = seite.indexOf(">", pos);
                pos2 = seite.indexOf("<", pos);
                if (pos1 != -1 && pos2 != -1 && pos1 < pos2) {
                    thema = seite.substring(pos1 + 1, pos2);
                }
                if (url.isEmpty()) {
                    Log.errorLog(210367600, "keine Url");
                    continue;
                }
                String url_ = "https://www.ndr.de/mediathek/mediatheksuche105_broadcast-" + url;
                String[] add = new String[]{url_, thema};
                if (CrawlerTool.loadLongMax()) {
                    if (!alleSeiteSuchen(url_, thema)) {
                        // dann halt so versuchen
                        listeThemen.addUrl(add);
                    }
                } else {
                    listeThemen.addUrl(add);
                }
            } catch (Exception ex) {
                Log.errorLog(332945670, ex);
            }
        }
        // noch "Verpasst" für die letzten Tage einfügen
        // https://www.ndr.de/mediathek/sendung_verpasst/epg1490_date-2014-05-17.html
        // https://www.ndr.de/mediathek/sendung_verpasst/epg1490_date-2014-05-17_display-onlyvideo.html
        FastDateFormat formatter1 = FastDateFormat.getInstance("yyyy-MM-dd");
        FastDateFormat formatter2 = FastDateFormat.getInstance("dd.MM.yyyy");
        final int maxTage = CrawlerTool.loadLongMax() ? 30 : 20;
        for (int i = 0; i < maxTage; ++i) {
            // https://www.ndr.de/mediathek/sendung_verpasst/epg1490_date-2015-09-05_display-all.html
            final String URL = "https://www.ndr.de/mediathek/sendung_verpasst/epg1490_date-";
            final String tag = formatter1.format(new Date().getTime() - (1000 * 60 * 60 * 24 * i));
            final String date = formatter2.format(new Date().getTime() - (1000 * 60 * 60 * 24 * i));
            //String urlString = URL + tag + "_display-onlyvideo.html"; --> stimmt leider nicht immer
            final String urlString = URL + tag + "_display-all.html";
            listeThemen.addUrl(new String[]{urlString, date});
        }

        if (Config.getStop()) {
            meldungThreadUndFertig();
        } else if (listeThemen.isEmpty()) {
            meldungThreadUndFertig();
        } else {
            meldungAddMax(listeThemen.size());
            for (int t = 0; t < getMaxThreadLaufen(); ++t) {
                Thread th = new ThemaLaden();
                th.setName(SENDERNAME + t);
                th.start();
            }
        }
    }
1129372
public function dispatchAction()
    {
        //pobranie kategorii
        $category = $this->_getPublishedCategoryByUri($this->uri);
        //wpięcie kategorii do głównego widoku aplikacji
        FrontController::getInstance()->getView()->category = $category;
        //klucz bufora
        $cacheKey = 'category-html-' . $category->id;
        //buforowanie dozwolone
        $bufferingAllowed = $this->_bufferingAllowed();
        //wczytanie zbuforowanej strony (dla niezalogowanych i z pustym requestem)
        if ($bufferingAllowed && (null !== $html = \App\Registry::$cache->load($cacheKey))) {
            //wysyłanie nagłówka o buforowaniu strony
            $this->getResponse()->setHeader('X-Cache', 'HIT');
            //zwrot html
            return $this->_decorateHtmlWithEditButton($html, $category);
        }
        //wysyłanie nagłówka o braku buforowaniu strony
        $this->getResponse()->setHeader('X-Cache', 'MISS');
        //przekazanie rekordu kategorii do widoku
        $this->view->category = $category;
        //renderowanie docelowej akcji
        $html = \Mmi\Mvc\ActionHelper::getInstance()->forward($this->_prepareForwardRequest($category));
        //buforowanie niedozwolone
        if (!$bufferingAllowed || 0 == $cacheLifetime = $this->_getCategoryCacheLifetime($category)) {
            //zwrot html
            return $this->_decorateHtmlWithEditButton($html, $category);
        }
        //zapis html kategorii do cache
        \App\Registry::$cache->save($html, $cacheKey, $cacheLifetime);
        //zwrot html
        return $this->_decorateHtmlWithEditButton($html, $category);
    }
859323
def media(request):
    """"""
    return {
        'PAGES_MEDIA_URL': settings.PAGES_MEDIA_URL,
        'PAGES_STATIC_URL': settings.PAGES_STATIC_URL,
        'PAGE_USE_SITE_ID': settings.PAGE_USE_SITE_ID,
        'PAGE_HIDE_SITES': settings.PAGE_HIDE_SITES,
        'PAGE_LANGUAGES': settings.PAGE_LANGUAGES,
    }
289293
function MediaType (type, subtype, suffix) {
  this.type = type
  this.subtype = subtype
  this.suffix = suffix
}
105716
public static function media($image, $heading, $content, $htmlOptions = array())
    {
        $tag = TbArray::popValue('tag', $htmlOptions, 'div');
        self::addCssClass('media', $htmlOptions);
        $linkOptions = TbArray::popValue('linkOptions', $htmlOptions, array());
        TbArray::defaultValue('pull', self::PULL_LEFT, $linkOptions);
        $imageOptions = TbArray::popValue('imageOptions', $htmlOptions, array());
        self::addCssClass('media-object', $imageOptions);
        $contentOptions = TbArray::popValue('contentOptions', $htmlOptions, array());
        self::addCssClass('media-body', $contentOptions);
        $headingOptions = TbArray::popValue('headingOptions', $htmlOptions, array());
        self::addCssClass('media-heading', $headingOptions);
        $items = TbArray::popValue('items', $htmlOptions);

        $output = self::openTag($tag, $htmlOptions);
        $alt = TbArray::popValue('alt', $imageOptions, '');
        $href = TbArray::popValue('href', $linkOptions, '#');
        if (!empty($image)) {
            $output .= self::link(parent::image($image, $alt, $imageOptions), $href, $linkOptions);
        }
        $output .= self::openTag('div', $contentOptions);
        $output .= self::tag('h4', $headingOptions, $heading);
        $output .= $content;
        if (!empty($items)) {
            $output .= self::medias($items);
        }
        $output .= '</div>';
        $output .= self::closeTag($tag);
        return $output;
    }
1231360
public function enregistreEntreeSondage()
	{
		if (isset($this->variablesPost['choixSondage']) && is_array($this->variablesPost['choixSondage'])) {
			if (count($this->variablesPost['choixSondage'])>0) {
				// on verifie que la personne n'a pas encore fait de proposition aujourd'hui
				$ip = $_SERVER['REMOTE_ADDR'];
				if ($ip!='') {
					$reqVerif = "SELECT idResultat FROM sondagesResultats WHERE ip like '$ip' AND date=CURDATE()";
					$resVerif = $this->connexionBdd->requete($reqVerif);
					if (mysql_num_rows($resVerif)>0) {
						echo "<br><span style='color:red;'>"._("Votre participation a déjà été enregistrée.")."</span><br>";
					} else {
						// enregistrement
						foreach ($this->variablesPost['choixSondage'] as $indice => $idProposition) {
							$reqInsert = "INSERT INTO sondagesResultats (idSondage, date, ip, idProposition) VALUES ('1', now(), '".$ip."', '".$idProposition."')";
							$resInsert = $this->connexionBdd->requete($reqInsert);
						}
					}
				} else {
					echo "<br><span style='color:red;'>"._("Votre vote n'a pas pu être enregistré.")."</span><br>";
				}
			} else {
				echo "<br><span style='color:red;'>"._("Vous n'avez selectionné aucune proposition.")."</span><br>";
			}
		}
	}
417873
protected function getDefaultBanner()
	{
		$arrImageSize = array();
		//CSS-ID/Klasse(n) je Banner, für den wrapper
		$banner_cssID   = '';
		$banner_class   = ' banner_default';
				
		//BannerDefault gewünscht und vorhanden?
		if ( $this->arrCategoryValues['banner_default'] == '1' 
            && strlen($this->arrCategoryValues['banner_default_image']) > 0 
	       ) 
		{
			//Template setzen
			if ( ($this->banner_template != $this->strTemplate) 
			  && ($this->banner_template != '') ) 
			{
			    $this->strTemplate = $this->banner_template;
			    $this->Template = new \FrontendTemplate($this->strTemplate);
			}
			//Link je nach Ausgabeformat
			if ($this->strFormat == 'xhtml') 
			{
			    $banner_default_target = ($this->arrCategoryValues['banner_default_target'] == '1') ? LINK_BLUR : LINK_NEW_WINDOW;
			} 
			else 
			{
			    $banner_default_target = ($this->arrCategoryValues['banner_default_target'] == '1') ? '' : ' target="_blank"';
			}
			//BannerImage Class
			$this->BannerImage = new \Banner\BannerImage();
			 
			//Banner Art bestimmen
			$arrImageSize = $this->BannerImage->getBannerImageSize($this->arrCategoryValues['banner_default_image'], self::BANNER_TYPE_INTERN);
			// 1 = GIF, 2 = JPG, 3 = PNG
			// 4 = SWF, 13 = SWC (zip-like swf file)
			// 5 = PSD, 6 = BMP, 7 = TIFF(intel byte order), 8 = TIFF(motorola byte order)
			// 9 = JPC, 10 = JP2, 11 = JPX, 12 = JB2, 13 = SWC, 14 = IFF

			//fake the Picture::create
			$picture['img']   = array
			(
			    'src'    => $this->urlEncode($this->arrCategoryValues['banner_default_image']),
			    'width'  => $arrImageSize[0],
			    'height' => $arrImageSize[1],
			    'srcset' => $this->urlEncode($this->arrCategoryValues['banner_default_image'])
			);
			$picture['alt']   = specialchars(ampersand($this->arrCategoryValues['banner_default_name']));
			$picture['title'] = '';
			
			ModuleBannerLog::writeLog(__METHOD__ , __LINE__ , 'Fake Picture: '. print_r($picture,true));
			
			switch ($arrImageSize[2]) 
			{
			    case 1:
			    case 2:
			    case 3:
			        $arrBanners[] = array
							        (
							        'banner_key'     => 'defbid=',
							        'banner_wrap_id'    => $banner_cssID,
							        'banner_wrap_class' => $banner_class,
							        'banner_id'      => $this->arrCategoryValues['id'],
							        'banner_name'    => specialchars(ampersand($this->arrCategoryValues['banner_default_name'])),
							        'banner_url'     => $this->arrCategoryValues['banner_default_url'],
							        'banner_target'  => $banner_default_target,
							        'banner_comment' => specialchars(ampersand($this->arrCategoryValues['banner_default_name'])),
							        'src'            => $this->urlEncode(      $this->arrCategoryValues['banner_default_image']),
							        'alt'            => specialchars(ampersand($this->arrCategoryValues['banner_default_name'])),
							        'size'     		 => '',
							        'banner_pic'     => true,
							        'banner_flash'   => false,
							        'banner_text'    => false,
							        'banner_empty'   => false,	// issues 733
							        'picture'        => $picture
							        );
			        break;
			    case 4:  // Flash swf
			    case 13: // Flash swc
			        list($usec, ) = explode(" ", microtime());
			        $arrBanners[] = array
							        (
					                'banner_key'     => 'defbid=',
						            'banner_wrap_id'    => $banner_cssID,
						            'banner_wrap_class' => $banner_class,
					                'banner_id'      => $this->arrCategoryValues['id'],
					                'banner_name'    => specialchars(ampersand($this->arrCategoryValues['banner_default_name'])),
					                'banner_url'     => $this->arrCategoryValues['banner_default_url'],
					                'banner_target'  => $banner_default_target,
					                'banner_comment' => specialchars(ampersand($this->arrCategoryValues['banner_default_name'])),
					                'swf_src'        => $this->arrCategoryValues['banner_default_image'],
					                'swf_width'      => $arrImageSize[0],
					                'swf_height'     => $arrImageSize[1],
					                'swf_id'         => round((float)$usec*100000,0).'_'.$this->arrCategoryValues['id'],
					                'alt'            => specialchars(ampersand($this->arrCategoryValues['banner_default_name'])),
					                'banner_pic'     => false,
					                'banner_flash'   => true,
					                'banner_text'    => false,
					                'banner_empty'   => false	// issues 733
							        );
			        break;
			}
			$arrResults[] = $arrBanners[0];
			$this->Template->banners = $arrResults;
			return true;
		}
		//Kein BannerDefault
		$NoBannerFound = ($GLOBALS['TL_LANG']['MSC']['tl_banner']['noBanner']) ? $GLOBALS['TL_LANG']['MSC']['tl_banner']['noBanner'] : 'no banner, no default banner';
		$arrBanners[] = array
		(
		        'banner_key'  => 'bid=',
    		    'banner_wrap_id'    => $banner_cssID,
    		    'banner_wrap_class' => $banner_class,
		        'banner_id'   => 0,
		        'banner_name' => specialchars(ampersand($NoBannerFound)),
		        'banner_url'  => '',
		        'banner_target'  => '',
		        'banner_comment' => '',
		        'src' 			=> '',
		        'alt' 			=> '',
		        'size'     		=> '',
		        'banner_pic' 	=> false,
		        'banner_flash'  => false,
		        'banner_text'   => false,
		        'banner_empty'  => true	// issues 733
		);
		$arrResults[] = $arrBanners[0];
		//Ausblenden wenn leer?
		if ($this->banner_hideempty == 1)
		{
		    // auf Leer umschalten
		    $this->strTemplate='mod_banner_empty';
		    $this->Template->arrCategoryValues = $this->arrCategoryValues; // #176
		    $this->Template = new \FrontendTemplate($this->strTemplate);
		}
		$this->Template->banners = $arrResults;
		
		return true;
	}
883653
public function updateArticle($mediaId, $article, $index = 0)
    {
        $params = [
            'media_id' => $mediaId,
            'index' => $index,
            'articles' => isset($article['title']) ? $article : (isset($article[$index]) ? $article[$index] : []),
        ];
        return $this->post(self::API_NEWS_UPDATE, $params);
    }
495230
public function getHtmlFromAdressesNoPauseWithGeoLocalization()
    {
        $html="<div id='".$this->googleMapNameId."' style='width: ".$this->googleMapWidth."px; height: ".$this->googleMapHeight."px;'>Veuillez patienter pendant le chargement de la carte...</div>";

        $html.="<script  >";

        /*if (count($this->coordonnees)>0) {
            foreach ($this->coordonnees as $indice => $value) {
                if (isset($value['link'])) {
                    $html.="tabAdresses[".$indice."]=\"".$value['link']."\";\n";
                }
            }
        }*/

        $html.="</script>";
        //$html.="<div id='".$this->googleMapNameId."' style='width: ".$this->googleMapWidth."px; height: ".$this->googleMapHeight."px;'>Veuilliez patienter pendant le chargement de la carte...</div>";

        if ($this->debugMode)
            $displayDebug='block';
        else
            $displayDebug='none';

        //$html.="<div style='width:500px; height:300px;overflow:scroll;display:".$displayDebug.";' id='debugGoogleMap'></div>";
        $html.="<script>load();</script>";

        // fonction appelant les affichages de coordonnées ,  appels regroupées dans une fonction qui groupe les coordonnées par paquet ,  afin de ne pas trop en envoyer a la fois
        /*if (count($this->coordonnees)>0) {
            $html.="<script  >";
            $html.="var numPaquet=0;\n";
            $html.="var timer;\n";
            $html.="startTimerPaquets();\n";
            $html.="function startTimerPaquets()\n";
            $html.="{";
            $html.="afficheCoordonneesParPaquets();\n";
            $html.="timer = setInterval(\"afficheCoordonneesParPaquets()\", ".$this->setTimeOutPaquets.");\n";
            $html.="}\n";

            $html.="function afficheCoordonneesParPaquets(){\n";
            $i=0;
            $numPaquet = 0;
            foreach ($this->coordonnees as $indice => $value) {
                $image = ", \"http://www.google.com/mapfiles/marker.png\"";//
                if (isset($value['imageFlag']) && $value['imageFlag']!='') {
                    $image = ", \"".$value['imageFlag']."\"";
                }

                if ($i%10==0) {
                    $html.="if (numPaquet==".$numPaquet.")\n";
                    $html.="{\n";
                    $iDebut = $i;
                }

                $html.=" getCoordonnees(\"".$value['adresse']."\", ".$indice." ".$image.");\n";

                if ($i==$iDebut+9 || $i==count($this->coordonnees)-1 ) {
                    $html.="}\n";
                    $numPaquet++;
                }
                $i++;
            }


            $html.="if (numPaquet>".$numPaquet.")\n";
            $html.="{\n";
            $html.="clearInterval(timer);\n";
            $html.="}\n";
            $html.="numPaquet++;\n";
            $html.="}\n";
            $html.="</script>";
        }*/


        $html.="<script language = 'javascript'>";
        foreach ($this->coordonnees as $indice => $values) {
            if (isset($values['latitude']) && $values['latitude']!='' && isset($values['longitude']) && $values['longitude']!='') {
                $urlImage = $values['imageFlag'];
                if (!isset($values['imageHeight']) && !isset($values['imageWidth'])) {
                    list($imageSizeX,  $imageSizeY,  $typeImage,  $attrImage) = getimagesize($values['pathToImageFlag']);
                } else {
                    $imageSizeX = $values['imageWidth'];
                    $imageSizeY = $values['imageHeight'];
                }

                $html.="
                    var icon = new GIcon();
                    //icon.image = image;


                    icon.image = \"$urlImage\";
                    //icon.shadow = \"https://labs.google.com/ridefinder/images/mm_20_shadow.png\";
                    icon.iconSize = new GSize($imageSizeX,  $imageSizeY);
                    icon.shadowSize = new GSize(22,  20);
                    icon.iconAnchor = new GPoint(2,  24);
                    icon.infoWindowAnchor = new GPoint(5,  1);
                    var iconMarker = new GIcon(icon);";



                $html.="

                    point$indice = new GLatLng(".$values['latitude'].", ".$values['longitude'].");
                    marker$indice = new GMarker(point$indice, iconMarker);
                    overlay$indice = map.addOverlay(marker$indice);
                    //marker$indice.openInfoWindowHtml(\"".$values['link']."\");

                    ";

                $html.="
                            function onClickFunction$indice(overlay,  point){marker$indice.openInfoWindowHtml(\"".$values['link']."\");}";

                $html.="GEvent.addListener(marker$indice,  'click',  onClickFunction$indice);";
            }


        }

        $html.="</script>";



        if ($this->debugMode)
            $displayDebug='block';
        else
            $displayDebug='none';

        $html.="<div style='width:500px; height:300px;overflow:scroll;display:".$displayDebug.";' id='debugGoogleMap'></div>";
        return $html;
    }
464875
@Override
	public void doTag() throws JspException, IOException {
		try {
			JspContext  context     = getJspContext();
			JspFragment fragment    = getJspBody();
            PageContext pageContext = (PageContext) context;
			
            // invoke before event
			beforeDoTag(context, fragment);

            // 내장객체 추가
            innerInstance.put("param",   TagUtils.getRequestParameterMap(pageContext));
            innerInstance.put("request", TagUtils.getRequestAttributeMap(pageContext));
            innerInstance.put("session", TagUtils.getSessionAttributeMap(pageContext));
            innerInstance.put("cookie",  TagUtils.getCookieMap(pageContext));
            innerInstance.putAll(dynamicAttrMap);

            Object[]  params      = new Object[] { this, innerInstance };
            String    mustacheKey = getClass().getCanonicalName();
            AXUConfig config      = ConfigReader.getConfig();

            if (this instanceof CustomTag) {
                CustomTag customTag = (CustomTag) this;
                mustacheKey = mustacheKey + "#" + customTag.getCustomid();
            }

            mustacheHtml = mustacheCacheMap.get(mustacheKey);
            if (mustacheHtml == null) {
				if (tagBody == null) {
					throw new RuntimeException("tag body is empty. please check your aux4j.xml");
				}

                mustacheHtml = mustacheFactory.compile(new StringReader(tagBody), mustacheKey);

                if (!StringUtils.equalsIgnoreCase("DEV", config.getMode())) {
                    mustacheCacheMap.put(mustacheKey, mustacheHtml);
                }
            }
            mustacheHtml.execute(context.getOut(), params);

            // invoke after event
			afterDoTag(context, fragment);
			
		} catch (Exception e) {
			logger.error(String.format("doTag is fail.\ntagBody: %s\nmustacheHtml: %s", tagBody, (mustacheHtml == null ? "null" : mustacheHtml.toString())), e);
		}

	}
131681
def link_tag(protocol, base_url, view)
      view.tag :link, :rel => 'alternate', :href => href(protocol, base_url), :id => id, :media => media_query
    end
583026
def send_news_message(self, user_id, media_id, kf_account=None):
        
        data = {
            "touser": user_id,
            "msgtype": "mpnews",
            "mpnews": {
                "media_id": media_id
            }
        }
        if kf_account is not None:
            data['customservice'] = {'kf_account': kf_account}
        return self.post(
            url="https://api.weixin.qq.com/cgi-bin/message/custom/send",
            data=data
        )
282135
public function afficheListeRegroupee()
    {
        $html="";
        $t=new Template($this->getCheminPhysique().$this->cheminTemplates);
        $t->set_filenames((array('listeRegroupee'=>'listeRegroupee.tpl')));

        $r = new archiRecherche();


        if (isset($this->variablesGet['modeAffichageListe'])) {
            $modeAffichageListe = $this->variablesGet['modeAffichageListe'];
        } else {
            $modeAffichageListe = 'default';
        }
        $idVilleGeneral = 1;  // strasbourg par defaut
        $s = new objetSession();

        if ($s->isInSession('archiIdVilleGeneral') && $s->getFromSession('archiIdVilleGeneral')!='') {
            $idVilleGeneral = $s->getFromSession('archiIdVilleGeneral');
        } elseif (isset($this->variablesGet['archiIdVilleGeneral'])) {
            $idVilleGeneral = $this->variablesGet['archiIdVilleGeneral'];
            $s->addToSession('archiIdVilleGeneral', $idVilleGeneral);
        }

        $fetchInfosVille = $this->getInfosVille($idVilleGeneral, array('fieldList'=>'v.nom as nomVille'));

        $nomVilleGeneral = $fetchInfosVille['nomVille'];

        $t->assign_vars(array('liens'=>"<a href='".$this->creerUrl('', 'listeDossiers', array('modeAffichageListe'=>'parRues','archiIdVilleGeneral'=>$idVilleGeneral))."'>"._("Par rues de")." ".$nomVilleGeneral."</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href='".$this->creerUrl('', 'listeDossiers', array('modeAffichageListe'=>'parQuartiers','archiIdVilleGeneral'=>$idVilleGeneral))."'>"._("Par quartiers de")." ".$nomVilleGeneral."</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href='".$this->creerUrl('', 'listeDossiers', array('modeAffichageListe'=>'parVilles'))."'>"._("Par villes")."</a>",

        ));

        switch ($modeAffichageListe) {
            case 'parQuartiers':
                $pagination = new paginationObject();

                $arrayQuartiers = $this->getIdQuartiersFrom($idVilleGeneral, 'ville');

                $arrayQuartiersNotEmpty = $r->getIdQuartiersNotEmpty();


                $arrayListeQuartiersNotEmpty = array();
                $arrayListeAlphabetique = array();
                foreach ($arrayQuartiers as $indice => $idQuartier) {
                    if (in_array($idQuartier, $arrayQuartiersNotEmpty['arrayListeQuartiersNonVides'])) {
                        $arrayListeQuartiersNotEmpty[] = $idQuartier;
                    }
                }


                // pagination
                $nbEnregistrementTotaux = count($arrayListeQuartiersNotEmpty);

                // nombre d'images affichées sur une page
                $nbEnregistrementsParPage = 12;
                $arrayPagination=$pagination->pagination(array(
                        'nomParamPageCourante'=>'archiPageCouranteVille',
                        'nbEnregistrementsParPage'=>$nbEnregistrementsParPage,
                        'nbEnregistrementsTotaux'=>$nbEnregistrementTotaux,
                        'typeLiens'=>'noformulaire'
                ));

                $t->assign_vars(array('pagination'=>$arrayPagination['html']));

                $req = "SELECT idQuartier, nom
						FROM quartier
						WHERE idQuartier in ('".implode("','", $arrayListeQuartiersNotEmpty)."')
								and nom<>'autre'
								ORDER BY nom ASC
								LIMIT ".$arrayPagination['limitSqlDebut'].",".$nbEnregistrementsParPage."
										";

                $tableau = new tableau();

                $res = $this->connexionBdd->requete($req);
                while ($fetch = mysql_fetch_assoc($res)) {
                // pour chaque ville on va regarder s'il y a des adresses qui correspondent et on les compte
                    /*$reqCount = "
					 SELECT distinct ha.idAdresse
					FROM historiqueAdresse ha2, historiqueAdresse ha
					LEFT JOIN sousQuartier sq ON sq.idQuartier = '".$fetch['idQuartier']."'
					LEFT JOIN rue r ON r.idSousQuartier = sq.idSousQuartier
					WHERE
					(ha.idRue = IFNULL(r.idRue , 0)
							OR  ha.idQuartier = '".$fetch['idQuartier']."'
							OR  ha.idSousQuartier = IFNULL(sq.idSousQuartier,0))
					AND ha2.idHistoriqueAdresse = ha.idHistoriqueAdresse
					GROUP BY ha.idAdresse, ha.idHistoriqueAdresse
					HAVING ha.idHistoriqueAdresse = max(ha2.idHistoriqueAdresse)
					";*/



                    $reqRuesQuartier = "SELECT idRue FROM rue WHERE idSousQuartier IN (SELECT idSousQuartier FROM sousQuartier WHERE idQuartier=".$fetch['idQuartier'].")";
                    $reqSousQuartier = "SELECT idSousQuartier FROM sousQuartier WHERE idQuartier = ".$fetch['idQuartier'];

                    $nbAdressesTotales=0;
                    $nbAdressesRues =0;
                    $nbAdressesSousQuartiers=0;
                    $nbAdressesQuartiers=0;

                    $resRuesQuartier = $this->connexionBdd->requete($reqRuesQuartier);
                    while ($fetchRuesQuartier = mysql_fetch_assoc($resRuesQuartier)) {
                        $reqCountRuesQuartier = "SELECT count(distinct idAdresse) as nbAdressesRues from historiqueAdresse WHERE idRue='".$fetchRuesQuartier['idRue']."'";
                        $resCountRuesQuartier = $this->connexionBdd->requete($reqCountRuesQuartier);
                        $fetchAdressesRues = mysql_fetch_assoc($resCountRuesQuartier);
                        $nbAdressesRues += $fetchAdressesRues['nbAdressesRues'];
                    }

                    $resSousQuartier = $this->connexionBdd->requete($reqSousQuartier);
                    while ($fetchSousQuartier = mysql_fetch_assoc($resSousQuartier)) {
                        $reqCountSousQuartierQuartier = "SELECT count(distinct idAdresse) as nbAdressesSousQuartiers FROM historiqueAdresse WHERE idSousQuartier='".$fetchSousQuartier['idSousQuartier']."'";
                        $resCountSousQuartierQuartier = $this->connexionBdd->requete($reqCountSousQuartierQuartier);
                        $fetchAdressesSousQuartiers = mysql_fetch_assoc($resCountSousQuartierQuartier);
                        $nbAdressesSousQuartiers += $fetchAdressesSousQuartiers['nbAdressesSousQuartiers'];
                    }

                    $reqCountQuartiers = "SELECT count(distinct idAdresse) as nbAdressesQuartier FROM historiqueAdresse WHERE idQuartier = '".$fetch['idQuartier']."'";
                    $resCountQuartiers = $this->connexionBdd->requete($reqCountQuartiers);
                    $fetchCountQuartiers = mysql_fetch_assoc($resCountQuartiers);
                    $nbAdressesQuartiers += $fetchCountQuartiers['nbAdressesQuartier'];


                    $nbAdressesTotales = $nbAdressesRues + $nbAdressesSousQuartiers + $nbAdressesQuartiers;

                    $nbResultats = "(".$nbAdressesTotales.")";


                    $htmlPhoto='';
                    $urlPhoto = $this->getUrlImageFromQuartier($fetch['idQuartier'], 'moyen');
                    if (!pia_ereg("transparent.gif", $urlPhoto)) {  // la fonction renvoi le lien vers une photo transparente si elle ne trouve pas de photo de du quartier
                        $htmlPhoto = "<a href='".$this->creerUrl('', 'adresseListe', array('recherche_quartier'=>$fetch['idQuartier']))."'><img src='".$urlPhoto."' border=0></a>";
                    } else {
                        // pas de photo
                        $htmlPhoto = "<span style='float:right;margin:0px;padding:0px;'><a href='".$this->creerUrl('', 'adresseListe', array('recherche_quartier'=>$fetch['idQuartier']))."'><table border='' style='margin:0px;padding:0px;border:1px solid #000000;font-size:11px;background-image:url(".$this->getUrlImage()."imageDefautArchiv2.jpg);' width=200 height=150><tr><td align=center valign=center style='padding-top:100px;'>Pas de photo</td></tr></table></a></span>";
                    }


                    $lien = "<a href='".$this->creerUrl('', 'adresseListe', array('recherche_quartier'=>$fetch['idQuartier']))."'>".stripslashes($fetch['nom'])."</a>".$nbResultats;
                    if ($nbAdressesTotales>0) {
                        $tableau->addValue($htmlPhoto."<br>".$lien);
                    }
                }

                $t->assign_vars(array('elements'=>$tableau->createHtmlTableFromArray(3)));
                break;

            case "parVilles":
                $arrayVillesNotEmpty = $r->getIdVillesNotEmpty();
                $arrayListeVillesAvecAdresses = $arrayVillesNotEmpty["arrayIdVilles"];
                $listeVilleAvecAdresses = implode(",", $arrayListeVillesAvecAdresses);
                //pagination
                $reqNbVilles = "
						SELECT 0
						FROM ville
						where (idPays = '1' or idPays='2')
						AND idVille in (".$listeVilleAvecAdresses.")
								and nom <>'autre'
								";
                $resNbVilles = $this->connexionBdd->requete($reqNbVilles);
                $nbEnregistrementTotaux = mysql_num_rows($resNbVilles);
                // nombre d'images affichées sur une page
                $nbEnregistrementsParPage = 12;
                $arrayPagination=$this->pagination(array(
                        'nomParamPageCourante'=>'archiPageCouranteVille',
                        'nbEnregistrementsParPage'=>$nbEnregistrementsParPage,
                        'nbEnregistrementsTotaux'=>$nbEnregistrementTotaux,
                        'typeLiens'=>'noformulaire'
                ));



                $t->assign_vars(array('pagination'=>$arrayPagination['html']));

                $req = "
						SELECT v.nom,v.idVille, lower(substr(v.nom,1,1)) as lettre
						FROM ville v

						WHERE (v.idPays = '1' or v.idPays='2')
						AND v.nom<>'autre'
						AND idVille in (".$listeVilleAvecAdresses.")
								ORDER BY v.nom
								LIMIT ".$arrayPagination['limitSqlDebut'].",".$nbEnregistrementsParPage;

                $tableau = new tableau();

                $res = $this->connexionBdd->requete($req);

                while ($fetch = mysql_fetch_assoc($res)) {
                    $listeRuesVille = "SELECT idRue FROM rue WHERE idSousQuartier IN (SELECT idSousQuartier FROM sousQuartier WHERE idQuartier IN (SELECT idQuartier FROM quartier WHERE idVille='".$fetch['idVille']."'))";
                    $listeSousQuartiersVille = "SELECT idSousQuartier FROM sousQuartier WHERE idQuartier IN (SELECT idQuartier FROM quartier WHERE idVille='".$fetch['idVille']."')";
                    $listeQuartiersVille = "SELECT idQuartier FROM quartier WHERE idVille='".$fetch['idVille']."'";


                    // comptage du nombre d'adresse liés a ces elements d'adresses
                    $resRuesVille = $this->connexionBdd->requete($listeRuesVille);
                    $nbRues = 0;
                    while ($fetchRuesVilles = mysql_fetch_assoc($resRuesVille)) {
                        $reqNbAdressesRue = "SELECT count(distinct idAdresse) as nbAdressesRue FROM historiqueAdresse WHERE idRue='".$fetchRuesVilles['idRue']."'";
                        $resNbAdressesRue = $this->connexionBdd->requete($reqNbAdressesRue);
                        $fetchNbAdressesRue = mysql_fetch_assoc($resNbAdressesRue);
                        $nbRues += $fetchNbAdressesRue['nbAdressesRue'];
                    }

                    $resSousQuartiersVille = $this->connexionBdd->requete($listeSousQuartiersVille);
                    $nbSousQuartiers = 0;
                    while ($fetchSousQuartiersVille = mysql_fetch_assoc($resSousQuartiersVille)) {
                        $reqNbAdressesSousQuartier = "SELECT count(distinct idAdresse) as nbAdressesSousQuartiers FROM historiqueAdresse WHERE idSousQuartier='".$fetchSousQuartiersVille['idSousQuartier']."'";
                        $resNbAdressesSousQuartier = $this->connexionBdd->requete($reqNbAdressesSousQuartier);
                        $fetchNbAdressesSousQuartier = mysql_fetch_assoc($resNbAdressesSousQuartier);
                        $nbSousQuartiers += $fetchNbAdressesSousQuartier['nbAdressesSousQuartiers'];
                    }

                    $resQuartiersVille = $this->connexionBdd->requete($listeQuartiersVille);
                    $nbQuartiers = 0;
                    while ($fetchQuartiersVille = mysql_fetch_assoc($resQuartiersVille)) {
                        $reqNbAdressesQuartier = "SELECT count(distinct idAdresse) as nbAdressesQuartiers FROM historiqueAdresse WHERE idQuartier='".$fetchQuartiersVille['idQuartier']."'";
                        $resNbAdressesQuartier = $this->connexionBdd->requete($reqNbAdressesQuartier);
                        $fetchNbAdressesQuartier = mysql_fetch_assoc($resNbAdressesQuartier);
                        $nbQuartiers += $fetchNbAdressesQuartier['nbAdressesQuartiers'];
                    }

                    $nbVilles = 0;
                    $reqNbAdressesVilles = "SELECT count(distinct idAdresse) as nbAdressesVilles FROM historiqueAdresse WHERE idVille='".$fetch['idVille']."'";
                    $resNbAdressesVilles = $this->connexionBdd->requete($reqNbAdressesVilles);
                    $fetchNbAdressesVilles = mysql_fetch_assoc($resNbAdressesVilles);
                    $nbVilles = $fetchNbAdressesVilles['nbAdressesVilles'];


                    $totalAdresses = $nbRues + $nbQuartiers + $nbVilles;

                    $recherche = new archiRecherche();

                    $nbResult = $recherche->getNumberOfAdresse(array('ville' => $fetch['idVille']));

                    $nbResultats = " (".$nbResult.")";

                    $htmlPhoto="";
                    $urlPhoto = $this->getUrlImageFromVille($fetch['idVille'], 'moyen');
                    if ($urlPhoto!='') {
                        $htmlPhoto = "<a href='".$this->creerUrl('', 'adresseListe', array('recherche_ville'=>$fetch['idVille']))."'><img src='".$urlPhoto."' border=0></a>";
                    }

                    $lien = "<a href='".$this->creerUrl('', 'adresseListe', array('recherche_ville'=>$fetch['idVille']))."'>".stripslashes($fetch['nom'])."</a>".$nbResultats."<br>";
                    if ($totalAdresses>0) {
                        $tableau->addValue($htmlPhoto."<br>".$lien);
                    }
                }

                $t->assign_vars(array('elements'=>$tableau->createHtmlTableFromArray(3)));

                break;
            case "parRuesDeQuartier":
            default:
                // DEFAULT : affichage parRues
                // s'il n'y a pas de criteres on affiche les dossiers des rues de strasbourg
                $r = new archiRecherche();
                $s = new stringObject();

                if (isset($this->variablesGet['archiIdQuartier']) && $this->variablesGet['archiIdQuartier']!='') {
                    $arrayRues = $this->getIdRuesFrom($this->variablesGet['archiIdQuartier'], 'quartier');
                } else {
                    $arrayRues = $this->getIdRuesFrom($idVilleGeneral, 'ville');
                }

                $arrayRuesNotEmpty = $r->getIdRuesNotEmpty();
                $arrayIdRuesNotEmpty=array();
                $arrayListeAlphabetique = array();

                foreach ($arrayRues as $indice => $idRue) {
                    if (in_array($idRue, $arrayRuesNotEmpty['arrayIdRues'])) {
                        $arrayIdRuesNotEmpty[] = $idRue;
                        $reqInitiales = "SELECT lower(substring(nom,1,1)) as initiale FROM rue WHERE idRue='".$idRue."'";
                        $resInitiales = $this->connexionBdd->requete($reqInitiales);
                        $fetchInitiales = mysql_fetch_assoc($resInitiales);
                        $initiale = $fetchInitiales['initiale'];
                        $arrayListeAlphabetique[] = $s->sansAccents($initiale);// enleve les accents

                        if (!isset($this->variablesGet['lettreCourante']) || isset($this->variablesGet['lettreCourante']) && $s->sansAccents($initiale)==$this->variablesGet['lettreCourante']) {
                            $arrayIdRuesNotEmptyWithSelection[] = $idRue; // prend en compte le nombre de rue selectionnée ou non par leur initiales
                        }
                    }
                }

                $sqlCritere = "";
                if (isset($this->variablesGet['lettreCourante']) && $this->variablesGet['lettreCourante']!='') {
                    $sqlCritere = " AND lower(SUBSTRING(nom,1,1))=lower('".$this->variablesGet['lettreCourante']."') ";
                }

                $nbEnregistrementTotaux = count($arrayIdRuesNotEmptyWithSelection);

                // nombre d'images affichées sur une page
                $nbEnregistrementsParPage = 40;
                $pagination = new paginationObject();

                if (isset($this->variablesGet['archiIdQuartier'])) {
                    $arrayPagination=$pagination->pagination(array(
                            'nomParamPageCourante'=>'archiPageRuesQuartier',
                            'nbEnregistrementsParPage'=>$nbEnregistrementsParPage,
                            'nbEnregistrementsTotaux'=>$nbEnregistrementTotaux,
                            'typeLiens'=>'freeLink',
                            'urlFreeLink'=>$this->creerUrl('', 'listeDossiers', array('archiIdQuartier'=>$this->variablesGet['archiIdQuartier'],'modeAffichageListe'=>'parRuesDeQuartier','archiPageRuesQuartier'=>'##numPage##'))

                    ));
                } else {
                    $arrayPagination=$pagination->pagination(array(
                            'nomParamPageCourante'=>'archiPageCouranteVille',
                            'nbEnregistrementsParPage'=>$nbEnregistrementsParPage,
                            'nbEnregistrementsTotaux'=>$nbEnregistrementTotaux,
                            'typeLiens'=>'noformulaire',
                            'arrayListeAlphabetique'=>$arrayListeAlphabetique
                    ));
                }


                $t->assign_vars(array('pagination'=>$arrayPagination['html']));

                $req = "
						SELECT nom,idRue,prefixe, lower(substr(nom,1,1)) as lettre
						FROM rue
						WHERE
						idRue in ('".implode("','", $arrayIdRuesNotEmpty)."')
						$sqlCritere
						ORDER BY lettre
						LIMIT ".$arrayPagination['limitSqlDebut'].",".$nbEnregistrementsParPage;


                $res = $this->connexionBdd->requete($req);

                $tableau = new tableau();

                while ($fetch = mysql_fetch_assoc($res)) {
                // pour chaque rue on va regarder s'il y a des adresses qui correspondent et on les compte (affichage du nombre de resultats)
                    $reqCount = "SELECT count(distinct idAdresse) as nbAdresses FROM historiqueAdresse WHERE idRue='".$fetch['idRue']."'";

                    $resCount = $this->connexionBdd->requete($reqCount);
                    $fetchCount = mysql_fetch_assoc($resCount);
                    $valCount = $fetchCount['nbAdresses'];
                    $nbResultats = " (".$valCount.")";


                    $htmlPhoto='';
                    //$urlPhoto = $this->getUrlImageFromRue($fetch['idRue'],'moyen');
                    $urlPhoto="resizeImage.php?id=".$this->getIdImageFromRue($fetch['idRue']);
                    if (!pia_ereg("transparent.gif", $urlPhoto)) {  // la fonction renvoi le lien vers une photo transparente si elle ne trouve pas de photo de la rue
                        $htmlPhoto = "<a href='".$this->creerUrl('', 'adresseListe', array('recherche_rue'=>$fetch['idRue']))."'><img src='".$urlPhoto."' border=0></a><br>";
                    } else {
                        // pas de photo
                        $htmlPhoto = "<a style='margin:0px;padding:0px;' href='".$this->creerUrl('', 'adresseListe', array('recherche_rue'=>$fetch['idRue']))."'><table border='' style='margin:0px;padding:0px;border:1px solid #000000;font-size:11px;background-image:url(".$this->getUrlImage()."imageDefautArchiv2.jpg);' width=200 height=150><tr><td align=center valign=center style='padding-top:100px;'>Pas de photo</td></tr></table></a>";
                    }

                    $lien = "<a href='".$this->creerUrl('', 'adresseListe', array('recherche_rue'=>$fetch['idRue']))."'>".stripslashes($fetch['prefixe']." ".$fetch['nom'])."</a>".$nbResultats;
                    if ($valCount>0) {
                        $tableau->addValue($htmlPhoto.$lien);
                    }
                }

                $t->assign_vars(array('elements'=>$tableau->createHtmlTableFromArray(5)));

                break;
        }


        ob_start();
        $t->pparse('listeRegroupee');
        $html=ob_get_contents();
        ob_end_clean();

        return $html;
    }
749127
public function linkStyles($url, $media = '')
    {
        /* Проверяем, не добавлен ли уже этот URL  */
        for ($i = 0; $i < count($this->head['link']); $i++)
        {
            if ($this->head['link'][$i]['href'] == $url)
            {
                return;
            }
        }

        $item = array('rel' => 'StyleSheet', 'href' => $url, 'type' => 'text/css');

        if (!empty($media))
        {
            $item['media'] = $media;
        }

        $this->head['link'][] = $item;
    }
761117
public ReTranscodeResponse reTranscode(String mediaId) {
        ReTranscodeRequest request = new ReTranscodeRequest().withMediaId(mediaId);
        return reTranscode(request);
    }
770500
function transformMedia(media, customMedias) {
	const transpiledMedias = [];

	for (const index in media.nodes) {
		const { value, nodes } = media.nodes[index];
		const key = value.replace(customPseudoRegExp, '$1');

		if (key in customMedias) {
			for (const replacementMedia of customMedias[key].nodes) {
				// use the first available modifier unless they cancel each other out
				const modifier = media.modifier !== replacementMedia.modifier
					? media.modifier || replacementMedia.modifier
				: '';
				const mediaClone = media.clone({
					modifier,
					// conditionally use the raws from the first available modifier
					raws: !modifier || media.modifier
						? { ...media.raws }
					: { ...replacementMedia.raws },
					type: media.type || replacementMedia.type,
				});

				// conditionally include more replacement raws when the type is present
				if (mediaClone.type === replacementMedia.type) {
					Object.assign(mediaClone.raws, {
						and: replacementMedia.raws.and,
						beforeAnd: replacementMedia.raws.beforeAnd,
						beforeExpression: replacementMedia.raws.beforeExpression
					});
				}

				mediaClone.nodes.splice(index, 1, ...replacementMedia.clone().nodes.map(node => {
					// use raws and spacing from the current usage
					if (media.nodes[index].raws.and) {
						node.raws = { ...media.nodes[index].raws };
					}

					node.spaces = { ...media.nodes[index].spaces };

					return node;
				}));

				// remove the currently transformed key to prevent recursion
				const nextCustomMedia = getCustomMediasWithoutKey(customMedias, key);
				const retranspiledMedias = transformMedia(mediaClone, nextCustomMedia);

				if (retranspiledMedias.length) {
					transpiledMedias.push(...retranspiledMedias);
				} else {
					transpiledMedias.push(mediaClone);
				}
			}

			return transpiledMedias;
		} else if (nodes && nodes.length) {
			transformMediaList(media.nodes[index], customMedias);
		}
	}

	return transpiledMedias;
}
681789
protected function _setStylesheet($href, $media = null, $prepend = false, $conditional = '')
    {
        //obliczanie timestampa
        $ts = $this->_getLocationTimestamp($href);
        //określanie parametrów
        $params = ['rel' => 'stylesheet', 'type' => 'text/css', 'href' => $ts > 0 ? $this->_getPublicSrc($href) : $href, 'ts' => $ts];
        if ($media) {
            $params['media'] = $media;
        }
        return $this->headLink($params, $prepend, $conditional);
    }