当前位置: 首页>>代码示例>>PHP>>正文


PHP ModeleBoxes::showBox方法代码示例

本文整理汇总了PHP中ModeleBoxes::showBox方法的典型用法代码示例。如果您正苦于以下问题:PHP ModeleBoxes::showBox方法的具体用法?PHP ModeleBoxes::showBox怎么用?PHP ModeleBoxes::showBox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ModeleBoxes的用法示例。


在下文中一共展示了ModeleBoxes::showBox方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: showBox

 /**
  *	Method to show box
  *
  *	@param	array	$head       Array with properties of box title
  *	@param  array	$contents   Array with properties of box lines
  *	@return	void
  */
 function showBox($head = null, $contents = null)
 {
     parent::showBox($this->info_box_head, $this->info_box_contents);
 }
开发者ID:TAASA,项目名称:Dolibarr-ERP-3.8.1,代码行数:11,代码来源:box_project.php

示例2: showBox

 /**
  *	Method to show box
  *
  *	@param	array	$head       Array with properties of box title
  *	@param  array	$contents   Array with properties of box lines
  *	@return	void
  */
 function showBox($head = null, $contents = null)
 {
     global $langs, $conf;
     parent::showBox($this->info_box_head, $this->info_box_contents);
     if ($conf->global->SHOW_DIALOG_HOMEPAGE) {
         $actioncejour = false;
         $contents = $this->info_box_contents;
         $nblines = count($contents);
         $bcx = array();
         $bcx[0] = 'class="box_pair"';
         $bcx[1] = 'class="box_impair"';
         if ($contents[0][0]['text'] != $langs->trans("NoActionsToDo")) {
             print '<div id="dialog" title="' . $nblines . " " . $langs->trans("ActionsToDo") . '">';
             print '<table width=100%>';
             for ($i = 0, $n = $nblines; $i < $n; $i++) {
                 if (isset($contents[$i])) {
                     // on affiche que les évènement du jours ou passé
                     // qui ne sont pas à 100%
                     $actioncejour = true;
                     $var = !$var;
                     // TR
                     $logo = $contents[$i][0]['logo'];
                     $label = $contents[$i][1]['text'];
                     $urlevent = $contents[$i][1]['url'];
                     $logosoc = $contents[$i][2]['logo'];
                     $nomsoc = $contents[$i][3]['text'];
                     $urlsoc = $contents[$i][3]['url'];
                     $dateligne = $contents[$i][4]['text'];
                     $percentage = $contents[$i][5]['text'];
                     print '<tr ' . $bcx[$var] . '>';
                     print '<td align=center>';
                     print img_object("", $logo);
                     print '</td>';
                     print '<td align=center><a href="' . $urlevent . '">' . $label . '</a></td>';
                     print '<td align=center><a href="' . $urlsoc . '">' . img_object("", $logosoc) . " " . $nomsoc . '</a></td>';
                     print '<td align=center>' . $dateligne . '</td>';
                     print '<td align=center>' . $percentage . '</td>';
                     print '</tr>';
                 }
             }
             print '</table>';
         }
         print '</div>';
         if ($actioncejour) {
             print '<script>';
             print '$( "#dialog" ).dialog({ autoOpen: true });';
             if ($conf->global->SHOW_DIALOG_HOMEPAGE > 1) {
                 print 'setTimeout(function(){';
                 print '$("#dialog").dialog("close");';
                 print '}, ' . $conf->global->SHOW_DIALOG_HOMEPAGE * 1000 . ');';
             }
             print '</script>';
         } else {
             print '<script>';
             print '$( "#dialog" ).dialog({ autoOpen: false });';
             print '</script>';
         }
     }
 }
开发者ID:ADDAdev,项目名称:Dolibarr,代码行数:66,代码来源:box_actions.php

示例3: printBoxesArea


