本文整理汇总了PHP中insertElement函数的典型用法代码示例。如果您正苦于以下问题:PHP insertElement函数的具体用法?PHP insertElement怎么用?PHP insertElement使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了insertElement函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetHTML
function GetHTML()
{
$HTML = "";
foreach ($this->Buttons as $Button) {
if ($Button['icon']) {
$Value = '<i class="fa ' . $Button['icon'] . '"></i> ';
} else {
$Value = $Button['title'];
}
$NewHTML = insertElement('button', $Button['id'], $Value, $Button['class'], $Button['extra']);
if ($Button['link']) {
$HTML .= '<a href="' . $Button['link'] . '">' . $NewHTML . '</a>';
} else {
$HTML .= $NewHTML;
}
}
return $HTML;
}
示例2: insertElement
// 6
// Изход:
// 1 3 5 6 7 9 11 45
$arr = [1, 3, 5, 7, 9, 11, 45];
$n = 2;
function insertElement($arr, $n)
{
$len = count($arr);
$arr1 = [];
$flag = true;
if ($flag && $arr[0] >= $n) {
array_push($arr1, $n);
$flag = false;
}
array_push($arr1, $arr[0]);
for ($i = 1; $i < $len; $i++) {
if ($arr[$i - 1] < $n && $arr[$i] > $n && $flag) {
array_push($arr1, $n);
$i--;
$flag = false;
continue;
}
array_push($arr1, $arr[$i]);
}
if ($flag && $arr1[$len - 1] <= $n) {
array_push($arr1, $n);
}
return $arr1;
}
print_r(insertElement($arr, $n));
示例3: scanPHP
function scanPHP(&$paths, $db, $printStatus = false)
{
foreach ($paths as $key => $value) {
if ($value['ext'] == 'php') {
$path = $value['path'];
if (insertFile($db, $path)) {
cleanElement($db, $path);
if ($printStatus) {
echo "SCAN " . $path . PHP_EOL;
}
$path_parts = pathinfo($path);
insertElement($db, $path, $path_parts['filename'], $path_parts['extension'], "", 'file', 0);
$content = file_get_contents($path);
$tokens = token_get_all($content);
/*if($path == '/var/www/src/grep/test.php')
{
echo "<pre>";
var_dump($tokens);
echo "</pre>";
}*/
$tree = array();
scanTree($tree, $tokens, 0);
/*if($path == '/var/www/src/grep/test.php')
{
echo "<pre>";
var_dump($tree);
echo "</pre>";
}*/
saveTree($tree, $tokens, $path, $db);
} else {
if ($printStatus) {
echo "SKIP " . $path . PHP_EOL;
}
}
}
}
}
示例4: insertElement
echo insertElement('select', 'parent', '', 'formNewItem', 'tabindex="3"', $DB->fetchAssoc('menu', 'menu_id,title', "", "title"), '0', 'Menú Principal');
?>
</div>
</div>
<div class="col-md-6 form-group animated bounceInRight">
<div class="form-group">
<?php
echo insertElement('select', 'status', '', 'formNewItem', 'tabindex="4"', $Status, '', '', 'A');
?>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 form-group animated bounceInLeft">
<?php
echo insertElement('text', 'position', '', 'form-first-name formNewItem', 'tabindex="5" placeholder="Posición"');
?>
</div>
<div class="col-md-6 form-group animated bounceInRight menuSelectIcon">
<button type="button" class="btn mainbtn" data-toggle="modal" data-target="#myModal">Agregar Ícono</button>
<?php
// echo insertElement('text','icon','','form-first-name formNewItem','tabindex="6" placeholder="Ícono"');
?>
<span>Ícono Actual: <i class="fa fa-bars" aria-hidden="true"></i></span>
</div>
</div>
</div>
</div>
<!-- Add Img & Done Button Div -->
<div class="container centrarbtn animated fadeInUp donediv">
<div class="form-group">
示例5: Description
<div class="circleInput Hidden animated fadeIn"><input name="color" type="color" value="#8551d9" /></div>
<div class=""><button type="button" name="button" class="Hidden DelSelColors btn mainbtnred delColBtn"><i class="fa fa-trash-o"></i></button></div>
<div class="ColorSelect circle circleAddItem" style="background-color: #fff"></div>
<div class="ColorSelect circle circleAddItem" style="background-color: #c17996"></div>
<div class="ColorSelect circle circleAddItem" style="background-color: #768754"></div>
<div class="ColorSelect circle circleAddItem" style="background-color: #5643a0"></div>
<div class="ColorSelector colorPalette" name="color" type="color"><img src="../../../skin/images/body/icons/colorpalette.jpg" alt=""/></div>
</div>
</div>
</div>
<!-- Description & To Select Image Link -->
<!-- Description (Character counter) -->
<div class="col-md-6 form-group addItemDescription">
<form class="form-group">
<?php
echo insertElement('textarea', 'description', $Data['description'], 'form-controlitems textareaitems text-center', 'placeholder="Descripción" rows="4" maxlength="150"');
?>
<div class="remchar"><p> Caracteres restantes: </p></div>
<div class="indicator-wrapper">
<div class="indicator"><span class="current-length">150</span></div>
</div>
</form>
</div>
<!-- /Description (Character counter) -->
<!-- Choose Img -->
<div class="col-md-6 col-sm-12 imgSelector">
<div class="imgSelectorInner">
<img src="../../../skin/images/products/cod1.jpg" class="img-responsive">
<div class="imgSelectorContent">
<div id="SelectImg">
<i class="fa fa-picture-o"></i><br>
示例6: insertElement
<!-- IMAGES -->
<!-- Actual Image -->
<div class="row imagesMain">
<div class="col-lg-3 col-md-12 col-sm-6 col-xs-12">
<div class="imagesContainer">
<h4 class="subTitleB"><i class="fa fa-picture-o"></i> Imágen Actual</h4>
<div class="flex-allCenter imgSelector">
<div class="imgSelectorInner">
<img src="<?php
echo $Admin->DefaultImg;
?>
" class="img-responsive MainImg animated">
<?php
echo insertElement('file', 'image', '', 'Hidden');
?>
<div class="imgSelectorContent">
<div id="SelectImg">
<i class="fa fa-upload"></i><br>
<p>Cargar Nueva Imágen</p>
</div>
</div>
</div>
</div>
<div class="text-bottom">
<p><i class="fa fa-upload" aria-hidden="true"></i>
Haga Click sobre la imágen </br> para cargar una desde su dispositivo</p>
</div>
</div>
</div><!-- /Actual Image -->
示例7: insertElement
<?php
echo insertElement("hidden", "action", 'update');
?>
<?php
echo insertElement("hidden", "id", $ID);
?>
<div class="box animated fadeIn">
<div class="box-header flex-justify-center">
<div class="col-lg-8 col-sm-12">
<div class="innerContainer">
<h4 class="subTitleB"><i class="fa fa-plus-circle"></i> Complete los campos para agregar un nuevo país</h4>
<div class="row form-group inline-form-custom-2">
<div class="col-xs-12 col-sm-6 inner">
<label>Título</label>
<?php
echo insertElement('text', 'title', $Data['title'], 'form-control', 'placeholder="Ingrese un Título" validateEmpty="Ingrese un título." validateFromFile="../../library/processes/proc.common.php///El título ya existe///action:=validate///actualtitle:=' . $Data['title'] . '///object:=GeolocationCountry"');
?>
</div>
</div><!-- inline-form -->
<hr>
<div class="txC">
<button type="button" class="btn btn-success btnGreen" id="BtnCreate"><i class="fa fa-check"></i> Editar País</button>
<button type="button" class="btn btn-error btnRed" id="BtnCancel"><i class="fa fa-times"></i> Cancelar</button>
</div>
</div>
</div>
</div>
</div>
<?php
include '../../includes/inc.bottom.php';
示例8: InsertSearchField
protected function InsertSearchField()
{
return '<!-- Title -->
<div class="input-group">
<span class="input-group-addon order-arrows sort-activated" order="title" mode="asc"><i class="fa fa-sort-alpha-asc"></i></span>
' . insertElement('text', 'title', '', 'form-control', 'placeholder="Título"') . '
</div>
<!-- Group -->
<div class="input-group">
<span class="input-group-addon order-arrows" order="profile" mode="asc"><i class="fa fa-sort-alpha-asc"></i></span>
' . insertElement('select', 'profile', '', 'form-control', '', $this->fetchAssoc('admin_profile', 'profile_id,title', "company_id=" . $_SESSION['company_id'] . " AND status='A'", "title"), '', 'Perfil') . '
</div>';
}
示例9: GroupTree
public function GroupTree($ProfileID = 0, $AdminID = 0)
{
$HTML = '<div class="form-group checkboxDiv"><div class="checkboxTitle"><h5>Grupos Asociados</h5></div><ul>';
if ($ProfileID != 0) {
$this->AdminID = $AdminID;
$CheckedGroups = $this->GetCheckedGroups();
$Groups = $this->fetchAssoc('admin_group', '*', "group_id IN (SELECT group_id FROM relation_group_profile WHERE profile_id = " . $ProfileID . ")", "title");
foreach ($Groups as $Group) {
if ($CheckedGroups && in_array($Group['group_id'], $CheckedGroups)) {
$Checked = ' checked="checked" ';
} else {
$Checked = '';
}
$HTML .= '<li class="treeLv1">' . insertElement('checkbox', 'group' . $Group['group_id'], $Group['group_id'], 'checkbox-custom GroupCheckbox CheckBox', 'value="' . $Group['group_id'] . '"' . $Checked) . '<label class="checkbox-custom-label" for="group' . $Group['group_id'] . '"> <i class="fa fa-users"></i> ' . $Group['title'] . '</label></li>';
}
} else {
$HTML .= '<li class="treeLv1">No hay grupos asociados a este perfil<li>';
}
return $HTML . '</ul></div>';
}
示例10: InsertSearchResults
public function InsertSearchResults()
{
if ($_POST['view_type'] == 'grid') {
$ListClass = 'Hidden';
} else {
$GridClass = 'Hidden';
}
return '<div class="contentContainer txC" id="SearchResult" object="' . get_class($this) . '"><!-- List Container -->
<div class="GridView row horizontal-list flex-justify-center GridElement ' . $GridClass . ' animated fadeIn">
<ul>
' . $this->MakeGrid() . '
</ul>
</div><!-- /.horizontal-list -->
<div class="row ListView ListElement animated fadeIn ' . $ListClass . '">
<div class="container-fluid">
' . $this->MakeList() . '
</div><!-- container-fluid -->
</div><!-- row -->
' . insertElement('hidden', 'totalregs', $this->GetTotalRegs()) . '
</div><!-- /Content Container -->';
}
示例11: InsertSearchField
protected function InsertSearchField()
{
return '<!-- Name -->
<div class="input-group">
<span class="input-group-addon order-arrows sort-activated" order="name" mode="asc"><i class="fa fa-sort-alpha-asc"></i></span>
' . insertElement('text', 'name', '', 'form-control', 'placeholder="Nombre"') . '
</div>
<!-- Corporate Name -->
<div class="input-group">
<span class="input-group-addon order-arrows" order="corporate_name" mode="asc"><i class="fa fa-sort-alpha-asc"></i></span>
' . insertElement('text', 'corporate_name', '', 'form-control', 'placeholder="Razón Social"') . '
</div>
<!-- Address -->
<div class="input-group">
<span class="input-group-addon order-arrows" order="address" mode="asc"><i class="fa fa-sort-alpha-asc"></i></span>
' . insertElement('text', 'address', '', 'form-control', 'placeholder="Dirección"') . '
</div>
<!-- Phone -->
<div class="input-group">
<span class="input-group-addon order-arrows" order="phone" mode="asc"><i class="fa fa-sort-alpha-asc"></i></span>
' . insertElement('text', 'phone', '', 'form-control', 'placeholder="Teléfono"') . '
</div>
<!-- Website -->
<div class="input-group">
<span class="input-group-addon order-arrows" order="website" mode="asc"><i class="fa fa-sort-alpha-asc"></i></span>
' . insertElement('text', 'website', '', 'form-control', 'placeholder="Sitio Web"') . '
</div>
<!-- CUIT -->
<div class="input-group">
<span class="input-group-addon order-arrows" order="cuit" mode="asc"><i class="fa fa-sort-alpha-asc"></i></span>
' . insertElement('text', 'cuit', '', 'form-control', 'placeholder="CUIT"') . '
</div>
<!-- Agent -->
<div class="input-group">
<span class="input-group-addon order-arrows" order="agent_name" mode="asc"><i class="fa fa-sort-alpha-asc"></i></span>
' . insertElement('text', 'agent_name', '', 'form-control', 'placeholder="Responsable"') . '
</div>';
}
示例12: FillTree
public function FillTree($Parent = 0, $Level = 1)
{
$CheckedMenues = $this->GetCheckedMenues();
$Menues = $this->fetchAssoc('menu', '*', "parent_id = " . $Parent . " AND status <> 'I'", "position");
$Display = in_array($Parent, $CheckedMenues) ? '' : ' style="display:none" ';
$Parents = $this->GetParents();
$HTML = $Parent == 0 ? '<ul id="parent' . $Parent . '">' : '<ul ' . $Display . ' id="parent' . $Parent . '">';
$Level = $Level > 3 ? 1 : $Level;
foreach ($Menues as $Menu) {
$IsParent = in_array($Menu['menu_id'], $Parents);
$Arrow = $IsParent ? '<i class="fa fa-caret-down" aria-hidden="true"></i>' : '';
if (in_array($Menu['menu_id'], $CheckedMenues)) {
$Checked = ' checked="checked" ';
$Disabled = '';
} else {
$Disabled = $Parent != 0 && !in_array($Parent, $CheckedMenues) ? ' disabled="disabled" ' : '';
$Checked = '';
}
//$HTML .= '<li class="treeLv1">'.insertElement('checkbox','menu'.$Menu['menu_id'],$Menu['menu_id'],'CheckBox TreeCheckbox checkbox-custom','value="'.$Menu['menu_id'].'"'.$Disabled.$Checked).'<label class="checkbox-custom-label" for="menu'.$Menu['menu_id'].'"></label><span id="menu'.$Menu['menu_id'].'" '.$Arrow.' class="TreeElement"> '.$Menu['title'].'</span></li>';
$HTML .= '<li class="TreeElement treeLv' . $Level . '">' . insertElement('checkbox', 'menu' . $Menu['menu_id'], $Menu['menu_id'], 'CheckBox TreeCheckbox checkbox-custom', 'value="' . $Menu['menu_id'] . '"' . $Disabled . $Checked) . '<label class="checkbox-custom-label" for="menu' . $Menu['menu_id'] . '"> <i class="fa ' . $Menu['icon'] . '"></i> ' . $Menu['title'] . '</label>' . $Arrow . '</li>';
if ($IsParent) {
$HTML .= $this->FillTree($Menu['menu_id'], $Level + 1);
}
}
return $HTML . '</ul>';
}
示例13: InsertSearchField
protected function InsertSearchField()
{
return '<!-- First Name -->
<div class="input-group">
<span class="input-group-addon order-arrows sort-activated" order="first_name" mode="asc"><i class="fa fa-sort-alpha-asc"></i></span>
' . insertElement('text', 'first_name', '', 'form-control', 'placeholder="Nombre"') . '
</div>
<!-- Last Name -->
<div class="input-group">
<span class="input-group-addon order-arrows" order="last_name" mode="asc"><i class="fa fa-sort-alpha-asc"></i></span>
' . insertElement('text', 'last_name', '', 'form-control', 'placeholder="Apellido"') . '
</div>
<!-- User -->
<div class="input-group">
<span class="input-group-addon order-arrows" order="user" mode="asc"><i class="fa fa-sort-alpha-asc"></i></span>
' . insertElement('text', 'user', '', 'form-control', 'placeholder="Usuario"') . '
</div>
<!-- Email -->
<div class="input-group">
<span class="input-group-addon order-arrows" order="email" mode="asc"><i class="fa fa-sort-alpha-asc"></i></span>
' . insertElement('text', 'email', '', 'form-control', 'placeholder="Email"') . '
</div>
<!-- Profile -->
<div class="input-group">
<span class="input-group-addon order-arrows" order="profile" mode="asc"><i class="fa fa-sort-alpha-asc"></i></span>
' . insertElement('select', 'profile', '', 'form-control', '', $this->fetchAssoc('admin_profile', 'profile_id,title', "company_id=" . $_SESSION['company_id'] . " AND status='A' AND profile_id >= " . $_SESSION['profile_id']), '', 'Perfil') . '
</div>
<!-- Group -->
<div class="input-group">
<span class="input-group-addon order-arrows" order="group" mode="asc"><i class="fa fa-sort-alpha-asc"></i></span>
' . insertElement('select', 'group', '', 'form-control', '', $this->fetchAssoc('admin_group', 'group_id,title', "company_id=" . $_SESSION['company_id'] . " AND status='A' AND group_id IN (SELECT group_id FROM relation_group_profile WHERE profile_id >= " . $_SESSION['profile_id'] . ")", "title"), '', 'Grupo') . '
</div>';
}
示例14: InsertSearchField
protected function InsertSearchField()
{
return '<!-- Title -->
<div class="input-group">
<span class="input-group-addon order-arrows sort-activated" order="title" mode="asc"><i class="fa fa-sort-alpha-asc"></i></span>
' . insertElement('text', 'title', '', 'form-control', 'placeholder="Título"') . '
</div>';
}
示例15: InsertSearchField
protected function InsertSearchField()
{
$Parents = $this->GetParents();
$Parents = $this->fetchAssoc('menu', 'menu_id,title', "status<>'I' AND menu_id IN (" . implode(",", $Parents) . ")");
$Parents[] = array("menu_id" => "0", "title" => "Menú Principal");
return '<!-- Title -->
<div class="input-group">
<span class="input-group-addon order-arrows sort-activated" order="title" mode="asc"><i class="fa fa-sort-alpha-asc"></i></span>
' . insertElement('text', 'title', '', 'form-control', 'placeholder="Título"') . '
</div>
<!-- Link -->
<div class="input-group">
<span class="input-group-addon order-arrows" order="link" mode="asc"><i class="fa fa-sort-alpha-asc"></i></span>
' . insertElement('text', 'link', '', 'form-control', 'placeholder="Link"') . '
</div>
<!-- Parent -->
<div class="input-group">
<span class="input-group-addon order-arrows" order="parent" mode="asc"><i class="fa fa-sort-alpha-asc"></i></span>
' . insertElement('select', 'parent', '', 'form-control', '', $Parent, '', 'Ubicación') . '
</div>
<!-- Public -->
<div class="input-group">
<span class="input-group-addon order-arrows" order="public" mode="asc"><i class="fa fa-sort-alpha-asc"></i></span>
' . insertElement('select', 'public', '', 'form-control', '', array("N" => "Privado", "Y" => "Público"), '', "Privacidad") . '
</div>
<!-- Type -->
<div class="input-group">
<span class="input-group-addon order-arrows" order="status" mode="asc"><i class="fa fa-sort-alpha-asc"></i></span>
' . insertElement('select', 'view_status', '', 'form-control', '', array("A" => "Visible", "O" => "Oculto"), '', "Visibilidad") . '
</div>
<!-- Profile -->
<div class="input-group">
<span class="input-group-addon order-arrows" order="profile" mode="asc"><i class="fa fa-sort-alpha-asc"></i></span>
' . insertElement('select', 'profile', '', 'form-control', '', $this->fetchAssoc('admin_profile', 'profile_id,title', "company_id=" . $_SESSION['company_id'] . " AND status='A'"), '', 'Perfil') . '
</div>
<!-- Group -->
<div class="input-group">
<span class="input-group-addon order-arrows" order="group" mode="asc"><i class="fa fa-sort-alpha-asc"></i></span>
' . insertElement('select', 'group', '', 'form-control', '', $this->fetchAssoc('admin_group', 'group_id,title', "company_id=" . $_SESSION['company_id'] . " AND status='A'", "title"), '', 'Grupo') . '
</div>';
}