本文整理汇总了PHP中mosAdminMenus::ReadImagesX方法的典型用法代码示例。如果您正苦于以下问题:PHP mosAdminMenus::ReadImagesX方法的具体用法?PHP mosAdminMenus::ReadImagesX怎么用?PHP mosAdminMenus::ReadImagesX使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mosAdminMenus
的用法示例。
在下文中一共展示了mosAdminMenus::ReadImagesX方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editItem
//.........这里部分代码省略.........
}
$row->created = mosFormatDate($row->created, _CURRENT_SERVER_TIME_FORMAT);
$row->modified = $row->modified == $nullDate ? '' : mosFormatDate($row->modified, _CURRENT_SERVER_TIME_FORMAT);
$row->publish_up = mosFormatDate($row->publish_up, _CURRENT_SERVER_TIME_FORMAT);
if (trim($row->publish_down) == $nullDate || trim($row->publish_down) == '' || trim($row->publish_down) == '-') {
$row->publish_down = 'Never';
}
$row->publish_down = mosFormatDate($row->publish_down, _CURRENT_SERVER_TIME_FORMAT);
$query = "SELECT name" . "\n FROM #__users" . "\n WHERE id = " . (int) $row->created_by;
$database->setQuery($query);
$row->creator = $database->loadResult();
// test to reduce unneeded query
if ($row->created_by == $row->modified_by) {
$row->modifier = $row->creator;
} else {
$query = "SELECT name" . "\n FROM #__users" . "\n WHERE id = " . (int) $row->modified_by;
$database->setQuery($query);
$row->modifier = $database->loadResult();
}
$query = "SELECT content_id" . "\n FROM #__content_frontpage" . "\n WHERE content_id = " . (int) $row->id;
$database->setQuery($query);
$row->frontpage = $database->loadResult();
} else {
$row->sectionid = $sectionid;
$row->version = 0;
$row->state = 0;
$row->ordering = 0;
$row->images = array();
$row->publish_up = date('Y-m-d H:i:s', time() + $mosConfig_offset * 60 * 60);
$row->publish_down = 'Never';
$row->creator = 0;
$row->modifier = 0;
$row->frontpage = 0;
}
// pull param column from category info
$query = "SELECT params" . "\n FROM #__categories" . "\n WHERE id = " . (int) $row->catid;
$database->setQuery($query);
$categoryParam = $database->loadResult();
$paramsCat = new mosParameters($categoryParam, $mainframe->getPath('com_xml', 'com_categories'), 'component');
$selected_folders = $paramsCat->get('imagefolders', '');
if (!$selected_folders) {
$selected_folders = '*2*';
}
// check if images utilizes settings from section
if (strpos($selected_folders, '*2*') !== false) {
unset($selected_folders);
// load param column from section info
$query = "SELECT params" . "\n FROM #__sections" . "\n WHERE id = " . (int) $row->sectionid;
$database->setQuery($query);
$sectionParam = $database->loadResult();
$paramsSec = new mosParameters($sectionParam, $mainframe->getPath('com_xml', 'com_sections'), 'component');
$selected_folders = $paramsSec->get('imagefolders', '');
}
if (trim($selected_folders)) {
$temps = explode(',', $selected_folders);
foreach ($temps as $temp) {
$folders[] = mosHTML::makeOption($temp, $temp);
}
} else {
$folders[] = mosHTML::makeOption('*1*');
}
// calls function to read image from directory
$pathA = $mosConfig_absolute_path . '/images/stories';
$pathL = $mosConfig_live_site . '/images/stories';
$images = array();
if ($folders[0]->value == '*1*') {
$folders = array();
$folders[] = mosHTML::makeOption('/');
mosAdminMenus::ReadImages($pathA, '/', $folders, $images);
} else {
mosAdminMenus::ReadImagesX($folders, $images);
}
// list of folders in images/stories/
$lists['folders'] = mosAdminMenus::GetImageFolders($folders, $pathL);
// list of images in specfic folder in images/stories/
$lists['imagefiles'] = mosAdminMenus::GetImages($images, $pathL, $folders);
// list of saved images
$lists['imagelist'] = mosAdminMenus::GetSavedImages($row, $pathL);
// make the select list for the states
$states[] = mosHTML::makeOption(0, _CMN_UNPUBLISHED);
$states[] = mosHTML::makeOption(1, _CMN_PUBLISHED);
$lists['state'] = mosHTML::selectList($states, 'state', 'class="inputbox" size="1"', 'value', 'text', intval($row->state));
// build the html select list for ordering
$query = "SELECT ordering AS value, title AS text" . "\n FROM #__content" . "\n WHERE catid = " . (int) $row->catid . "\n ORDER BY ordering";
$lists['ordering'] = mosAdminMenus::SpecificOrdering($row, $uid, $query, 1);
// build list of categories
$lists['catid'] = mosAdminMenus::ComponentCategory('catid', $sectionid, intval($row->catid));
// build the select list for the image positions
$lists['_align'] = mosAdminMenus::Positions('_align');
// build the html select list for the group access
$lists['access'] = mosAdminMenus::Access($row);
// build the select list for the image caption alignment
$lists['_caption_align'] = mosAdminMenus::Positions('_caption_align');
// build the html select list for the group access
// build the select list for the image caption position
$pos[] = mosHTML::makeOption('bottom', _CMN_BOTTOM);
$pos[] = mosHTML::makeOption('top', _CMN_TOP);
$lists['_caption_position'] = mosHTML::selectList($pos, '_caption_position', 'class="inputbox" size="1"', 'value', 'text');
HTML_content::editContent($row, $section, $lists, $images, $access, $my->id, $sectionid, $task, $Itemid);
}
示例2: editContent
//.........这里部分代码省略.........
$rows2 = array();
foreach ($cat_list as $cat) {
if ($cat->section == $section->id) {
$rows2[] = $cat;
}
}
foreach ($rows2 as $row2) {
$sectioncategories[$section->id][] = mosHTML::makeOption($row2->id, $row2->name, 'id', 'name');
}
}
// get list of categories
if (!$row->catid && !$row->sectionid) {
$categories[] = mosHTML::makeOption('-1', 'Select Category', 'id', 'name');
$lists['catid'] = mosHTML::selectList($categories, 'catid', 'class="inputbox" size="1"', 'id', 'name');
} else {
$categoriesA = array();
if ($sectionid == 0) {
//$where = "\n WHERE section NOT LIKE '%com_%'";
foreach ($cat_list as $cat) {
$categoriesA[] = $cat;
}
} else {
//$where = "\n WHERE section = '$sectionid'";
foreach ($cat_list as $cat) {
if ($cat->section == $sectionid) {
$categoriesA[] = $cat;
}
}
}
$categories[] = mosHTML::makeOption('-1', 'Select Category', 'id', 'name');
$categories = array_merge($categories, $categoriesA);
$lists['catid'] = mosHTML::selectList($categories, 'catid', 'class="inputbox" size="1"', 'id', 'name', intval($row->catid));
}
// build the html select list for ordering
$query = "SELECT ordering AS value, title AS text" . "\n FROM #__content" . "\n WHERE catid = " . (int) $row->catid . "\n AND state >= 0" . "\n ORDER BY ordering";
$lists['ordering'] = mosAdminMenus::SpecificOrdering($row, $uid, $query, 1);
// pull param column from category info
$query = "SELECT params" . "\n FROM #__categories" . "\n WHERE id = " . (int) $row->catid;
$database->setQuery($query);
$categoryParam = $database->loadResult();
$paramsCat = new mosParameters($categoryParam, $mainframe->getPath('com_xml', 'com_categories'), 'component');
$selected_folders = $paramsCat->get('imagefolders', '');
if (!$selected_folders) {
$selected_folders = '*2*';
}
// check if images utilizes settings from section
if (strpos($selected_folders, '*2*') !== false) {
unset($selected_folders);
// load param column from section info
$query = "SELECT params" . "\n FROM #__sections" . "\n WHERE id = " . (int) $row->sectionid;
$database->setQuery($query);
$sectionParam = $database->loadResult();
$paramsSec = new mosParameters($sectionParam, $mainframe->getPath('com_xml', 'com_sections'), 'component');
$selected_folders = $paramsSec->get('imagefolders', '');
}
if (trim($selected_folders)) {
$temps = explode(',', $selected_folders);
foreach ($temps as $temp) {
$temp = ampReplace($temp);
$folders[] = mosHTML::makeOption($temp, $temp);
}
} else {
$folders[] = mosHTML::makeOption('*1*');
}
// calls function to read image from directory
$pathA = $mosConfig_absolute_path . '/images/stories';
$pathL = $mosConfig_live_site . '/images/stories';
$images = array();
if ($folders[0]->value == '*1*') {
$folders = array();
$folders[] = mosHTML::makeOption('/');
mosAdminMenus::ReadImages($pathA, '/', $folders, $images);
} else {
mosAdminMenus::ReadImagesX($folders, $images);
}
// list of folders in images/stories/
$lists['folders'] = mosAdminMenus::GetImageFolders($folders, $pathL);
// list of images in specfic folder in images/stories/
$lists['imagefiles'] = mosAdminMenus::GetImages($images, $pathL, $folders);
// list of saved images
$lists['imagelist'] = mosAdminMenus::GetSavedImages($row, $pathL);
// build list of users
$active = intval($row->created_by) ? intval($row->created_by) : $my->id;
$lists['created_by'] = mosAdminMenus::UserSelect('created_by', $active);
// build the select list for the image position alignment
$lists['_align'] = mosAdminMenus::Positions('_align');
// build the select list for the image caption alignment
$lists['_caption_align'] = mosAdminMenus::Positions('_caption_align');
// build the html select list for the group access
$lists['access'] = mosAdminMenus::Access($row);
// build the html select list for menu selection
$lists['menuselect'] = mosAdminMenus::MenuSelect();
// build the select list for the image caption position
$pos[] = mosHTML::makeOption('bottom', _CMN_BOTTOM);
$pos[] = mosHTML::makeOption('top', _CMN_TOP);
$lists['_caption_position'] = mosHTML::selectList($pos, '_caption_position', 'class="inputbox" size="1"', 'value', 'text');
// get params definitions
$params = new mosParameters($row->attribs, $mainframe->getPath('com_xml', 'com_content'), 'component');
HTML_content::editContent($row, $contentSection, $lists, $sectioncategories, $images, $params, $option, $redirect, $menus);
}