//.........这里部分代码省略.........
	    	    	handle: \'.boxhandle\',
	    	    	revert: \'invalid\',
	       			items: \'.box\',
	        		containment: \'.fiche\',
	        		connectWith: \'.connectedSortable\',
	        		stop: function(event, ui) {
	        			updateBoxOrder(0);
	        		}
	    		});

	        	jQuery(".boxclose").click(function() {
	        		var self = this;	// because JQuery can modify this
	        		var boxid=self.id.substring(8);
	        		var label=jQuery(\'#boxlabelentry\'+boxid).val();
	        		jQuery(\'#boxto_\'+boxid).remove();
	        		if (boxid > 0) jQuery(\'#boxcombo\').append(new Option(label, boxid));
	        		updateBoxOrder(1);
	        	});

        	});' . "\n";
            print '</script>' . "\n";
        }
        $nbboxactivated = count($boxidactivatedforuser);
        print load_fiche_titre($nbboxactivated ? $langs->trans("OtherInformationsBoxes") : '', $selectboxlist, '', '', 'otherboxes');
        if ($nbboxactivated) {
            $langs->load("boxes");
            $langs->load("projects");
            $emptybox = new ModeleBoxes($db);
            print '<table width="100%" class="notopnoleftnoright">';
            print '<tr><td class="notopnoleftnoright">' . "\n";
            print '<div class="fichehalfleft">';
            print "\n<!-- Box left container -->\n";
            print '<div id="left" class="connectedSortable">' . "\n";
            // Define $box_max_lines
            $box_max_lines = 5;
            if (!empty($conf->global->MAIN_BOXES_MAXLINES)) {
                $box_max_lines = $conf->global->MAIN_BOXES_MAXLINES;
            }
            $ii = 0;
            foreach ($boxactivated as $key => $box) {
                if (!empty($user->conf->{$confuserzone}) && $box->fk_user == 0 || empty($user->conf->{$confuserzone}) && $box->fk_user != 0) {
                    continue;
                }
                if (empty($box->box_order) && $ii < $nbboxactivated / 2) {
                    $box->box_order = 'A' . sprintf("%02d", $ii + 1);
                }
                // When box_order was not yet set to Axx or Bxx and is still 0
                if (preg_match('/^A/i', $box->box_order)) {
                    $ii++;
                    //print 'box_id '.$boxactivated[$ii]->box_id.' ';
                    //print 'box_order '.$boxactivated[$ii]->box_order.'<br>';
                    // Affichage boite key
                    $box->loadBox($box_max_lines);
                    $box->showBox();
                }
            }
            if (empty($conf->browser->phone)) {
                $emptybox->box_id = 'A';
                $emptybox->info_box_head = array();
                $emptybox->info_box_contents = array();
                $emptybox->showBox(array(), array());
            }
            print "</div>\n";
            print "<!-- End box left container -->\n";
            print '</div><div class="fichehalfright"><div class="ficheaddleft">';
            print "\n<!-- Box right container -->\n";
            print '<div id="right" class="connectedSortable">' . "\n";
            $ii = 0;
            foreach ($boxactivated as $key => $box) {
                if (!empty($user->conf->{$confuserzone}) && $box->fk_user == 0 || empty($user->conf->{$confuserzone}) && $box->fk_user != 0) {
                    continue;
                }
                if (empty($box->box_order) && $ii < $nbboxactivated / 2) {
                    $box->box_order = 'B' . sprintf("%02d", $ii + 1);
                }
                // When box_order was not yet set to Axx or Bxx and is still 0
                if (preg_match('/^B/i', $box->box_order)) {
                    $ii++;
                    //print 'box_id '.$boxactivated[$ii]->box_id.' ';
                    //print 'box_order '.$boxactivated[$ii]->box_order.'<br>';
                    // Affichage boite key
                    $box->loadBox($box_max_lines);
                    $box->showBox();
                }
            }
            if (empty($conf->browser->phone)) {
                $emptybox->box_id = 'B';
                $emptybox->info_box_head = array();
                $emptybox->info_box_contents = array();
                $emptybox->showBox(array(), array());
            }
            print "</div>\n";
            print "<!-- End box right container -->\n";
            print '</div></div>';
            print "\n";
            print "</td></tr>";
            print "</table>";
        }
        return count($boxactivated);
    }
开发者ID:Albertopf,项目名称:prueba,代码行数:101,代码来源:html.formother.class.php

