function newLogin($dfhost, $dfuser, $dfpass) { $login_form_begin = '<form action="' . createLink($GLOBALS['target']) . '" method="post">' . "\n" . '<input type="hidden" name="action" value="login">' . "\n"; $login_form_end = '</form>' . "\n"; $login_form_username = '******' . $dfuser . '">'; $login_form_password = '******' . $dfpass . '">'; $login_form_ftpserver = '<input type="text" name="ftpserver" value="' . $dfhost . '">'; $login_form_submit = '<input type="submit" name="submit" value="' . lang('connect') . '">' . "\n"; $login_form_end = "</form>"; $GLOBALS['phpgw']->template->set_var(array('login_form_begin' => $login_form_begin, 'login_form_end' => $login_form_end, 'login_form_username' => $login_form_username, 'login_form_password' => $login_form_password, 'login_form_ftpserver' => $login_form_ftpserver, 'login_form_submit' => $login_form_submit, 'lang_username' => lang('username'), 'lang_password' => lang('password'), 'langserver' => lang('Ftp Server'))); $GLOBALS['phpgw']->template->set_var('lang_login', lang('Log into FTP server')); $GLOBALS['phpgw']->template->set_var('lang_ftpserver', lang('FTP hostname')); $GLOBALS['phpgw']->template->parse('loginform', 'login', false); $GLOBALS['phpgw']->template->p('loginform'); return; }
$cat_cha_level_3 = $menuid->getCatcha($iCat,3); $sqlmenusub = " AND cat_id IN(" . $menuid->getAllChildId($cat_cha) . ")"; $listiCat = $menuid->getAllChildId($iCat); $sqlcategory = " AND cat_id IN(" . $listiCat . ")"; $cat_child = count(explode(",",$listiCat)); // tinh so cap con // Thay doi 3 the meta if($iData == 0){ $con_site_title = $row['cat_name']; $con_site_title .= $page != '' ? ' - Trang ' . $page : ''; $con_meta_description = $row['cat_name']; $con_meta_keywords = $row['cat_name']; } // End if($iData == 0) // Redirect neu ten bai viet khong dung if( ($iData == 0 || $sData == '') && $sCat != $row['cat_name_rewrite']){ $link_redirect = createLink('cat', array('dat_id' => $row['cat_id'], 'dat_rewrite' => $row['cat_name_rewrite']) ); redirect($link_redirect); } } // End if($row = mysql_fetch_assoc($db_cat->result)) unset($db_cat); } // End if($iCat != 0) /** * Breadcrumbs */ $home_address = '<li><i class="glyphicon glyphicon-home" style="color: #666"></i> <a href="/">Trang chủ</a></li>'; if($module != '') $home_address .= array_key_exists($module, $arrCatType) ? '<li><a href="/' . $arrCatType[$module]['typ_module'] . '.html">' . $arrCatType[$module]['typ_name'] .'</a></li>' : ''; if($iCat != 0) $home_address .= $menuid->getAllParentList("categories_multi","cat_id","cat_name","cat_parent_id",$iCat,"","",$module,($module!='') ? 1 : 0,$lang_path,'','');
public function getViewHTML( IdStack $idPath, $value ) { global $wgOut; $definition = getDefinedMeaningDefinition( $value ); $definedMeaningAsLink = definedMeaningAsLink( $value ); $escapedDefinition = htmlspecialchars( $definition ); if ( $this->truncate && strlen( $definition ) > $this->truncateAt ) $escapedDefinition = '<span title="' . $escapedDefinition . '">' . htmlspecialchars( mb_substr( $definition, 0, $this->truncateAt ) ) . wfMsg( 'ellipsis' ) . '</span>' . EOL; static $isMetaDescSet = 0 ; if ( $isMetaDescSet == 0 ) { $expression = definedMeaningExpression ( $value ) ; $wgOut->addMeta( 'Description', $expression . ": " . $definition ); $isMetaDescSet = 1 ; } $DMPageName = definingExpression( $value ) . " (" . $value . ")" ; $DMTitle = Title::makeTitle( NS_DEFINEDMEANING , $DMPageName ); $editURL = $DMTitle->getLocalURL( 'action=edit' ) ; $editLink = '<div style="float:right; font-size:60%;"><sup>[' . createLink( $editURL , wfMsg( 'edit') ) . ']</sup></div>' ; return $editLink . $definedMeaningAsLink . ": " . $escapedDefinition ; }
<div class="pagination"> <ul> <li><?php createLink($first, $firstUrl, 'First'); ?> </li> <li><?php createLink($prev, $prevUrl, 'Prev'); ?> </li> <li><?php createLink($next, $nextUrl, 'Next'); ?> </li> <li><?php createLink($last, $lastUrl, 'Last'); ?> </li> </ul> </div> </section> <?php function createLink($state, $url, $label) { $class = null; if (!$state) { $url = 'javascript:void(0)'; $class = 'class="disabled"';
/** * Shows the list of categories using a given template */ function showCategoryList($template) { global $CONF, $manager; // determine arguments next to catids // I guess this can be done in a better way, but it works global $archive, $archivelist; $linkparams = array(); if ($archive) { $blogurl = createArchiveLink($this->getID(), $archive, ''); $linkparams['blogid'] = $this->getID(); $linkparams['archive'] = $archive; } else { if ($archivelist) { $blogurl = createArchiveListLink($this->getID(), ''); $linkparams['archivelist'] = $archivelist; } else { $blogurl = createBlogidLink($this->getID(), ''); $linkparams['blogid'] = $this->getID(); } } //$blogurl = $this->getURL() . $qargs; //$blogurl = createBlogLink($this->getURL(), $linkparams); $template =& $manager->getTemplate($template); //: Change: Set nocatselected variable if ($this->getSelectedCategory()) { $nocatselected = 'no'; } else { $nocatselected = 'yes'; } echo TEMPLATE::fill(isset($template['CATLIST_HEADER']) ? $template['CATLIST_HEADER'] : null, array('blogid' => $this->getID(), 'blogurl' => $blogurl, 'self' => $CONF['Self'], 'catiscurrent' => $nocatselected, 'currentcat' => $nocatselected)); $query = 'SELECT catid, cdesc as catdesc, cname as catname FROM ' . sql_table('category') . ' WHERE cblog=' . $this->getID() . ' ORDER BY cname ASC'; $res = sql_query($query); while ($data = sql_fetch_assoc($res)) { $data['blogid'] = $this->getID(); $data['blogurl'] = $blogurl; $data['catlink'] = createLink('category', array('catid' => $data['catid'], 'name' => $data['catname'], 'extra' => $linkparams)); $data['self'] = $CONF['Self']; //catiscurrent //: Change: Bugfix for catiscurrent logic so it gives catiscurrent = no when no category is selected. $data['catiscurrent'] = 'no'; $data['currentcat'] = 'no'; if ($this->getSelectedCategory()) { if ($this->getSelectedCategory() == $data['catid']) { $data['catiscurrent'] = 'yes'; $data['currentcat'] = 'yes'; } /*else { $data['catiscurrent'] = 'no'; $data['currentcat'] = 'no'; }*/ } else { global $itemid; if (intval($itemid) && $manager->existsItem(intval($itemid), 0, 0)) { $iobj =& $manager->getItem(intval($itemid), 0, 0); $cid = $iobj['catid']; if ($cid == $data['catid']) { $data['catiscurrent'] = 'yes'; $data['currentcat'] = 'yes'; } /*else { $data['catiscurrent'] = 'no'; $data['currentcat'] = 'no'; }*/ } } $manager->notify('PreCategoryListItem', array('listitem' => &$data)); echo TEMPLATE::fill(isset($template['CATLIST_LISTITEM']) ? $template['CATLIST_LISTITEM'] : null, $data); //$temp = TEMPLATE::fill((isset($template['CATLIST_LISTITEM']) ? $template['CATLIST_LISTITEM'] : null), $data); //echo strftime($temp, $current->itime); } sql_free_result($res); echo TEMPLATE::fill(isset($template['CATLIST_FOOTER']) ? $template['CATLIST_FOOTER'] : null, array('blogid' => $this->getID(), 'blogurl' => $blogurl, 'self' => $CONF['Self'])); }
/** * Parse templatevar itemlink */ function parse_itemlink() { echo createLink('item', array('itemid' => $this->currentItem->itemid, 'title' => $this->currentItem->title, 'timestamp' => $this->currentItem->timestamp, 'extra' => $this->linkparams)); }
<?php echo generate_sort("asc", 5, $sort, $fs_imagepath); ?> <?php echo generate_sort("desc", 6, $sort, $fs_imagepath); ?> </div> </td> <td align="center">Tạo link</td> </tr> <? // Đếm số thứ tự $No = ($current_page - 1) * $page_size; while($listing = mysql_fetch_array($db_listing->result)){ $No++; $link= createLink("detail",array('module'=>strtolower($module),"Rcat"=>$listing["cat_rewrite"],"title"=>$listing["dat_title"],"iCat"=>$iCat,"iData"=>$listing["dat_id"])); ?> <tr id="tr_<?php echo $No; ?> "> <td class="No"><?php echo $No; ?> </td> <td align="right" class="text_normal_bold"> <?php echo $listing["dat_id"]; ?> </td> <td>
<div class="pagination"> <ul> <li><?php createLink($firstStatus, $firstUrl, 'First'); ?> </li> <li><?php createLink($prevStatus, $prevUrl, 'Prev'); ?> </li> <li><?php createLink($nextStatus, $nextUrl, 'Next'); ?> </li> <li><?php createLink($lastStatus, $lastUrl, 'Last'); ?> </li> </ul> </div> <div id="cat-bottom"></div> </section> <?php function createLink($status, $url, $label) { $class = null; if (!$status) { $url = 'javascript:void(0)'; $class = 'class="disabled"'; }
} if (trim($_POST['user']) == '') { warn('Indique el usuario'); header('Location: login.php'); exit; } if (trim($_POST['password']) == '') { warn('Indique la contraseña'); header('Location: login.php'); exit; } $host = $cfg['db_corporativo']['host']; $user = $cfg['db_corporativo']['user']; $pass = $cfg['db_corporativo']['password']; $database = $cfg['db_corporativo']['database']; $linkCorporativo = createLink($host, $user, $pass, $database); $user = strtoupper($_POST['user']); $pass = $_POST['password']; $result = doQuery(sqlUsuario($user, $pass, $linkCorporativo), $linkCorporativo, $err); if (getNumRows($result) == 0) { err('Datos incorrectos, verifique'); header('Location: login.php'); exit; } else { $usuario = getDict($result); $_SESSION['clave_usuario'] = $usuario['clave_usuario']; $_SESSION['autentificado'] = true; $_SESSION['last_activity'] = $_SERVER['REQUEST_TIME']; header('Location: index.php'); } doClose($linkCorporativo);
function getAllParentList($table_name,$id_field,$name_field,$parent_id_field,$id,$seperate_str,$class_link="link_title",$modlue="product",$type_list=0,$lang_path,$con_extenstion,$con_mod_rewrite){ $count_var = 0; $parent_list = ""; $finish=false; $current_id = $id; $iCat = 0; if(isset($_GET["iCat"])) $iCat=$_GET["iCat"]; while (!$finish){ $db_getparent = new db_query ("SELECT " . $parent_id_field . ",cat_id,cat_name_rewrite," . $name_field . " " . (($modlue=='') ? ',cat_type' : '') . " FROM " . $table_name . " " . " WHERE " . $id_field . "=" . $current_id); if ($row=mysql_fetch_array($db_getparent->result)){ $count_var++; $link = createLink("cat",$row); $link_cat = createLink("cat",$row); //ghep vao chuoi str if ($parent_list==""){ if($type_list==1){ $parent_list = "<li><a href=\"" . $link . "\" class=\"" . $class_link . "\">" . $row[$name_field] . "</a></li>"; }else{ $parent_list = "<li>" . $row[$name_field] . "</li>"; } }else{ if($type_list==0){ $parent_list ="<li><a href=\"" . $link . "\" class=\"" . $class_link . "\">" . $row[$name_field] . "</a></li>" . $seperate_str . "<b>" . $parent_list . "</b>"; }else{ $parent_list ="<li><a href=\"" . $link . "\" class=\"" . $class_link . "\">" . $row[$name_field] . "</a>" . $seperate_str . "<a href=\"" . $link_cat . "\" class=\"" . $class_link . "\">" . $parent_list . "</a></li>"; } } $current_id = $row[$parent_id_field]; } else{ $finish=true; } } return $parent_list; }
/** * Creates a Folder asset with the specified name and parent * * @param string $name The name of the Folder to create * @param object &$parent_folder The parent asset * * @return int * @access public */ function createFolder($name, &$parent_folder) { printStdErr('- Creating Folder ' . $name); $folder = new Folder(); printStdErr('.'); // Set Folder name $folder->setAttrValue('name', $name); printStdErr('.'); // Link the new asset under the parent folder $link_id = createLink($parent_folder, $folder); printStdErr('.'); // Free memory $GLOBALS['SQ_SYSTEM']->am->forgetAsset($folder); printStdErr(' => asset ID ' . $folder->id . "\n"); echo formatCSVValue($name) . ',' . $folder->id; return $folder->id; }
} if ($file->isFile() && preg_match("/\\.(md|txt)\$/", $file->getFilename())) { $list[] = $file->getPathname(); } } sort($list); $headerList = []; foreach ($list as $path) { $content = file_get_contents($path); if (!preg_match("/^#\\s([^\n]+)\$/mu", $content, $m)) { throw new Exception("No H1 in file {$path}"); } $h1 = trim($m[1]); $relativePath = getRelativePath($path, $baseDir); $section = dirname($relativePath); $headerList[$section][] = '- ' . createLink($relativePath, $h1); } ksort($headerList); $indexTemplatePath = __DIR__ . '/README.md.template'; $readmePath = dirname(__DIR__) . '/README.md'; $headerListContent = ''; foreach ($headerList as $title => $section) { $title = $title && $title != '.' ? $title . '/' : 'Основное'; $headerListContent .= "### {$title}\n\n"; $headerListContent .= implode("\n", $section) . "\n\n"; } $readme = file_get_contents($indexTemplatePath); $readme = preg_replace("/{CONTENTS}/", $headerListContent, $readme); file_put_contents($readmePath, $readme); function getRelativePath($path, $base) {
/** * Sends a message from the current member to the member given as argument */ function sendMessage() { global $CONF, $member; $error = $this->validateMessage(); if ($error != '') { return array('message' => $error); } if (!$member->isLoggedIn()) { $fromMail = postVar('frommail'); $fromName = _MMAIL_FROMANON; } else { $fromMail = $member->getEmail(); $fromName = $member->getDisplayName(); } $tomem = new MEMBER(); $tomem->readFromId(postVar('memberid')); $message = _MMAIL_MSG . ' ' . $fromName . "\n" . '(' . _MMAIL_FROMNUC . ' ' . $CONF['IndexURL'] . ") \n\n" . _MMAIL_MAIL . " \n\n" . postVar('message'); $message .= getMailFooter(); $title = _MMAIL_TITLE . ' ' . $fromName; mb_language('ja'); mb_internal_encoding(_CHARSET); @mb_send_mail($tomem->getEmail(), $title, $message, "From: " . $fromMail); if (postVar('url')) { redirect(postVar('url')); } else { $CONF['MemberURL'] = $CONF['IndexURL']; if ($CONF['URLMode'] == 'pathinfo') { $url = createLink('member', array('memberid' => $tomem->getID(), 'name' => $tomem->getDisplayName())); } else { $url = $CONF['IndexURL'] . createMemberLink($tomem->getID()); } redirect($url); } exit; }
$loader = (require 'vendor/autoload.php'); include 'vendor/composer/autoload_classmap.php'; define('FOLDER_CADENZA', $baseDir . '/vendor.src'); emptyFolder(FOLDER_CADENZA); $packages = packages($loader); foreach ($packages as $preffix => $paths) { $package = package($preffix); $folder = FOLDER_CADENZA . "/{$package}"; if (count($paths) > 1) { readfile(__DIR__ . '/message.txt'); exit; } $path = $paths[0]; if (inVendor($path)) { createLink($path, $folder); } } function packages($loader) { $methods = array('getPrefixes', 'getPrefixesPsr4', 'getFallbackDirs', 'getFallbackDirsPsr4', 'getClassMap'); $result = array(); foreach ($methods as $method) { if ($paths = $loader->{$method}()) { $result = array_merge($result, $paths); } } return $result; } function package($preffix) {
<?php error_reporting(E_ALL); ini_set('display_errors', 1); // Konfig laden require_once 'config.php'; // Funktionen einbinden require_once 'functions.php'; // Skript initialisieren require_once 'init.php'; $c = 0; $nodes = array(); $results = array(); $literals = array(); $nodesJSON = sparqlQuery($nodeQuery); if ($linkQuery) { $linksJSON = sparqlQuery($linkQuery); } // Alle Knoten erzeugen foreach ($nodesJSON['results']['bindings'] as $binding) { createNode($binding['nodeuri']['value'], getTitleByUri($binding['nodetitle']['value']), $binding['shape']['value'], $binding['color']['value']); } // Alle Links erzeugen if ($linkQuery) { foreach ($linksJSON['results']['bindings'] as $binding) { createLink($binding['source']['value'], $binding['target']['value'], getTitleByUri($binding['linktitle']['value']), 10); } } $results['literals'] = $literals; echo json_encode($results);
} $products_id = $_POST['id']; if (postOK('category')) { $category = explode('/', $_POST['category']); $option = $category[0]; $value = $category[1]; $optionId = optionExists($option); $valueId = valueExists($value); if (!$optionId) { $optionId = createOption($option); } if (!$valueId) { $valueId = createValue($value); } if (!isOptionLinkedToValue($optionId, $valueId)) { createLink($optionId, $valueId); } if (!isProductLinked($optionId, $valueId, $products_id)) { createLinkToProduct($optionId, $valueId, $products_id); } die; } tep_db_connect() or die('Unable to connect to database'); $language_id = getDefaultLanguageID(); $update_array = array('title'); $db_array = array('products_name'); $set_update = create_update_list($update_array, $db_array); if (!empty($set_update)) { $query = "update " . TABLE_PRODUCTS_DESCRIPTION . " set {$set_update} where products_id = " . $products_id . " and language_id = " . $language_id; tep_db_query($query); }
?> </div> </div> <div class="textcontainer" title="English Books Hamburg"> <div> <?php echoMessage("index.about1"); ?> </div> <div> <h2> <?php echo createLink("general", "index.whatsnew"); ?> </h2> </div> <div> <img class="newsimage" src="images/newsimage1.jpg"/> </div> <div> <?php echoMessage("index.news.n1"); ?> </div> <div> <?php
/** * Parse skinvar commentform */ function parse_commentform($destinationurl = '') { global $blog, $itemid, $member, $CONF, $manager, $DIR_LIBS, $errormessage; // warn when trying to provide a actionurl (used to be a parameter in Nucleus <2.0) if (stristr($destinationurl, 'action.php')) { $args = func_get_args(); $destinationurl = $args[1]; ACTIONLOG::add(WARNING, _ACTIONURL_NOTLONGER_PARAMATER); } $actionurl = $CONF['ActionURL']; // if item is closed, show message and do nothing $item =& $manager->getItem($itemid, 0, 0); if ($item['closed'] || !$blog->commentsEnabled()) { $this->doForm('commentform-closed'); return; } if (!$blog->isPublic() && !$member->isLoggedIn()) { $this->doForm('commentform-closedtopublic'); return; } if (!$destinationurl) { $destinationurl = createLink('item', array('itemid' => $itemid, 'title' => $item['title'], 'timestamp' => $item['timestamp'], 'extra' => $this->linkparams)); // note: createLink returns an HTML encoded URL } else { // HTML encode URL $destinationurl = htmlspecialchars($destinationurl, ENT_QUOTES); } // values to prefill $user = cookieVar($CONF['CookiePrefix'] . 'comment_user'); if (!$user) { $user = postVar('user'); } $userid = cookieVar($CONF['CookiePrefix'] . 'comment_userid'); if (!$userid) { $userid = postVar('userid'); } $email = cookieVar($CONF['CookiePrefix'] . 'comment_email'); if (!$email) { $email = postVar('email'); } $body = postVar('body'); $this->formdata = array('destinationurl' => $destinationurl, 'actionurl' => htmlspecialchars($actionurl, ENT_QUOTES), 'itemid' => $itemid, 'user' => htmlspecialchars($user, ENT_QUOTES), 'userid' => htmlspecialchars($userid, ENT_QUOTES), 'email' => htmlspecialchars($email, ENT_QUOTES), 'body' => htmlspecialchars($body, ENT_QUOTES), 'membername' => $member->getDisplayName(), 'rememberchecked' => cookieVar($CONF['CookiePrefix'] . 'comment_user') ? 'checked="checked"' : ''); if (!$member->isLoggedIn()) { $this->doForm('commentform-notloggedin'); } else { $this->doForm('commentform-loggedin'); } }
/** * Create an asset of a specified type with associated metadata and attribute settings * * @param array $asset_spec The specification of the asset fields directly from the CSV import file * @param string $asset_type_code The Matrix asset type code or the asset which is to be created * @param object &$parent_asset The parent asset under which the new asset is to reside * @param int $schema_id The asset ID of the Metadata Schema to associate with the new asset * @param array $metadata_mapping A structure containing Supplied Field Name to Metadata Field asset ID associations * @param array $attribute_mapping A structure containing Supplied Field Name to Asset Attribute Name associations * * @return void * @access public */ function createAsset(array $asset_spec, $asset_type_code, Asset &$parent_asset, $schema_id, array $metadata_mapping, array $attribute_mapping) { $attribs = array(); echo '- Creating asset'; $asset = new $asset_type_code(); echo '.'; // Set attributes editAttributes($asset, $asset_spec, $attribute_mapping); echo '.'; // Link the new asset under the parent folder $link_id = createLink($parent_asset, $asset); echo '.'; // Assign metadata schema and values to the asset editMetadata($asset, $asset_spec, $metadata_mapping, $schema_id); echo '.'; // Free memory $GLOBALS['SQ_SYSTEM']->am->forgetAsset($asset); echo ' => asset ID ' . $asset->id . "\n"; return array(reset($asset_spec) => $asset->id); }
function createBlogidLink($blogid, $params = '') { return createLink('blog', array('blogid' => $blogid, 'extra' => $params)); }
<?php error_reporting(E_ALL); include_once "BluePHP/Utils/Input.inc"; include_once "BluePHP/GUI/Concat.inc"; include_once "BluePHP/GUI/Dialog.inc"; include_once "BluePHP/BlueSystem/GUI/BSApplication.inc"; $elts = array(); foreach (glob("../tutorial/*.php") as $filename) { $id = basename($filename, ".php"); $d = new Dialog($id, $id . ".php", null); $d->setHeader(createLink(array("url" => $filename, "value" => $id . ".php", "nofollow" => true))); $d->setContent(highlight_file($filename, true)); array_push($elts, $d); } $app = new BSApplication(new Concat($elts)); $app->addRenderStyle("/BluePHP/doc/styles/main.css"); $app->render();
function definedMeaningAsLink( $definedMeaningId ) { if ( $definedMeaningId > 0 ) return createLink( definedMeaningIdAsURL( $definedMeaningId ), definedMeaningExpression( $definedMeaningId ) ); else return ""; }
?> <div class="notif-block-wrap" id="notif-block-wrap"> <?php $jsIds = ""; $maxId = 0; $newFlag = false; $firstNewFlag = true; foreach ($arResult as $data) { $avatarId = "notif-avatar-" . randString(5); $jsIds .= $jsIds !== "" ? ', "' . $avatarId . '"' : '"' . $avatarId . '"'; $arFormat = array("tommorow" => "tommorow, " . GetMessage('NM_FORMAT_TIME'), "today" => "today, " . GetMessage('NM_FORMAT_TIME'), "yesterday" => "yesterday, " . GetMessage('NM_FORMAT_TIME'), "" => GetMessage('NM_FORMAT_DATE')); $maxId = $data['id'] > $maxId ? $data['id'] : $maxId; $data['date'] = FormatDate($arFormat, $data['date']); $data['text'] = preg_replace("/<img.*?data-code=\"([^\"]*)\".*?>/i", "\$1", $data['text']); $data['text'] = strip_tags($data['text'], '<br>'); $data['link'] = createLink($data['original_tag']); if ($data['read'] == 'N' && !$newFlag || $data['read'] == 'Y' && $newFlag) { $newFlag = $newFlag ? false : true; if (!$firstNewFlag) { ?> <div class="notif-new"></div><?php } } $firstNewFlag = false; ?> <div id="notify<?php echo $data['id']; ?> " class="notif-block" <?php echo $data['link'] && $data['type'] != 1 ? ' onclick="' . $data['link'] . '"' : ''; ?>
define('APPLICATION_ENV', 'development'); $cwd = realpath(dirname(__FILE__)); $zfdir = null; if (1 < $argc) { $arg0 = $argv[1]; if (in_array($arg0, array('-h', '--help', '-?'))) { help(); exit; } $zfdir = $argv[1]; } echo "Creating required symlinks...\n"; createLink($cwd . '/public/js-src', $cwd . '/public/js'); if ($zfdir) { createLink($zfdir, $cwd . '/library/Zend'); } echo "[DONE] Creating required symlinks\n\n"; echo "Creating initial database...\n"; include $cwd . '/scripts/loadTestDb.php'; echo "[DONE] Creating initial database\n\n"; echo "Setting permissions...\n"; dirSetPerms($cwd . '/data', 0777); dirSetPerms($cwd . '/public/api/spindle/paste/content', 0777); echo "[DONE] Setting permissions\n\n"; // Done echo <<<EOM Thank you for trying this application. To use it, please make sure you have setup an apache vhost (or similar functionality on other web servers) according to the instructions in the README.txt file. EOM;
function multiSelectLevelMenuCat($parentId = 0, $arrLists = array(), $arrData = array()){ $html = ''; $str = ''; // Nếu tồn tại cấp này if(isset($arrLists[$parentId])) { $class_ul = $parentId == 0 ? '' : ''; $html .= '<ul class="list_mn_vw">'; // Mở UL\ $link_cat = ''; $link = ''; $style = ''; // Đưa ra tất cả mục của cấp foreach ($arrLists[$parentId] as $childId) { $name = htmlspecialchars($arrData[$childId]['cat_name']); $str = ''; if($arrData[$childId]['level'] == 1){ $str = '<b class="b_bullet"></b>'; } // code scrip if($arrData[$childId]['level'] == 2){ $link_cat_cb = createLink("cat_coban",array('dat_id'=> $arrData[$childId]['cat_id'],'dat_rewrite' => $arrData[$childId]['cat_name_rewrite'])); $link_cat_ht = createLink("cat_hotro",array('dat_id'=> $arrData[$childId]['cat_id'],'dat_rewrite' => $arrData[$childId]['cat_name_rewrite'])); if($arrData[$childId]['cat_type'] == 'cobanvnp'){ $link = 'href = "/' . $link_cat_cb . '"'; }else if($arrData[$childId]['cat_type'] == 'hotrokinhdoanh'){ $link = 'href = "/' . $link_cat_ht . '"'; } } else{ $link = ''; } $html .= '<li class="cat_'.$arrData[$childId]['cat_id'].'">'.$str; $html .= '<a '.$link.' title="'. $arrData[$childId]['cat_name'].'">'; if($arrData[$childId]['level'] == 0){ $html .= '<h3 class="lef_title">'.$name.'</h3>'; }else{ $html .= $name; } $html .= '</a>'; $html .= multiSelectLevelMenuCat($childId, $arrLists, $arrData); // Gọi lại hàm để tìm tất cả cấp con của mục này $html .= '</li>'; // Đóng LI } $html .= '</ul>'; // Đóng UL } return $html; }// END function multiSele5ctLevelMenuCat
createLink($folderRoot . $filename . '/admin', $wwwRoot . 'administrator/components/' . $filename); createLink($folderRoot . $filename . '/site', $wwwRoot . 'components/' . $filename); createLink($folderRoot . $filename . '/media', $wwwRoot . 'media/' . $filename); } if (strpos($filename, 'mod_') === 0) { createLink($folderRoot . $filename, $wwwRoot . 'modules/' . $filename); } if (strpos($filename, 'plg_') === 0) { foreach (new RegexIterator(new DirectoryIterator($folderRoot . $filename), "/\\.xml\$/i") as $pluginFile) { $xml = new SimpleXMLElement(file_get_contents($folderRoot . $filename . '/' . $pluginFile)); foreach ($xml->files->filename as $file) { $plugin = (string) $file->attributes()->plugin; if (!$plugin) { continue; } createLink($folderRoot . $filename, $wwwRoot . 'plugins/' . $xml->attributes()->group . '/' . $plugin); } } } } echo 'Finished to create the links.' . PHP_EOL; function createLink($source, $target) { if (is_dir($target)) { echo 'Skipped target: ' . $target . PHP_EOL; return; } $source = realpath($source); @mkdir(dirname($target), '777', true); shell_exec('ln -sf ' . $source . ' ' . $target); echo 'Created link from: ' . $source . ' to: ' . $target . PHP_EOL;
ftp_chdir($ftp, $connInfo['cwd']); } elseif ($olddir) { ftp_chdir($ftp, $olddir); } if (!$olddir) { $olddir = ftp_pwd($ftp); } $cwd = ftp_pwd($ftp); $connInfo['cwd'] = $cwd; // set up the upload form $ul_form_open = '<form name="upload" action="' . createLink($GLOBALS['target']) . '" enctype="multipart/form-data" method="post">' . "\n" . '<input type="hidden" name="olddir" value="' . $cwd . '">' . "\n" . '<input type="hidden" name="action" value="upload">' . "\n"; $ul_select = '<input type="file" name="uploadfile" size="30">' . "\n"; $ul_submit = '<input type="submit" name="upload" value="Upload">' . "\n"; $ul_form_close = '</form>' . "\n"; // set up the create directory $crdir_form_open = '<form name="mkdir" action="' . createLink($GLOBALS['target']) . '" method="post" >' . "\n" . "\t" . '<input type="hidden" name="olddir" value="' . $cwd . '">' . "\n" . "\t" . '<input type="hidden" name="action" value="mkdir">' . "\n"; $crdir_form_close = '</form>' . "\n"; $crdir_textfield = "\t" . '<input type="text" size="30" name="newdirname" value="">' . "\n"; $crdir_submit = "\t" . '<input type="submit" name="submit" value="Create New Dir">' . "\n"; $ftp_location = 'ftp://' . $connInfo['username'] . '@' . $connInfo['ftpserver'] . $cwd; $newdir = ''; $temp = $olddir; $olddir = $homedir; $home_link = macro_get_Link('cwd', '<img border="0" src="' . $GLOBALS['phpgw']->common->image('ftp', 'home.gif') . '">') . "\n"; $olddir = $temp; // set up all the global variables for the template $GLOBALS['phpgw']->template->set_var(array('ftp_location' => $ftp_location, 'relogin_link' => macro_get_Link('newlogin', lang('logout/relogin')), 'home_link' => $home_link, 'ul_select' => $ul_select, 'ul_submit' => $ul_submit, 'ul_form_open' => $ul_form_open, 'ul_form_close' => $ul_form_close, 'crdir_form_open' => $crdir_form_open, 'crdir_form_close' => $crdir_form_close, 'crdir_textfield' => $crdir_textfield, 'crdir_submit' => $crdir_submit)); $total = count(ftp_rawlist($ftp, '')); $GLOBALS['phpgw']->template->set_var('nextmatchs_left', $GLOBALS['phpgw']->nextmatchs->left('/ftp/index.php', $start, $total)); $GLOBALS['phpgw']->template->set_var('nextmatchs_right', $GLOBALS['phpgw']->nextmatchs->right('/ftp/index.php', $start, $total)); $contents = phpftp_getList($ftp, '.', $start);
<li class="page-button page-button-last <?php echo $pagination->total_pages == $pagination->current ? "current" : ""; ?> " <?php echo $pagination->total_pages < 5 ? "style='display:none'" : ""; ?> > <a href="<?php echo createLink("/properties", ['current' => $pagination->total_pages, 'per_page' => $pagination->per_page, 'sort' => $pagination->sort_encoded]); ?> "> <?php echo $pagination->total_pages; ?> </a> </li> <li class="next" <?php echo $pagination->total_pages < 4 || $pagination->total_pages == $pagination->current ? "style='display:none'" : ""; ?> > <a href="<?php echo createLink("/properties", ['current' => $pagination->next, 'per_page' => $pagination->per_page, 'sort' => $pagination->sort_encoded]); ?> "> » </a> </li> </ul> </div> </div>