コード例 #1
1
<?php

//recherche des alertes et des événements:
$alertes = recupererAlertes();
$evenements = recupererEvenements();
$video = recupererVideo();
$lastNews = recupererNews();
$lastNewsPictures = array();
for ($i = 0; $i < sizeof($lastNews); $i++) {
    if (isset($lastNews)) {
        $lastN = $lastNews[$i]->getId();
        if (!empty($lastN)) {
            $lastNewsPictures[$i] = recupererImagesArticle($lastNews[$i]);
        }
    }
}
if (isset($_REQUEST['videoSubmit']) && !empty($_REQUEST['videoSubmit']) && isset($_REQUEST['videoURL']) && !empty($_REQUEST['videoURL'])) {
    $v = new Video(0, $_REQUEST['videoURL']);
    if (isset($video)) {
        $vid = $video[0]->getId();
        if (notEmpty($video[0]->getId())) {
            editerVideo($video[0]->getId(), $v);
        }
    }
}
$video = recupererVideo();
$page['vue'] = 'vue/corps_accueil.php';
$page['css'] = '<link rel="stylesheet" type="text/css" href="static/css/css_accueil.css" />';
コード例 #2
0
function _getPropertiesEx($arParams)
{
    $arFilter = array();
    $arProperties = array();
    $arPropListIds = array();
    if (notEmpty($arParams["type"])) {
        $arFilter["PROPERTY_TYPE"] = $arParams["type"];
    }
    if (notEmpty($arParams["iblock_id"])) {
        $arFilter["IBLOCK_ID"] = iblock($arParams["iblock_id"]);
    }
    $resProperties = \CIBlockProperty::GetList(array(), $arFilter);
    while ($arProperty = $resProperties->Fetch()) {
        $arProperties[$arProperty["CODE"]] = $arProperty;
        if ($arProperty["PROPERTY_TYPE"] == "L") {
            $arPropListIds[] = $arProperty["ID"];
        }
    }
    // В фильтр CIBlockPropertyEnum::GetList() нельзя передать
    // PROPERTY_ID в виде массива ID, поэтому перебираем
    // каждое свойство в цикле
    foreach ($arPropListIds as $propListId) {
        $resPropValues = \CIBlockPropertyEnum::GetList(array('SORT' => 'ASC', 'VALUE' => 'ASC'), array('PROPERTY_ID' => $propListId));
        while ($arPropValue = $resPropValues->Fetch()) {
            $arProperties[$arPropValue["PROPERTY_CODE"]]["VALUES"][$arPropValue["XML_ID"]] = $arPropValue["ID"];
        }
    }
    return $arProperties;
}
コード例 #3
0
ファイル: General.php プロジェクト: bestwpw/funct
/**
 * Returns a first not empty value from function arguments
 *
 * @param mixed $valueA
 * @param mixed $valueB
 *
 * @return mixed
 * @author Aurimas Niekis <*****@*****.**>
 */