示例4: printBoxesArea

 /**
  * 	Show a HTML Tab with boxes of a particular area including personalized choices of user
  *
  * 	@param	   User         $user		 Object User
  * 	@param	   String       $areacode    Code of area for pages (0=value for Home page)
  * 	@return    int                       <0 if KO, Nb of boxes shown of OK (0 to n)
  */
 static function printBoxesArea($user, $areacode)
 {
     global $conf, $langs, $db;
     include_once DOL_DOCUMENT_ROOT . '/core/class/infobox.class.php';
     //$infobox=new InfoBox($db);
     $boxactivated = InfoBox::listboxes($db, 'activated', $areacode, $user);
     $arrayboxactivatedid = array();
     foreach ($boxactivated as $box) {
         $arrayboxactivatedid[$box->id] = $box->id;
     }
     $selectboxlist = '';
     if ($conf->use_javascript_ajax) {
         $emptyuser = new User($db);
         $boxavailable = InfoBox::listboxes($db, 'activated', $areacode, $emptyuser, $arrayboxactivatedid);
         // Available here is activated for empty user
         $arrayboxtoactivatelabel = array();
         foreach ($boxavailable as $box) {
             $arrayboxtoactivatelabel[$box->id] = $box->boxlabel;
         }
         $form = new Form($db);
         $selectboxlist = $form->selectarray('boxcombo', $arrayboxtoactivatelabel, '', 1);
     }
     print '<script type="text/javascript" language="javascript">
     jQuery(document).ready(function() {
     	jQuery("#boxcombo").change(function() {
     	var boxid=jQuery("#boxcombo").val();
     		if (boxid > 0) {
         		var left_list = cleanSerialize(jQuery("#left").sortable("serialize"));
         		var right_list = cleanSerialize(jQuery("#right").sortable("serialize"));
         		var boxorder = \'A:\' + left_list + \'-B:\' + right_list;
 				jQuery.ajax({ url: \'' . DOL_URL_ROOT . '/core/ajax/box.php?boxorder=\'+boxorder+\'&boxid=\'+boxid+\'&zone=' . $areacode . '&userid=' . $user->id . '\',
 			        async:   false
 		        });
     			//jQuery.get(\'' . DOL_URL_ROOT . '/core/ajax/box.php?boxorder=\'+boxorder+\'&boxid=\'+boxid+\'&zone=' . $areacode . '&userid=' . $user->id . '\');
     			window.location.search=\'mainmenu=' . GETPOST("mainmenu") . '&leftmenu=' . GETPOST('leftmenu') . '&action=addbox&boxid=\'+boxid;
 				//window.location.href=\'' . $_SERVER["PHP_SELF"] . '\';
             }
     	});';
     if (!count($arrayboxtoactivatelabel)) {
         print 'jQuery("#boxcombo").hide();';
     }
     print '
 	});
     </script>';
     print load_fiche_titre(count($boxactivated) ? $langs->trans("OtherInformationsBoxes") : '', $selectboxlist, '', '', 'otherboxes');
     if (count($boxactivated)) {
         print '<table width="100%" class="notopnoleftnoright">';
         print '<tr><td class="notopnoleftnoright">' . "\n";
         print '<div class="fichehalfleft">';
         print "\n<!-- Box left container -->\n";
         print '<div id="left" class="connectedSortable">' . "\n";
         // Define $box_max_lines
         $box_max_lines = 5;
         if (!empty($conf->global->MAIN_BOXES_MAXLINES)) {
             $box_max_lines = $conf->global->MAIN_BOXES_MAXLINES;
         }
         $ii = 0;
         foreach ($boxactivated as $key => $box) {
             if (preg_match('/^A/i', $box->box_order)) {
                 $ii++;
                 //print 'box_id '.$boxactivated[$ii]->box_id.' ';
                 //print 'box_order '.$boxactivated[$ii]->box_order.'<br>';
                 // Affichage boite key
                 $box->loadBox($box_max_lines);
                 $box->showBox();
             }
         }
         $emptybox = new ModeleBoxes($db);
         $emptybox->box_id = 'A';
         $emptybox->info_box_head = array();
         $emptybox->info_box_contents = array();
         $emptybox->showBox(array(), array());
         print "</div>\n";
         print "<!-- End box container -->\n";
         print '</div><div class="fichehalfright"><div class="ficheaddleft">';
         print "\n<!-- Box right container -->\n";
         print '<div id="right" class="connectedSortable">' . "\n";
         $ii = 0;
         foreach ($boxactivated as $key => $box) {
             if (preg_match('/^B/i', $box->box_order)) {
                 $ii++;
                 //print 'box_id '.$boxactivated[$ii]->box_id.' ';
                 //print 'box_order '.$boxactivated[$ii]->box_order.'<br>';
                 // Affichage boite key
                 $box->loadBox($box_max_lines);
                 $box->showBox();
             }
         }
         $emptybox = new ModeleBoxes($db);
         $emptybox->box_id = 'B';
         $emptybox->info_box_head = array();
         $emptybox->info_box_contents = array();
         $emptybox->showBox(array(), array());
//.........这里部分代码省略.........
开发者ID:nrjacker4,项目名称:crm-php,代码行数:101,代码来源:html.formother.class.php

示例5: showBox

 /**
  * Method to show box. Called by Dolibarr eatch time it wants to display the box.
  *
  * @param array $head Array with properties of box title
  * @param array $contents Array with properties of box lines
  * @return void
  */
 public function showBox($head = null, $contents = null)
 {
     // You may make your own code here…
     // … or use the parent's class function using the provided head and contents templates
     parent::showBox($this->info_box_head, $this->info_box_contents);
 }
开发者ID:simnandez,项目名称:dolibarr-module-template,代码行数:13,代码来源:mybox.php

示例6: printBoxesArea

/**
 * 		Show a HTML Tab with boxes of a particular area including personalized choices of user
 *
 * 		@param	   User         $user		 Object User
 * 		@param	   String       $areacode    Code of area for pages (0=value for Home page)
 * 		@return    int                       <0 if KO, Nb of boxes shown of OK (0 to n)
 */
function printBoxesArea($user,$areacode)
{
	global $conf,$langs,$db;

	$infobox=new InfoBox($db);
	$boxarray=$infobox->listboxes($areacode,$user);

	//$boxid_left = array();
	//$boxid_right = array();
	if (count($boxarray))
	{
		print_fiche_titre($langs->trans("OtherInformationsBoxes"),'','','','otherboxes');
		print '<table width="100%" class="notopnoleftnoright">';
		print '<tr><td class="notopnoleftnoright">'."\n";

		print '<table width="100%" style="border-collapse: collapse; border: 0px; margin: 0px; padding: 0px;"><tr>';

		// Affichage colonne gauche
		print '<td width="50%" valign="top" class="notopnoleft" style="padding-right: 8px;">'."\n";

		print "\n<!-- Box left container -->\n";
		print '<div id="left" class="connectedSortable">'."\n";

		$ii=0;
		foreach ($boxarray as $key => $box)
		{
			if (preg_match('/^A/i',$box->box_order)) // column A
			{
				$ii++;
				//print 'box_id '.$boxarray[$ii]->box_id.' ';
				//print 'box_order '.$boxarray[$ii]->box_order.'<br>';
				//$boxid_left[$key] = $box->box_id;
				// Affichage boite key
				$box->loadBox($conf->box_max_lines);
				$box->showBox();
			}
		}

		// If no box on left, we add an invisible empty box
//		if ($ii==0)
//		{
			$emptybox=new ModeleBoxes($db);
			$emptybox->box_id='A';
			$emptybox->info_box_head=array();
			$emptybox->info_box_contents=array();
			$emptybox->showBox(array(),array());
//		}

		print "</div>\n";
		print "<!-- End box container -->\n";

		print "</td>\n";
		// Affichage colonne droite
		print '<td width="50%" valign="top">';

		print "\n<!-- Box right container -->\n";
		print '<div id="right" class="connectedSortable">'."\n";

		$ii=0;
		foreach ($boxarray as $key => $box)
		{
			if (preg_match('/^B/i',$box->box_order)) // colonne B
			{
				$ii++;
				//print 'box_id '.$boxarray[$ii]->box_id.' ';
				//print 'box_order '.$boxarray[$ii]->box_order.'<br>';
				//$boxid_right[$key] = $boxarray[$key]->box_id;
				// Affichage boite key
				$box->loadBox($conf->box_max_lines);
				$box->showBox();
			}
		}

		// If no box on right, we show add an invisible empty box
//		if ($ii==0)
//		{
			$emptybox=new ModeleBoxes($db);
			$emptybox->box_id='B';
			$emptybox->info_box_head=array();
			$emptybox->info_box_contents=array();
			$emptybox->showBox(array(),array());
//		}

		print "</div>\n";
		print "<!-- End box container -->\n";
		print "</td>";
		print "</tr></table>\n";
		print "\n";

		print "</td></tr>";
		print "</table>";

		if ($conf->use_javascript_ajax)
//.........这里部分代码省略.........
开发者ID:remyyounes,项目名称:dolibarr,代码行数:101,代码来源:boxes.php


注:本文中的ModeleBoxes::showBox方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。