本文整理汇总了PHP中hasResources函数的典型用法代码示例。如果您正苦于以下问题:PHP hasResources函数的具体用法?PHP hasResources怎么用?PHP hasResources使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了hasResources函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _tabResourceManagement
/**
* survey::_tabResourceManagement()
* Load "Resources" tab.
* @param mixed $iSurveyID
* @return
*/
private function _tabResourceManagement($iSurveyID)
{
global $sCKEditorURL;
// TAB Uploaded Resources Management
$ZIPimportAction = " onclick='if (validatefilename(this.form,\"" . gT('Please select a file to import!', 'js') . "\")) { this.form.submit();}'";
if (!function_exists("zip_open")) {
$ZIPimportAction = " onclick='alert(\"" . gT("zip library not supported by PHP, Import ZIP Disabled", "js") . "\");'";
}
$disabledIfNoResources = '';
if (hasResources($iSurveyID, 'survey') === false) {
$disabledIfNoResources = " disabled='disabled'";
}
//$aData['esrow'] = $esrow;
$aData['ZIPimportAction'] = $ZIPimportAction;
$aData['disabledIfNoResources'] = $disabledIfNoResources;
$dqata['sCKEditorURL'] = $sCKEditorURL;
return $aData;
}
示例2: array
?>
<ul>
<li>
<label> </label>
<?php
echo CHtml::dropDownList('type', 'files', array('files' => $clang->gT('Files'), 'flash' => $clang->gT('Flash'), 'images' => $clang->gT('Images')));
?>
<input type='submit' value="<?php
$clang->eT("Browse uploaded resources");
?>
" />
</li>
<li>
<label> </label>
<input type='button'<?php
echo hasResources($lid, 'label') === false ? ' disabled="disabled"' : '';
?>
onclick='window.open("<?php
echo $this->createUrl("/admin/export/sa/resources/export/label/lid/{$lid}");
?>
", "_blank")'
value="<?php
$clang->eT("Export resources as ZIP archive");
?>
" />
</li>
</ul>
<input type='hidden' name='lid' value='<?php
echo $lid;
?>
' />
示例3: foreach
$i++;
}
$labelsoutput .= "<div id='tabs'><ul>";
foreach($tab_title as $i=>$eachtitle){
$labelsoutput .= "<li><a href='#neweditlblset$i'>$eachtitle</a></li>";
}
$labelsoutput .= "<li><a href='#up_resmgmt'>".$clang->gT("Uploaded Resources Management")."</a></li>";
$labelsoutput .= "</ul>";
foreach($tab_content as $i=>$eachcontent){
$labelsoutput .= "<div id='neweditlblset$i'>$eachcontent</div>";
}
$labelsoutput .="</form>";
$disabledIfNoResources = '';
if (hasResources($lid,'label') === false)
{
$disabledIfNoResources = " disabled='disabled'";
}
// TAB for resources management
$ZIPimportAction = " onclick='if (validatefilename(this.form,\"".$clang->gT('Please select a file to import!','js')."\")) {this.form.submit();}'";
if (!function_exists("zip_open"))
{
$ZIPimportAction = " onclick='alert(\"".$clang->gT("zip library not supported by PHP, Import ZIP Disabled","js")."\");'";
}
$labelsoutput.="<div id='up_resmgmt'><div>\t<form class='form30' enctype='multipart/form-data' id='importlabelresources' name='importlabelresources' action='$scriptname' method='post' onsubmit='return validatefilename(this,\"".$clang->gT('Please select a file to import!','js')."\");'>\n"
. "\t<input type='hidden' name='lid' value='$lid' />\n"
. "\t<input type='hidden' name='action' value='importlabelresources' />\n"
. "\t<ul style='list-style-type:none; text-align:center'>\n"
示例4: array
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">
<div class="panel-body">
<div>
<?php echo CHtml::form('third_party/kcfinder/browse.php?language='.sTranslateLangCode2CK(App()->language), 'get', array('id'=>'browselabelresources','class'=>'form30','name'=>'browselabelresources','target'=>'_blank')); ?>
<ul class="list-unstyled">
<li>
<label> </label>
<?php echo CHtml::dropDownList('type', 'files', array('files' => gT('Files'), 'flash' => gT('Flash'), 'images' => gT('Images'))); ?>
<input type='submit' value="<?php eT("Browse uploaded resources") ?>" />
</li>
<li>
<label> </label>
<input class="btn btn-default" type='button'<?php echo hasResources($lid, 'label') === false ? ' disabled="disabled"' : '' ?>
onclick='window.open("<?php echo $this->createUrl("/admin/export/sa/resources/export/label/lid/$lid"); ?>", "_blank")'
value="<?php eT("Export resources as ZIP archive") ?>" />
</li>
</ul>
<input type='hidden' name='lid' value='<?php echo $lid; ?>' />
</form>
<?php echo CHtml::form(array('admin/labels/sa/importlabelresources'), 'post', array('id'=>'importlabelresources',
'class'=>'form30',
'name'=>'importlabelresources',
'enctype'=>'multipart/form-data',
'onsubmit'=>'return validatefilename(this, "'.gT('Please select a file to import!', 'js').'");')); ?>
<ul class="list-unstyled">
<li>
<label for='the_file'><?php eT("Select ZIP file:") ?></label>
<input id='the_file' name="the_file" type="file" />
示例5: getFleetStat
<td>' . getFleetStat($str, $sid, $fid) . '</td>
<td><input type="text" name="ship' . $x . '" value="0" size="1"></td>
<td></td>
</tr>';
}
}
echo '</table>';
/***************
PRINT OTHER FLEETS
***************/
echo '<center>';
if (getFleetStat(destination, $sid, $fid) == 0) {
$pid = getFleetStat(loc, $sid, $fid);
$query = "SELECT id,name,ship1,ship2,ship3,ship4,ship5,ship6,ship7 FROM fleet{$sid} WHERE ownerid={$id} AND loc={$pid} AND destination=0";
$result = mysql_query($query);
if (hasResources($sid, $fid)) {
echo '<br><br>You can not move ships in a fleet that still has resources.';
} else {
if (mysql_num_rows($result) == 1) {
echo '<br><br>You have no other fleets at this location';
} else {
echo '<select name="fleet">';
while ($row = mysql_fetch_array($result)) {
if ($row[id] != $fid) {
echo '<option value="' . $row[id] . '">' . $row[name] . ' [' . ($row[ship1] + $row[ship2] + $row[ship3] + $row[ship4] + $row[ship5] + $row[ship6] + $row[ship7]) . ']</option>';
}
}
echo '
<input type="submit" value="Move Ships">
<input type="hidden" value="true" name="fleetadd">
</form>';
示例6: isEmpty
// End Import TAB
$editsurvey .= "</div>\n";
// Copy survey TAB
$editsurvey .= "<div id='copy'>\n";
// Copy survey
$editsurvey .= "<form class='form30' action='{$scriptname}' id='copysurveyform' method='post' onsubmit=\"return (isEmpty(document.getElementById('copysurveylist'), '" . $clang->gT("Error: You have to select an existing survey.", 'js') . "') || isEmpty(document.getElementById('copysurveyname'), '" . $clang->gT("Error: You enter a name for the survey copy.", 'js') . "'));\">\n" . "<ul>\n" . "<li><label for='copysurveylist'><span class='annotationasterisk'>*</span>" . $clang->gT("Select survey to copy:") . "</label>\n" . "<select id='copysurveylist' name='copysurveylist'>\n" . getsurveylist(false, true) . "</select> <span class='annotation'>" . $clang->gT("*Required") . "</span></li>\n" . "<li><label for='copysurveyname'><span class='annotationasterisk'>*</span>" . $clang->gT("New survey title:") . "</label>\n" . "<input type='text' id='copysurveyname' size='82' maxlength='200' name='copysurveyname' value='' />" . "<span class='annotation'>" . $clang->gT("*Required") . "</span></li>\n" . "<li><label for='copysurveytranslinksfields'>" . $clang->gT("Convert resource links and INSERTANS fields?") . "</label>\n" . "<input id='copysurveytranslinksfields' name=\"copysurveytranslinksfields\" type=\"checkbox\" checked='checked'/></li>\n" . "<li><label for='copysurveyexcludequotas'>" . $clang->gT("Exclude quotas?") . "</label>\n" . "<input id='copysurveyexcludequotas' name=\"copysurveyexcludequotas\" type=\"checkbox\" /></li>\n" . "<li><label for='copysurveyexcludeanswers'>" . $clang->gT("Exclude answers?") . "</label>\n" . "<input id='copysurveyexcludeanswers' name=\"copysurveyexcludeanswers\" type=\"checkbox\" /></li>\n" . "<li><label for='copysurveyresetconditions'>" . $clang->gT("Reset conditions?") . "</label>\n" . "<input id='copysurveyresetconditions' name=\"copysurveyresetconditions\" type=\"checkbox\" /></li></ul>\n" . "<p><input type='submit' value='" . $clang->gT("Copy survey") . "' />\n" . "<input type='hidden' name='action' value='copysurvey' /></p></form>\n";
// End Copy survey TAB
$editsurvey .= "</div>\n";
} elseif ($action = "editsurveysettings") {
// TAB Uploaded Resources Management
$ZIPimportAction = " onclick='if (validatefilename(this.form,\"" . $clang->gT('Please select a file to import!', 'js') . "\")) {this.form.submit();}'";
if (!function_exists("zip_open")) {
$ZIPimportAction = " onclick='alert(\"" . $clang->gT("zip library not supported by PHP, Import ZIP Disabled", "js") . "\");'";
}
$disabledIfNoResources = '';
if (hasResources($surveyid, 'survey') === false) {
$disabledIfNoResources = " disabled='disabled'";
}
$editsurvey .= "<div id='resources'>\n" . "<form enctype='multipart/form-data' class='form30' id='importsurveyresources' name='importsurveyresources' action='{$scriptname}' method='post' onsubmit='return validatefilename(this,\"" . $clang->gT('Please select a file to import!', 'js') . "\");'>\n" . "<input type='hidden' name='sid' value='{$surveyid}' />\n" . "<input type='hidden' name='action' value='importsurveyresources' />\n" . "<ul>\n" . "<li><label> </label>\n" . "<input type='button' onclick='window.open(\"{$homeurl}/scripts/kcfinder/browse.php\", \"_blank\")' value=\"" . $clang->gT("Browse Uploaded Resources") . "\" {$disabledIfNoResources} /></li>\n" . "<li><label> </label>\n" . "<input type='button' onclick='window.open(\"{$scriptname}?action=exportsurvresources&sid={$surveyid}\", \"_blank\")' value=\"" . $clang->gT("Export Resources As ZIP Archive") . "\" {$disabledIfNoResources} /></li>\n" . "<li><label for='the_file'>" . $clang->gT("Select ZIP File:") . "</label>\n" . "<input id='the_file' name='the_file' type='file' size='50' /></li>\n" . "<li><label> </label>\n" . "<input type='button' value='" . $clang->gT("Import Resources ZIP Archive") . "' {$ZIPimportAction} /></li>\n" . "</ul></form>\n";
// End TAB Uploaded Resources Management
$editsurvey .= "</div>\n";
}
// End TAB pane
$editsurvey .= "</div>\n";
// The external button to submit Survey edit changes
if ($action == "newsurvey") {
$cond = "if (isEmpty(document.getElementById('surveyls_title'), '" . $clang->gT("Error: You have to enter a title for this survey.", 'js') . "'))";
$editsurvey .= "<p><button onclick=\"{$cond} {document.getElementById('addnewsurvey').submit();}\" class='standardbtn' >" . $clang->gT("Save") . "</button></p>\n";
} elseif ($action == "editsurveysettings") {
$cond = "if (UpdateLanguageIDs(mylangs,'" . $clang->gT("All questions, answers, etc for removed languages will be lost. Are you sure?", "js") . "'))";
if (bHasSurveyPermission($surveyid, 'surveysettings', 'update')) {
示例7: array
}
?>
</form>
<div id='up_resmgmt'>
<div>
<form class='form30' id='browselabelresources' name='browselabelresources'
action='<?php echo $this->createUrl("admin/kcfinder/index/load/browse"); ?>' method='get' target="_blank">
<ul style='list-style-type:none; text-align:center'>
<li>
<label> </label>
<?php echo CHtml::dropDownList('type', 'files', array('files' => $clang->gT('Files'), 'flash' => $clang->gT('Flash'), 'images' => $clang->gT('Images'))); ?>
<input type='submit' value="<?php $clang->eT("Browse uploaded resources") ?>" />
</li>
<li>
<label> </label>
<input type='button'<?php echo hasResources($lid, 'label') === false ? ' disabled="disabled"' : '' ?>
onclick='window.open("<?php echo $this->createUrl("/admin/export/resources/export/label/lid/$lid"); ?>", "_blank")'
value="<?php $clang->eT("Export resources as ZIP archive") ?>" />
</li>
</ul>
</form>
<form class='form30' enctype='multipart/form-data' id='importlabelresources' name='importlabelresources'
action='<?php echo $this->createUrl('/admin/labels/importlabelresources') ?>' method='post'
onsubmit='return validatefilename(this, "<?php $clang->eT('Please select a file to import!', 'js') ?>");'>
<input type='hidden' name='lid' value='<?php echo $lid; ?>' />
<input type='hidden' name='action' value='importlabelresources' />
<ul style='list-style-type:none; text-align:center'>
<li>
<label for='the_file'><?php $clang->eT("Select ZIP file:") ?></label>
<input id='the_file' name="the_file" type="file" />