function firstValueNotEmpty($valueA, $valueB)
{
    foreach (func_get_args() as $arg) {
        if (notEmpty($arg)) {
            return $arg;
        }
    }
}
コード例 #4
0
ファイル: settings.php プロジェクト: Nikitian/fl-ru-damp
 foreach ($emails as $key => $res) {
     if (empty($params[$key])) {
         $errors[] = Resources::Get("errors.required", Resources::Get($res));
     } elseif ($key == 'stats_email') {
         $stats_emails = array_map("trim", explode(",", $params[$key]));
         foreach ($stats_emails as $e) {
             if (!isValidEmail($e)) {
                 $errors[] = Resources::Get("errors.email.format", Resources::Get($res));
                 break;
             }
         }
     } elseif (!isValidEmail($params[$key])) {
         $errors[] = Resources::Get("errors.email.format", Resources::Get($res));
     }
 }
 if (isset($params['max_sessions']) && notEmpty($params['max_sessions']) && (!is_numeric($params['max_sessions']) || $params['max_sessions'] < 0)) {
     $errors[] = Resources::Get("error.max_sessions.value");
 }
 if (empty($params['company_name'])) {
     $errors[] = Resources::Get("errors.required", array(Resources::Get('settings.company.webim')));
 }
 $requestFile = $_FILES['logo'];
 if (empty($errors) && isset($requestFile) && !empty($requestFile['name']) && $requestFile['size'] > 0 && $requestFile['error'] == 0) {
     $dir = "../images/logo/";
     $destFilename = "site_logo";
     $uploadResult = uploadFile($requestFile, $dir, $destFilename);
     if (!empty($uploadResult)) {
         $errors[] = $uploadResult;
     }
     if (empty($errors)) {
         $hash = array();
コード例 #5
0
                <li>En arrivant, saluez les locaux (et m&ecirc;me les autres!)</li>
                <li>En vol, respectez les priorités</li>
                <li>Posez-vous dans l'attrerrissage, dans les chemins, mais pas dans les champs en culture</li>
        </div>
    </div>
    <div class="col-xs-12 col-sm-4">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3>Derni&egrave;res actualit&eacute;s du club</h3>
            </div>
            <ul class="list-group">
                <?php 
for ($n = 0; $n < sizeof($lastNews) && $n < 2; $n++) {
    ?>
                    <?php 
    if (isset($lastNews[$n]) && notEmpty($lastNews[$n]->getTitre()) && isset($lastNewsPictures[$n]) && notEmpty($lastNewsPictures[$n][0])) {
        ?>
                    <li class="list-group-item">
                        <a href="<?php 
        print URL_PATH;
        ?>
?page=blog">
                            <div class="newsTitle"><?php 
        print $lastNews[$n]->getTitre();
        ?>
</div>
                            <img class="newsPic" src="<?php 
        print $lastNewsPictures[$n][0]->getChemin();
        ?>
" />
                        </a>
コード例 #6
-1
$id_dispo = $article->getIdDisposition();
//Récupération des images de l'article:
$img = array();
$img = recupererImagesArticle($article);
$pic = array();
if (isset($img[0]) && notEmpty($img[0]->getChemin())) {
    $pic[0] = $img[0]->getChemin();
} else {
    $pic[0] = "";
}
if (isset($img[1]) && notEmpty($img[1]->getChemin())) {
    $pic[1] = $img[1]->getChemin();
} else {
    $pic[1] = "";
}
if (isset($img[2]) && notEmpty($img[2]->getChemin())) {
    $pic[2] = $img[2]->getChemin();
} else {
    $pic[2] = "";
}
//Préparation des elements de formulaires:
$texteHaut = '<div class="article_line txtH"><label for="txtHaut">Texte du haut: </label>' . '<textarea name="txtHaut" id="txtHaut" rows="5" resize="none" required>' . $article->getTexte1() . '</textarea></div>';
$texteBas = '<div class="article_line txtB"><label for="txtBas">Texte du bas: </label>' . '<textarea name="txtBas" id="txtBas" rows="5" resize="none" required>' . $article->getTexte2() . '</textarea></div>';
$texteGauche = '<div class="article_line txtG"><label for="txtGauche">Texte de gauche: </label>' . '<textarea name="txtGauche" id="txtGauche" rows="8" resize="none" required>' . $article->getTexte1() . '</textarea></div>';
$texteDroite = '<div class="article_line txtD"><label for="txtDroite">Texte de droite: </label>' . '<textarea name="txtDroite" id="txtDroite" rows="8" resize="none" required>' . $article->getTexte1() . '</textarea></div>';
$img_std = '<div class="img_std"><label for="image_std">Lien vers l\'image: </label>' . '<input type="text" name="image_std" id="image_std" value=' . $pic[0] . ' required /></div>';
$img_vertG = '<div class="img_vertG"><label for="image_vertG">Lien vers l\'image: </label>' . '<input type="text" name="image_vertG" id="image_vertG" value=' . $pic[0] . ' required /></div>';
$img_vertD = '<div class="img_vertD"><label for="image_vertD">Lien vers l\'image: </label>' . '<input type="text" name="image_vertD" id="image_vertD" value=' . $pic[0] . ' required /></div>';
$img_2pic_pic1 = '<div class="img_2pic_1"><label for="image_2pic_1">Lien vers l\'image: </label>' . '<input type="text" name="image_2pic_1" id="image_2pic_1" value=' . $pic[0] . ' required /></div>';
$img_2pic_pic2 = '<div class="img_2pic_2"><label for="image_2pic_2">Lien vers l\'image: </label>' . '<input type="text" name="image_2pic_2" id="image_2pic_2" value=' . $pic[1] . ' required /></div>';
$img_3pic_grande = '<div class="img_3pic_gde"><label for="image_3pic_grande">Lien vers l\'image: </label>' . '<input type="text" name="image_3pic_grande" id="image_3pic_grande" value=' . $pic[0] . ' required /></div>';