Пример #1
0
	public static function construct_section_chooser_options($topname = null)
	{
		require_once(DIR . '/includes/class_bootstrap_framework.php');
		require_once(DIR . '/packages/vbcms/contentmanager.php');
		vB_Bootstrap_Framework::init();

		$selectoptions = array();

		if ($topname)
		{
			$selectoptions['-1'] = $topname;
		}

		// get category options
		$nodelist = vBCms_ContentManager::getNodes(1,
				array('contenttypeid' => 'node2.contenttypeid = ' . vb_Types::instance()->getContentTypeID("vBCms_Section")));


		foreach ($nodelist as $section)
		{
			$selectoptions[$section['nodeid']] = str_replace('>', '>', $section['parent']) . $section['leaf'];
		}

		return $selectoptions;
	}
Пример #2
0
 public static function construct_section_chooser_options($topname = null)
 {
     require_once DIR . '/packages/vbcms/contentmanager.php';
     $selectoptions = array();
     if ($topname) {
         $selectoptions['-1'] = $topname;
     }
     // get section array
     $nodelist = vBCms_ContentManager::getNodes(1);
     foreach ($nodelist as $list) {
         $node = 0;
         $option = '';
         foreach ($list as $section) {
             if (is_array($section)) {
                 $node = $section['nodeid'];
                 $option .= $section['title'];
             } else {
                 $option .= $section . '>';
             }
         }
         $selectoptions[$node] = $option;
     }
     return $selectoptions;
 }